I am a beginner at learning sklearn from Python. I know we could create any class by ourselves with something like that:
class name():
def __init__(self):
pass
def fit(self, x):
return something
But I cannot understand why when we try to custom the transformer or the class in sklearn we need to use BaseEstimator and Transformermixmin as below:
from sklearn.base import BaseEstimator, Transformermixmin
class name(BaseEstimator, Transformermixmin):
def __init(self):
pass
def fit(self, x):
return self
what is the difference between the empty class and the other one with BaseEstimator, Transformermixmin? How can BaseEstimator and Transformermixmin work and what does it used for? Can someone answer the above questions and give me more examples or clear explanations about them? Thank you so much!