Skip to main content
MLPP is a comprehensive machine learning library for C++ that provides clean, efficient implementations of classical ML algorithms. Built with modern C++20, it emphasizes mathematical clarity, minimal dependencies, and seamless integration into existing projects.

Key features

Header-only design

Simple integration with no complex build requirements. Just include and compile.

Eigen-powered

Built on Eigen3 for high-performance linear algebra operations.

Modular architecture

Independent modules with clear interfaces. Use only what you need.

Modern C++20

Leverages latest language features for safety and expressiveness.

What’s included

MLPP provides a comprehensive suite of machine learning algorithms organized into focused modules:

Supervised learning

Classification and regression algorithms including linear models, SVMs, and decision trees

Unsupervised learning

Clustering and dimensionality reduction techniques like PCA, SVD, and KD-trees

Model validation

Comprehensive metrics, confusion matrices, ROC curves, and cross-validation

Mathematical utilities

Loss functions, kernel methods, and supporting numerical routines

Supervised learning

Implementations of classical supervised learning algorithms: Classifiers
  • Logistic Regression (binary and multiclass)
  • Support Vector Machines (SVM) with multiple kernel options
  • Linear Discriminant Analysis (LDA)
  • Minimum Distance Classifier (MDC)
  • Decision Trees
Regression
  • Linear Regression (OLS and Ridge)
  • Polynomial Regression
  • Multilinear Regression
All supervised learning algorithms follow a consistent fit() / predict() interface familiar to practitioners.

Unsupervised learning

Dimensionality reduction and clustering:
  • PCA: Principal Component Analysis with configurable components
  • SVD: Singular Value Decomposition
  • Clustering: KD-tree spatial indexing and clustering utilities

Model validation

Comprehensive evaluation tools:
  • Confusion matrices for classification tasks
  • Precision, recall, F1-score (macro and micro averaging)
  • ROC curves and AUC metrics
  • Stratified K-fold cross-validation
  • IoU (Intersection over Union)

Mathematical utilities

  • Loss functions: Binary cross-entropy, MSE, and more
  • Kernel methods: RBF, polynomial, linear kernels with composition and caching
  • Kernel Perceptron: For non-linearly separable data

Design philosophy

MLPP follows a minimal-dependency philosophy:

Transparency first

Implementations prioritize clarity and mathematical correctness over obscure optimizations

Predictable performance

Clear algorithmic complexity and deterministic behavior

Self-contained

Core functionality relies only on C++ standard library and Eigen3
Optional dependencies (Python/NumPy for plotting, OpenCV for image processing) are detected automatically and enabled via feature flags.

Installation

Get started with CMake integration

Quickstart

Run your first ML model in minutes

API Reference

Detailed class and function documentation

Next steps

1

Install MLPP

Follow the installation guide to integrate MLPP into your CMake project
2

Run a quickstart example

Try the quickstart tutorial to train your first model
3

Explore the API

Browse the API reference to discover available algorithms and utilities

Build docs developers (and LLMs) love