liveBook · Manning

Estimator

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A scikit-learn-compatible object that implements model fitting and typically prediction or transformation operations.

An estimator is a Scikit-learn object that learns from data through `.fit`. In supervised learning, fitting receives data and targets; in unsupervised learning, it receives data alone. Fitting estimates parameters and stores learned information as object attributes for later prediction or transformation. section 4.1.2

The interface separates learning from using a model. Predictors expose `.predict` and often `.predict_proba`; transformers expose `.transform`. A single class can implement more than one of these roles, but estimators are central because most Scikit-learn classes learn from data. section 4.1.2

Fit a logistic-regression estimator

Create `LogisticRegression`, fit it on feature rows `X` and targets `y`, then pass new rows to `.predict` or `.predict_proba`. This keeps training distinct from later test-data inference. section 4.1.2

X = [[-1, -1], [-2, -1], [1, 1], [2, 1]]
y = [1, 1, 0, 0]
model.fit(X, y)

This listing shows the minimal supervised estimator workflow: define feature data and labels, then call `.fit(X, y)`. section 4.1.2

Because objects share a fit-oriented interface, evaluation utilities can accept different algorithms consistently. `cross_validate` takes an estimator, predictors, targets, a cross-validation strategy, and scoring functions, returning train and validation scores, timings, and fold-trained estimators. section 4.3

An estimator can also be a configurable component inside an ensemble. `BaggingClassifier` and `BaggingRegressor` use their `estimator` parameter to choose the model built repeatedly; a decision tree is the default, but another weak or strong model may be supplied. section 5.1.1

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Defines fitting, learned attributes, prediction, transformation, scoring, and cross-validation use without detailing estimator internals.
Examples
Uses LogisticRegression with small feature rows and labels, plus BaggingClassifier configured with DecisionTreeClassifier.
What you can do after
Apply it via Scikit-learn by fitting models, predicting or transforming new data, and passing models to cross-validation.
How it connects
Connects estimators to supervised learning, unsupervised learning, transformers, predictors, cross-validation, and bagging.

Also explained in

Compare how 3 books explain estimator →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.