The scikit-learn estimator API
Answer: An estimator is an object that fits a model based on some training data and is capable of inferring some properties on new data. Scikit-learn provides dozens of built-in machine learning algorithms and models, called estimators. (S1, S2)
Using estimators
- Each estimator can be fitted to some data using its fit method. (S2)
- Both X and y are usually expected to be numpy arrays or equivalent array-like data types, though some estimators work with other formats such as sparse matrices. (S2)
- Once the estimator is fitted, it can be used for predicting target values of new data. (S2)
Writing your own
- Out of all the methods that an estimator implements, fit is usually the one you want to implement yourself. (S1)
- Common methods are implemented in BaseEstimator, which you should inherit from. (S1)
- A user should be able to instantiate an estimator without passing any arguments to it. (S1)
- Most arguments correspond to hyperparameters describing the model or the optimisation problem the estimator tries to solve. (S1)
- Meta-estimators are estimators that wrap other estimators. (S1)
Claims
- id: C1 claim: An estimator fits a model to training data. source: S1 evidence: "object that fits a model based on some training data and is capable of"
- id: C2 claim: Inherit from BaseEstimator. source: S1 evidence: "are implemented in BaseEstimator, which you should inherit from."
- id: C3 claim: Estimators are fitted with fit. source: S2 evidence: "Each estimator can be fitted to some data"
- id: C4 claim: Fitted estimators predict on new data. source: S2 evidence: "it can be used for predicting target values of"
Sources
- [S1] Developing scikit-learn estimators — scikit-learn 1.9.1 documentation. scikit-learn docs. https://scikit-learn.org/stable/developers/develop.html . License: BSD-3-Clause (scikit-learn/scikit-learn COPYING; Copyright (c) 2007-2026 The scikit-learn developers; https://github.com/scikit-learn/scikit-learn/blob/main/COPYING). Accessed 2026-11-04.
- [S2] Getting Started — scikit-learn 1.9.1 documentation. scikit-learn docs. https://scikit-learn.org/stable/getting_started.html . License: BSD-3-Clause (scikit-learn/scikit-learn COPYING; Copyright (c) 2007-2026 The scikit-learn developers; https://github.com/scikit-learn/scikit-learn/blob/main/COPYING). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: scikit-learn docs, Developing scikit-learn estimators — scikit-learn 1.9.1 documentation, BSD-3-Clause (scikit-learn/scikit-learn COPYING; Copyright (c) 2007-2026 The scikit-learn developers; https://github.com/scikit-learn/scikit-learn/blob/main/COPYING); scikit-learn docs, Getting Started — scikit-learn 1.9.1 documentation, BSD-3-Clause (scikit-learn/scikit-learn COPYING; Copyright (c) 2007-2026 The scikit-learn developers; https://github.com/scikit-learn/scikit-learn/blob/main/COPYING).
Cite this
iinventedlight. 2026. "The scikit-learn estimator API." iinventedlight Library, iil:note:jkmykwwq, version of 2026-11-04. https://iinventedlight.com/library/notes/sklearn-estimator-api/. License: CC-BY-4.0.
@misc{iil_note_jkmykwwq,
author = {{iinventedlight}},
title = {{The scikit-learn estimator API}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/sklearn-estimator-api/},
note = {Permanent ID iil:note:jkmykwwq. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/sklearn-estimator-api.md.