Machine Learning

Libraries for machine learning. Also see awesome-machine-learning.

Fit models with scikit-learn, which covers a Python machine learning library's basic tasks, boosted trees included. Deep learning takes a framework of its own.

How to choose:

  • Classification, regression, and clustering on tabular data: scikit-learn
  • Boosted trees with no extra dependency: scikit-learn
  • Causal graphs and Bayesian networks: pgmpy
  • Feature engineering that keeps your DataFrame's column names: Feature-engine
  • Boosted trees trained across a cluster: XGBoost
  • Boosted trees on large data, fast and light on memory: LightGBM
  • Tables full of category columns, with little tuning: CatBoost
  • Series with strong seasonality and holiday effects: Prophet
  • Many series on classical models like ARIMA and ETS: StatsForecast
  • Forecasting next to classification and other time-series tasks: sktime
  • Forecasts with no model to train: TimesFM
  • Tuning a model's hyperparameters: Optuna

Listed in editorial order, grouped by use case. Click a column header to re-sort the whole list.

Press / to search. Tags open their category. Click a row for details.

Search and filter

Results

Row number Tags

General 4 projects

The most popular Python library for machine learning with extensive documentation and community support.
Resampling techniques for imbalanced datasets, compatible with scikit-learn.
A Python library for causal and probabilistic reasoning with graphical models.
pgmpy/github.com/pgmpy/pgmpy /3,364 stars /
sklearn-compatible API with the widest toolset for feature engineering and selection.

Gradient Boosting 3 projects

A scalable, portable, and distributed gradient boosting library.
dmlc/github.com/dmlc/xgboost /28,924 stars /
A fast, distributed, high-performance gradient boosting framework.
A fast, scalable, high-performance gradient boosting on decision trees library.
catboost/github.com/catboost/catboost /9,182 stars /

Time Series Forecasting 4 projects

A tool for producing forecasts for time series with multiple seasonality and trend changes.
meta/github.com/facebook/prophet /20,464 stars /
Fast statistical forecasting models such as ARIMA, ETS, and Theta, compiled with numba.
Nixtla/github.com/Nixtla/statsforecast /4,954 stars /
A unified scikit-learn-style framework for forecasting and other time-series learning tasks.
sktime/github.com/sktime/sktime /10,081 stars /
A pretrained foundation model from Google Research for time-series forecasting, with non-commercial default weights.

Hyperparameter Optimization 2 projects

A hyperparameter optimization framework with define-by-run search spaces and pruning of unpromising trials.
optuna/github.com/optuna/optuna /14,988 stars /
Distributed asynchronous hyperparameter optimization with Tree-structured Parzen Estimators.
hyperopt/github.com/hyperopt/hyperopt /7,598 stars /

Machine Learning guide

scikit-learn does supervised and unsupervised learning, plus the tools around it: preprocessing, model selection, and evaluation. Every estimator learns with fit. Put your preprocessing and model in one Pipeline, and run cross-validation and searches on that, since the pipeline keeps test data out of training. You may not need a separate boosting library: its histogram-based gradient boosting is inspired by LightGBM and supports missing values and categorical data natively. Deep learning is another matter: it doesn't fit scikit-learn's design constraints, so it's out of scope.

pgmpy does causal and probabilistic reasoning with graphical models. Its quickstart follows the tasks: learn a graph's structure from data, fit the distributions for a graph you know, then query the model for probabilities or causal effects.

Feature-engine is designed to work with dataframes: a DataFrame goes in, and the same DataFrame comes out, with no column order or name changes. Instead of wrapping transformers in a ColumnTransformer, you tell each one which variables to transform. Its transformers work just like any scikit-learn transformer, so they fit in a Pipeline.

XGBoost is an optimized distributed gradient boosting library. Its Python package has a native interface, a scikit-learn interface, and a Dask interface.

LightGBM is designed for faster training, lower memory use, and large-scale data. Pass category columns as they are: LightGBM uses them directly, with no one-hot encoding.

CatBoost aims for great results with default parameters, and it takes non-numeric features without you turning them into numbers. Name the category columns in cat_features, and don't one-hot encode them, which hurts both training speed and quality.

Prophet fits an additive model of the trend, yearly, weekly, and daily seasonality, and holiday effects. It works best with series that have strong seasonal effects and several seasons of history. It follows the scikit-learn model API: pass fit a DataFrame with ds and y columns, then call predict.

StatsForecast offers widely used univariate models, like automatic ARIMA, ETS, and Theta, optimized for speed, plus benchmark models for baselines. Data goes in as a long-format DataFrame with unique_id, ds, and y columns, and for many series the docs recommend the forecast method.

sktime gives forecasting, classification, clustering, and anomaly detection one unified interface, with interfaces to scikit-learn and Prophet. Split the series with temporal_train_test_split, set a ForecastingHorizon, then fit and predict, as in Get Started. Through reduction, a scikit-learn regressor can solve a forecasting task.

TimesFM is a pretrained foundation model from Google Research for time-series forecasting. It forecasts zero-shot, with no training on your data: load a checkpoint and call predict with a horizon. Check the license of the weights you download: some are for non-commercial, non-production use only.

Optuna is an automatic hyperparameter optimization framework, particularly designed for machine learning. Write an objective function that takes a trial, picks each hyperparameter with methods like suggest_float, trains the model, and returns its score. Then create a study and call optimize with the number of trials. The search space is plain Python, with conditionals and loops, so you can tune an SVM's C only in trials that picked an SVM. To stop unpromising trials early, call report after each training step and raise optuna.TrialPruned() when should_prune() returns true.

To evaluate a model on time-series data, test it on observations from after its training data. scikit-learn's TimeSeriesSplit does that in cross-validation. For more, see awesome-machine-learning.

Know a project that belongs here?

Tell us what it does and why it stands out.