Installation¶
Stable release¶
Install from PyPI (recommended):
Install from conda-forge:
Core dependencies¶
The base install includes: scikit-learn, pandas, numpy, tqdm, joblib, click.
Optional extras¶
Lazy Predict has several optional dependency groups. Install them with pip extras:
Boosting libraries¶
XGBoost, LightGBM, and CatBoost (all support GPU acceleration):
On macOS, XGBoost and LightGBM also need the OpenMP runtime:
Without it, lazypredict warns that the library could not be imported and skips its models.
Categorical encoders¶
Target and binary encoding (categorical_encoder="target" / "binary") via
category-encoders:
Time series forecasting¶
Statistical models (Holt-Winters, SARIMAX, Theta):
Add deep learning models (LSTM, GRU via PyTorch):
Add the Google TimesFM foundation model (installs timesfm[torch]):
MLflow experiment tracking¶
Activate tracking by setting an environment variable before running:
Hyperparameter tuning¶
The flaml extra installs flaml[automl], which the FLAML backend needs. Its
dependency constraints (at the time of writing, xgboost<3) apply to your
environment as well.
Enable with tune=True in any Lazy estimator:
Visualization¶
Required for LazyForecaster.plot_results() and all plotting utilities.
Explainability¶
pip install lazypredict[explain] # SHAP values
pip install lazypredict[interpret] # InterpretML (EBM)
Distributed / Spark¶
All optional dependencies¶
GPU acceleration¶
GPU acceleration requires an NVIDIA GPU with CUDA support:
pip install lazypredict[boost] # XGBoost, LightGBM, CatBoost (all support GPU)
pip install cuml-cu12 # cuML (RAPIDS) GPU-native sklearn replacements
Enable with use_gpu=True:
Supported GPU backends:
| Backend | Package | Parameter |
|---|---|---|
| XGBoost | xgboost |
device="cuda" |
| LightGBM | lightgbm |
device="gpu" |
| CatBoost | catboost |
task_type="GPU" |
| cuML | cuml-cu12 |
GPU-native (no extra params) |
| LSTM / GRU | torch with CUDA |
CUDA device |
| TimesFM | timesfm |
CUDA device |
All GPU backends fall back to CPU automatically if CUDA is not available.
Intel CPU acceleration¶
For improved performance on Intel CPUs:
Patch scikit-learn before importing lazypredict, so that the accelerated estimators are the ones lazypredict collects:
from sklearnex import patch_sklearn
patch_sklearn()
from lazypredict.Supervised import LazyClassifier
Changed in 0.4.0
Earlier versions called patch_sklearn() automatically on import lazypredict,
which changed scikit-learn for the whole Python process. The patch is now opt-in.
Development install¶
To set up a local development environment:
Run the tests:
Installing from source (archive)¶
Download and install without git: