Low-code AutoML · train, compare, tune & deploy in a few lines · verified against PyCaret 3.4 (2026)

PyCaret cheat sheet

PyCaret wraps scikit-learn, XGBoost, LightGBM and more behind a tiny, consistent API: setup() builds a preprocessing pipeline, compare_models() trains & ranks a dozen models by cross-validation, and a handful of verbs tune, ensemble, interpret, and deploy the winner. Great for fast baselines and low-code ML across classification, regression, clustering, anomaly detection and time series. This sheet targets the stable PyCaret 3.4 functional API (note: 4.0, in alpha, moves to an OOP-only *Experiment API).

setup compare & create tune & ensemble analyze & predict finalize & deploy gotcha most common

Verified 2026-08-24 against the official docs at pycaret.gitbook.io / pycaret.readthedocs.io and the pycaret/pycaret repo (3.4 stable; 4.0 alpha). Works with scikit-learn 1.x, pandas 2, NumPy 2 on Python 3.9–3.12+.

Outline

The whole workflow is ~6 calls: setup → compare_models → tune_model → predict_model → finalize_model → save_model. Everything else refines a step.

Prepare

  1. 1 · Install & setup()
  2. 2 · Preprocessing options

Train

  1. 3 · compare_models
  2. 4 · create_model

Optimize

  1. 5 · tune_model
  2. 6 · Ensembles

Understand

  1. 7 · plot / evaluate / interpret
  2. 8 · predict_model

Ship

  1. 9 · finalize, save, deploy
  2. 10 · Gotchas
  3. Worth memorizing

Prepare

setup() does all the preprocessing — it's the most important call.

1Install & setup()3.4
2Preprocessing optionssetup args

Train

Let PyCaret pick a winner, or train a specific model.

3compare_modelsthe AutoML step
4create_modela specific model

Optimize

Tune hyperparameters and combine models.

5tune_modelhyperparameters
6Ensemblescombine models

Understand & Predict

Diagnose the model, then score new data.

7plot / evaluate / interpretdiagnostics
8predict_modelscore data

Ship

Retrain on all data, persist, and deploy.

9finalize, save, deployproduction
!Common gotchasread before shipping

Worth memorizing

setup → compare → tune → predict → finalize → savethe whole workflow in six calls
same verbs, five tasksimport pycaret.classification / regression / clustering / anomaly / time_series
setup() is the pipelinesplit + impute/encode/scale + options like fix_imbalance, feature_selection
compare_models = AutoML leaderboardn_select for several; pull() for the grid
tune_model with optuna backendchoose_better keeps it only if it wins
blend/stack for a bumpcombine the top models
interpret_model = SHAPplot_model/evaluate_model for diagnostics
finalize last, then save the pipelinesave_model bundles preprocessing + model
log_experiment=Trueauto MLflow tracking