---
source: https://iinventedlight.com/library/notes/sklearn-estimator-api.md
title: "The scikit-learn estimator API"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_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); prose restates or closely paraphrases cited source lines"
license_family: sklearn-bsd3
rule_check: "needs rule check (family not in auto-publish rule; check.mjs auto-approves only usgov and arxiv-ccby)"
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: scikit-learn"
tags: ['scikit-learn', 'estimator', 'api']
sources:
  - id: S1
    title: "Developing scikit-learn estimators — scikit-learn 1.9.1 documentation"
    publisher: scikit-learn docs
    url: https://scikit-learn.org/stable/developers/develop.html
    accessed: 2026-11-04
    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)"
  - id: S2
    title: "Getting Started — scikit-learn 1.9.1 documentation"
    publisher: scikit-learn docs
    url: https://scikit-learn.org/stable/getting_started.html
    accessed: 2026-11-04
    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)"
---
# 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).
