Welcome to PyCaret
PyCaret is an open-source, low-code machine learning library in Python that automates machine learning workflows. It is an end-to-end machine learning and model management tool that speeds up the experiment cycle exponentially and makes you more productive.
In comparison with the other open-source machine learning libraries, PyCaret is an alternate low-code library that can be used to replace hundreds of lines of code with few lines only. This makes experiments exponentially fast and efficient. PyCaret is essentially a Python wrapper around several machine learning libraries and frameworks such as scikit-learn, XGBoost, LightGBM, CatBoost, Optuna, Hyperopt, Ray, and few more.
The design and simplicity of PyCaret are inspired by the emerging role of citizen data scientists, a term first used by Gartner. Citizen Data Scientists are power users who can perform both simple and moderately sophisticated analytical tasks that would previously have required more technical expertise. PyCaret was inspired by the caret library in R programming language.
๐ Installation
๐ Option 1: Install via PyPi
PyCaret is tested and supported on 64-bit systems with:
- Python 3.9, 3.10 and 3.11
- Ubuntu 16.04 or later
- Windows 7 or later
You can install PyCaret with Python's pip package manager:
pip install pycaret
PyCaret's default installation will not install all the optional dependencies automatically. Depending on the use case, you may be interested in one or more extras:
pip install pycaret[analysis]
pip install pycaret[models]
pip install pycaret[tuner]
pip install pycaret[mlops]
pip install pycaret[parallel]
pip install pycaret[test]
pip install pycaret[analysis,models]
Check out all optional dependencies. If you want to install everything including all the optional dependencies:
pip install pycaret[full]
๐ Option 2: Build from Source
Install the development version of the library directly from the source. The API may be unstable. It is not recommended for production use.
pip install git+https://github.com/pycaret/pycaret.git@master --upgrade
๐ฆ Option 3: Docker
Docker creates virtual environments with containers that keep a PyCaret installation separate from the rest of the system. PyCaret docker comes pre-installed with a Jupyter notebook. It can share resources with its host machine (access directories, use the GPU, connect to the Internet, etc.). The PyCaret Docker images are always tested for the latest major releases.
docker run -p 8888:8888 pycaret/slim
docker run -p 8888:8888 pycaret/full
๐โโ๏ธ Quickstart
1. Functional API
from pycaret.datasets import get_data
data = get_data('juice')
from pycaret.classification import *
s = setup(data, target = 'Purchase', session_id = 123)
best = compare_models()
evaluate_model(best)
pred_holdout = predict_model(best)
new_data = data.copy().drop('Purchase', axis = 1)
predictions = predict_model(best, data = new_data)
save_model(best, 'best_pipeline')
2. OOP API
from pycaret.datasets import get_data
data = get_data('juice')
from pycaret.classification import ClassificationExperiment
s = ClassificationExperiment()
s.setup(data, target = 'Purchase', session_id = 123)
best = s.compare_models()
s.evaluate_model(best)
pred_holdout = s.predict_model(best)
new_data = data.copy().drop('Purchase', axis = 1)
predictions = s.predict_model(best, data = new_data)
s.save_model(best, 'best_pipeline')
๐ Modules
Classification
Regression
Time Series
Clustering
Anomaly Detection
 |  |
๐ฅ Who should use PyCaret?
PyCaret is an open source library that anybody can use. In our view the ideal target audience of PyCaret is:
- Experienced Data Scientists who want to increase productivity.
- Citizen Data Scientists who prefer a low code machine learning solution.
- Data Science Professionals who want to build rapid prototypes.
- Data Science and Machine Learning students and enthusiasts.
๐ฎ Training on GPUs
To train models on the GPU, simply pass use_gpu = True in the setup function. There is no change in the use of the API; however, in some cases, additional libraries have to be installed. The following models can be trained on GPUs:
- Extreme Gradient Boosting
- CatBoost
- Light Gradient Boosting Machine requires GPU installation
- Logistic Regression, Ridge Classifier, Random Forest, K Neighbors Classifier, K Neighbors Regressor, Support Vector Machine, Linear Regression, Ridge Regression, Lasso Regression requires cuML >= 0.15
๐ฅ๏ธ PyCaret Intel sklearnex support
You can apply Intel optimizations for machine learning algorithms and speed up your workflow. To train models with Intel optimizations use sklearnex
engine. There is no change in the use of the API, however, installation of Intel sklearnex is required:
pip install scikit-learn-intelex
๐ค Contributors
๐ License
PyCaret is completely free and open-source and licensed under the MIT license.
โน๏ธ More Information