Mlxtend (machine learning extensions) is a Python library of useful tools for the day-to-day data science tasks. It is primarily used for:
- Ensemble methods such as stacking and voting classifiers
- Feature selection and feature extraction techniques
- Visualization utilities (e.g., decision regions, confusion matrices)
- Plotting helpers for model analysis
- Frequent pattern mining, including the Apriori algorithm for association rule mining
Sebastian Raschka 2014-2026
- Documentation: https://rasbt.github.io/mlxtend
- PyPI: https://pypi.python.org/pypi/mlxtend
- Changelog: https://rasbt.github.io/mlxtend/CHANGELOG
- Contributing: https://rasbt.github.io/mlxtend/CONTRIBUTING
- Questions? Check out the GitHub Discussions board
To add mlxtend to a uv-managed project, run
uv add mlxtendFor a one-off command without changing your current project, run
uv run --with mlxtend python -c "import mlxtend; print(mlxtend.__version__)"The mlxtend version on PyPI may always be one step behind; you can install the latest development version from the GitHub repository by executing
uv add "mlxtend @ git+https://github.com/rasbt/mlxtend.git"Or, you can fork the GitHub repository from https://github.com/rasbt/mlxtend and run mlxtend from your local checkout via
git clone https://github.com/<your_username>/mlxtend.git
cd mlxtend
uv sync --group dev
uv run python -c "import mlxtend; print(mlxtend.__version__)"import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import itertools
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from mlxtend.classifier import EnsembleVoteClassifier
from mlxtend.data import iris_data
from mlxtend.plotting import plot_decision_regions
# Initializing Classifiers
clf1 = LogisticRegression(random_state=0)
clf2 = RandomForestClassifier(random_state=0)
clf3 = SVC(random_state=0, probability