Lazypredict
Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
Install / Use
/learn @shankarpandala/LazypredictREADME
Lazy Predict
Lazy Predict helps build a lot of basic models without much code and helps understand which models work better without any parameter tuning.
- Free software: MIT license
- Documentation: https://lazypredict.readthedocs.io
Features
- Over 40 built-in machine learning models
- Automatic model selection for classification, regression, and time series forecasting
- 20+ forecasting models: statistical (ETS, ARIMA, Theta), ML (Random Forest, XGBoost, etc.), deep learning (LSTM, GRU), and pretrained foundation models (TimesFM)
- Automatic seasonal period detection via ACF
- Multiple categorical encoding strategies (OneHot, Ordinal, Target, Binary)
- Built-in MLflow integration for experiment tracking
- GPU acceleration: XGBoost, LightGBM, CatBoost, cuML (RAPIDS), LSTM/GRU, TimesFM
- Support for Python 3.9 through 3.13
- Custom metric evaluation support
- Configurable timeout and cross-validation
- Intel Extension for Scikit-learn acceleration support
Installation
pip (PyPI)
pip install lazypredict
conda (conda-forge)
conda install -c conda-forge lazypredict
Optional extras (pip only)
Install with boosting libraries (XGBoost, LightGBM, CatBoost):
pip install lazypredict[boost]
Install with time series forecasting support:
pip install lazypredict[timeseries] # statsmodels + pmdarima
pip install lazypredict[timeseries,deeplearning] # + LSTM/GRU via PyTorch
pip install lazypredict[timeseries,foundation] # + Google TimesFM (Python 3.10-3.11)
Install with all optional dependencies:
pip install lazypredict[all]
Usage
To use Lazy Predict in a project:
import lazypredict
Classification
Example:
from lazypredict.Supervised import LazyClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
data = load_breast_cancer()
X = data.data
y = data.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=123)
clf = LazyClassifier(verbose=0, ignore_warnings=True, custom_metric=None)
models, predictions = clf.fit(X_train, X_test, y_train, y_test)
print(models)
Advanced Options
# With categorical encoding, timeout, cross-validation, and GPU
clf = LazyClassifier(
verbose=1, # Show progress
ignore_warnings=True, # Suppress warnings
custom_metric=None, # Use default metrics
predictions=True, # Return predictions
classifiers='all', # Use all available classifiers
categorical_encoder='onehot', # Encoding: 'onehot', 'ordinal', 'target', 'binary'
timeout=60, # Max time per model in seconds
cv=5, # Cross-validation folds (optional)
use_gpu=True # Enable GPU acceleration
)
models, predictions = clf.fit(X_train, X_test, y_train, y_test)
Parameters:
verbose(int): 0 for silent, 1 for progress displayignore_warnings(bool): Suppress scikit-learn warningscustom_metric(callable): Custom evaluation metricpredictions(bool): Return prediction DataFrameclassifiers(str/list): 'all' or list of classifier namescategorical_encoder(str): Encoding strategy for categorical features'onehot': One-hot encoding (default)'ordinal': Ordinal encoding'target': Target encoding (requirescategory-encoders)'binary': Binary encoding (requirescategory-encoders)
timeout(int): Maximum seconds per model (None for no limit)cv(int): Number of cross-validation folds (None to disable)use_gpu(bool): Enable GPU acceleration for supported models (default False)
| Model | Accuracy | Balanced Accuracy | ROC AUC | F1 Score | Time Taken | |:-------------------------------|-----------:|--------------------:|----------:|-----------:|-------------:| | LinearSVC | 0.989474 | 0.987544 | 0.987544 | 0.989462 | 0.0150008 | | SGDClassifier | 0.989474 | 0.987544 | 0.987544 | 0.989462 | 0.0109992 | | MLPClassifier | 0.985965 | 0.986904 | 0.986904 | 0.985994 | 0.426 | | Perceptron | 0.985965 | 0.984797 | 0.984797 | 0.985965 | 0.0120046 | | LogisticRegression | 0.985965 | 0.98269 | 0.98269 | 0.985934 | 0.0200036 | | LogisticRegressionCV | 0.985965 | 0.98269 | 0.98269 | 0.985934 | 0.262997 | | SVC | 0.982456 | 0.979942 | 0.979942 | 0.982437 | 0.0140011 | | CalibratedClassifierCV | 0.982456 | 0.975728 | 0.975728 | 0.982357 | 0.0350015 | | PassiveAggressiveClassifier | 0.975439 | 0.974448 | 0.974448 | 0.975464 | 0.0130005 | | LabelPropagation | 0.975439 | 0.974448 | 0.974448 | 0.975464 | 0.0429988 | | LabelSpreading | 0.975439 | 0.974448 | 0.974448 | 0.975464 | 0.0310006 | | RandomForestClassifier | 0.97193 | 0.969594 | 0.969594 | 0.97193 | 0.033 | | GradientBoostingClassifier | 0.97193 | 0.967486 | 0.967486 | 0.971869 | 0.166998 | | QuadraticDiscriminantAnalysis | 0.964912 | 0.966206 | 0.966206 | 0.965052 | 0.0119994 | | HistGradientBoostingClassifier | 0.968421 | 0.964739 | 0.964739 | 0.968387 | 0.682003 | | RidgeClassifierCV | 0.97193 | 0.963272 | 0.963272 | 0.971736 | 0.0130029 | | RidgeClassifier | 0.968421 | 0.960525 | 0.960525 | 0.968242 | 0.0119977 | | AdaBoostClassifier | 0.961404 | 0.959245 | 0.959245 | 0.961444 | 0.204998 | | ExtraTreesClassifier | 0.961404 | 0.957138 | 0.957138 | 0.961362 | 0.0270066 | | KNeighborsClassifier | 0.961404 | 0.95503 | 0.95503 | 0.961276 | 0.0560005 | | BaggingClassifier | 0.947368 | 0.954577 | 0.954577 | 0.947882 | 0.0559971 | | BernoulliNB | 0.950877 | 0.951003 | 0.951003 | 0.951072 | 0.0169988 | | LinearDiscriminantAnalysis | 0.961404 | 0.950816 | 0.950816 | 0.961089 | 0.0199995 | | GaussianNB | 0.954386 | 0.949536 | 0.949536 | 0.954337 | 0.0139935 | | NuSVC | 0.954386 | 0.943215 | 0.943215 | 0.954014 | 0.019989 | | DecisionTreeClassifier | 0.936842 | 0.933693 | 0.933693 | 0.936971 | 0.0170023 | | NearestCentroid | 0.947368 | 0.933506 | 0.933506 | 0.946801 | 0.0160074 | | ExtraTreeClassifier | 0.922807 | 0.912168 | 0.912168 | 0.922462 | 0.0109999 | | CheckingClassifier | 0.361404 | 0.5 | 0.5 | 0.191879 | 0.0170043 | | DummyClassifier | 0.512281 | 0.489598 | 0.489598 | 0.518924 | 0.0119965 |
Regression
Example:
from lazypredict.Supervised import LazyRegressor
from sklearn import datasets
from sklearn.utils import shuffle
import numpy as np
diabetes = datasets.load_diabetes()
X, y = shuffle(diabetes.data, diabetes.target, random_state=13)
X = X.astype(np.float32)
offset = int(X.shape[0] * 0.9)
X_train, y_train = X[:offset], y[:offset]
X_test, y_test = X[offset:], y[offset:]
reg = LazyRegressor(verbose=0, ignore_warnings=False, custom_metric=None)
models, predictions = reg.fit(X_train, X_test, y_train, y_test)
print(models)
Advanced Options
# With categorical encoding, timeout, and GPU
reg = LazyRegressor(
verbose=1, # Show progress
ignore_warnings=True, # Suppress warnings
custom_metric=None, # Use default metrics
predictions=True, # Return predictions
regressors='all', # Use all available regressors
categorical_encoder='ordinal', # Encoding: 'onehot', 'ordinal', 'target', 'binary'
timeout=120, # Max time per model in seconds
use_gpu=True # Enable GPU acceleration
)
models, predictions = reg.fit(X_train, X_test, y_train, y_test)
Parameters:
verbose(int): 0 for silent, 1 for progress displayignore_warnings(bool): Suppress scikit-learn warningscustom_metric(callable): Custom evaluation metricpredictions(bool): Return prediction DataFrameregressors(str/list): 'all' or list of regressor namescategorical_encoder(str): Encoding strategy for categorical features'onehot': One-hot encoding (default)'ordinal': Ordinal encoding'target': Target encoding (requirescategory-encoders)
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
mentoring-juniors
Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
groundhog
399Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
