Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Scikit learn Scikit learn Baseline Models

From Leeroopedia


Knowledge Sources
Domains Model Evaluation, Supervised Learning
Last Updated 2026-02-08 15:00 GMT

Overview

Baseline models provide simple, naive prediction strategies that serve as reference points against which the performance of more sophisticated models is measured.

Description

Baseline models (also called dummy estimators) implement prediction strategies that ignore the input features entirely, producing predictions based solely on simple statistics of the training targets. They solve the critical problem of establishing a performance floor: any useful model should outperform these naive strategies. Without a baseline, it is impossible to know whether a model's accuracy is meaningful or merely reflects trivial patterns such as class imbalance. Baseline models are an essential component of rigorous model evaluation methodology, providing the minimum acceptable standard of performance.

Usage

Use dummy classifiers to verify that a classification model performs better than trivial strategies. The "most frequent" strategy always predicts the majority class and establishes the accuracy baseline for imbalanced datasets. The "stratified" strategy generates random predictions proportional to class frequencies, establishing a baseline that respects class distribution. The "uniform" strategy predicts classes uniformly at random. Use dummy regressors similarly: the "mean" strategy always predicts the training set mean, and the "median" strategy predicts the median. Any model that fails to exceed the baseline performance may be learning noise rather than signal.

Theoretical Basis

Dummy Classifier Strategies:

Most Frequent: Always predicts the most frequent class in the training set: y^=argmaxci=1n𝟏(yi=c)

Expected accuracy on the training set: acc=maxcncn, where nc is the count of class c.

Stratified: Generates predictions by sampling from the training class distribution: P(y^=c)=ncn

Expected accuracy: E[acc]=c(ncn)2.

Uniform: Generates predictions uniformly at random: P(y^=c)=1K

Expected accuracy: E[acc]=1Kcncn=1K.

Constant: Always predicts a user-specified constant class.

Dummy Regressor Strategies:

Mean: y^=y¯=1ni=1nyi

The mean predictor minimizes the MSE: MSE=Var(y). A model with R2>0 outperforms this baseline.

Median: y^=median(y1,,yn)

The median predictor minimizes the MAE and is more robust to outliers.

Quantile: Predicts a specified quantile of the training target distribution.

Constant: Always predicts a user-specified constant value.

Interpretation: A model's R2 score directly measures improvement over the mean baseline: R2=1SSresSStot=1MSEmodelMSEmean baseline

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment