Module

pycaret.core.results

Typed result objects returned from every Experiment operation.

Every PyCaret 4.0 verb (compare_models, create_model, tune_model, ...) returns a frozen dataclass. This gives us three things simultaneously:

  1. Notebook compatibility — the result's .pipeline (or .models / .best) is still a sklearn Pipeline you can use directly, and the pull() functional still returns the leaderboard DataFrame.
  2. Agent / UI friendliness — all fields are introspectable, typed, and serializable (except the sklearn Pipeline itself, which carries its own pickling contract via joblib/cloudpickle).
  3. Event trace — every result carries the Event list produced during its operation so a UI can replay progress after the fact.

Fields that a React UI / LLM agent cares about are first-class; convenience fields (DataFrames) are derived or side-channel.

Classes 9

CreateResult

Returned by Experiment.create_model(...).

Attributes#

pipeline : sklearn.pipeline.Pipeline

The fitted preprocessing + estimator pipeline. Return value of the
legacy `create_model(...)` call in 3.x for drop-in compatibility.

model_id : str

The pycaret model id that was created (e.g. "lr", "rf").

metrics : pandas.DataFrame

The cross-validated metrics table for this fit (one row per fold +
a mean / std row).

params : dict

The estimator's fitted parameters (from `get_params()`), handy for
logging/UI display.

events : list[Event]

Attributes
  • pipeline: Pipeline
  • model_id: str
  • metrics: pd.DataFrame
  • params: dict[str, Any]
  • events: list[Event]

CompareResult

Returned by Experiment.compare_models(...).

Attributes
  • best: Pipeline
  • models: list[Pipeline]
  • leaderboard: pd.DataFrame
  • ranked_ids: list[str]
  • events: list[Event]

TuneResult

Returned by Experiment.tune_model(...).

Attributes
  • pipeline: Pipeline
  • best_params: dict[str, Any]
  • search: BaseCrossValidator | None
  • cv_results: pd.DataFrame
  • metrics: pd.DataFrame
  • events: list[Event]

EnsembleResult

Returned by Experiment.ensemble_model(...) (bagging / boosting).

Attributes
  • pipeline: Pipeline
  • method: str
  • metrics: pd.DataFrame
  • events: list[Event]

BlendResult

Returned by Experiment.blend_models(...).

Attributes
  • pipeline: Pipeline
  • metrics: pd.DataFrame
  • events: list[Event]

StackResult

Returned by Experiment.stack_models(...).

Attributes
  • pipeline: Pipeline
  • metrics: pd.DataFrame
  • events: list[Event]

CalibrateResult

Returned by Experiment.calibrate_model(...).

Attributes
  • pipeline: Pipeline
  • method: str
  • metrics: pd.DataFrame
  • events: list[Event]

FinalizeResult

Returned by Experiment.finalize_model(...) — the full-data refit.

Attributes
  • pipeline: Pipeline
  • events: list[Event]

PredictResult

Returned by Experiment.predict_model(...).

The notebook-familiar return shape is predictions — a DataFrame with the original columns plus prediction_label and (for classification) a prediction_score column.

Attributes
  • predictions: pd.DataFrame
  • metrics: pd.DataFrame | None
  • events: list[Event]