Estimator
noun
say it: “ES-tih-may-ter” /ˈɛstəˌmeɪtər/
In scikit-learn, any object that learns from data through a fit method, such as a model or a tool that prepares data.
What is an estimator in scikit-learn?
An estimator is scikit-learn's word for any object that learns from data with a fit() method: a model such as
LinearRegression, and also a tool such as StandardScaler. Every estimator works the same way, so swapping one for
another changes one line.
from sklearn.linear_model import LinearRegression
from sklearn.tree import DecisionTreeRegressor
for model in (LinearRegression(), DecisionTreeRegressor()):
model.fit([[60], [70], [80]], [20, 40, 60]) # the same call for both
print(model.predict([[70]])) # [40.] each time
In a sentence
- “She swapped one estimator for another and the rest of the code stayed the same.”
- “Every estimator in scikit-learn learns with fit().”
Level: Journeyman · More Python terms at this level
Updated