Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TODO 10 Now it's your turn to define an entire class. Complete the TODO by creating the LogTransformer class. Define the LogTransformer class by following

TODO 10

Now it's your turn to define an entire class. Complete the TODO by creating the LogTransformer class.

Define the LogTransformer class by following the below steps:Create a class called LogTransformer. Make sure this class inherits BaseEstimator and TransformerMixin.

Note: as we don't need the constructor method __init__() we don't have to define it.

Define the fit() method. Be sure it takes the arguments self, X, and y=None just like we did above. Further, make sure to return self otherwise you will get errors.

Define the transform() method which takes the arguments self, X, and y=None just like we did above.

In the transform() method, return the log of the input data X. Be sure you add 1 to the data before computing the log as it is not possible to take (0)(0)!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

From Zero To Data Hero With Chatgpt

Authors: Andrew Wu

1st Edition

B0CQRJPXD9, 979-8989523009

More Books

Students also viewed these Databases questions

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Discuss the Rights issue procedure in detail.

Answered: 1 week ago

Question

Explain the procedure for valuation of shares.

Answered: 1 week ago

Question

Which months of this year 5 Mondays ?

Answered: 1 week ago

Question

Define Leap year?

Answered: 1 week ago