Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started