# mlpack/mlpack

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/mlpack-mlpack).**

5,663 stars · 1,712 forks · C++ · NOASSERTION

## Links

- GitHub: https://github.com/mlpack/mlpack
- Homepage: https://www.mlpack.org/
- awesome-repositories: https://awesome-repositories.com/repository/mlpack-mlpack.md

## Description

mlpack is a header-only C++ machine learning library that defines matrix types as compile-time templates, enabling flexible numeric precision and memory layout without runtime overhead. Its core identity is built around a template metaprogramming architecture that allows algorithms to be included selectively as independent modules, reducing binary size, and supports compile-time serialization of neural network parameters by deducing matrix types and structure at compile time.

The library distinguishes itself through a multi-language binding framework that automatically generates bindings for Python, R, Julia, Go, and the command line from a single C++ API definition, allowing machine learning models to be trained and deployed from multiple languages without rewriting code. It also provides a lightweight inference runtime that strips training infrastructure to deploy models with minimal dependencies, and supports packaging models for production environments including cross-compilation for embedded systems and Docker containers.

The library covers the full machine learning workflow, including data loading and preprocessing with normalization, splitting, and missing value imputation, as well as dimensionality reduction using PCA, NMF, or sparse coding. It includes training capabilities for supervised classifiers such as decision trees, random forests, and support vector machines, regression models including linear, Bayesian linear, and LARS regression, and unsupervised clustering algorithms like mean shift and k-means, along with model evaluation through cross-validation and hyperparameter tuning.

## Tags

### Artificial Intelligence & ML

- [C++ Machine Learning Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/c-machine-learning-libraries.md) — A header-only C++ library for building and integrating machine learning models directly into C++ applications.
- [Header-Only Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/c-machine-learning-libraries/header-only-implementations.md) — A header-only C++ library for training and deploying machine learning models without separate compilation units.
- [Cross-Language ML Toolkits](https://awesome-repositories.com/f/artificial-intelligence-ml/cross-language-ml-toolkits.md) — Provides a core C++ ML library with native bindings for Python, R, Julia, and Go.
- [Machine Learning Training](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/machine-learning-training.md) — Trains a wide array of machine learning models using a fast, header-only C++ library. ([source](https://cdn.jsdelivr.net/gh/mlpack/mlpack@main/README.md))
- [C++ Prototyping Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/algorithmic-research/c-prototyping-libraries.md) — Provides a fast, header-only C++ library for experimenting with machine learning algorithms in academic research.
- [Clustering Algorithms](https://awesome-repositories.com/f/artificial-intelligence-ml/k-means-clustering/clustering-algorithms.md) — Groups data points into clusters using algorithms like mean shift and k-means. ([source](https://www.mlpack.org/doc/index.html))
- [Linear Regression Models](https://awesome-repositories.com/f/artificial-intelligence-ml/linear-regression-models.md) — Fits regression models including linear, Bayesian linear, and LARS regression to continuous target variables. ([source](https://www.mlpack.org/doc/index.html))
- [Data Preprocessing](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/data-and-checkpointing/data-preprocessing.md) — Provides data loading and preprocessing utilities for normalization, splitting, and missing value imputation. ([source](https://www.mlpack.org/doc/index.html))
- [Lightweight Inference Runtimes](https://awesome-repositories.com/f/artificial-intelligence-ml/model-inference-runtimes/lightweight-inference-runtimes.md) — Provides a lightweight inference runtime that strips training infrastructure for minimal-dependency model deployment.
- [Model Packaging](https://awesome-repositories.com/f/artificial-intelligence-ml/model-packaging.md) — Compiles and packages models for production, including cross-compilation for embedded systems and Docker containers. ([source](https://www.mlpack.org/doc/index.html))
- [Model Performance Evaluators](https://awesome-repositories.com/f/artificial-intelligence-ml/model-performance-evaluators.md) — Assesses model accuracy through cross-validation and hyperparameter tuning. ([source](https://www.mlpack.org/doc/index.html))
- [Neural Network Persistence Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-networks/neural-network-persistence-tools.md) — Saves trained neural network parameters to disk and reloads them using compile-time matrix type definitions. ([source](https://cdn.jsdelivr.net/gh/mlpack/mlpack@main/README.md))
- [Supervised Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/supervised-classification.md) — Trains supervised classifiers such as decision trees, random forests, and support vector machines on labeled data. ([source](https://www.mlpack.org/doc/index.html))

### Data & Databases

- [Header-only Libraries](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-serialization/json-libraries/c/header-only-libraries.md) — A header-only C++ library that compiles by including headers directly without separate compilation units.
- [Model Serialization](https://awesome-repositories.com/f/data-databases/data-serialization-formats/model-serialization.md) — Saves and loads trained model parameters to disk using compile-time matrix type definitions.
- [Dimensionality Reduction](https://awesome-repositories.com/f/data-databases/vector-quantization/high-dimensional-vector-compressors/dimensionality-reduction.md) — Implements dimensionality reduction techniques including PCA, NMF, and sparse coding. ([source](https://www.mlpack.org/doc/index.html))

### Programming Languages & Runtimes

- [Matrix Type Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/erasure-based-type-systems/template-based-type-erasure/matrix-type-definitions.md) — Defines matrix types as compile-time templates for flexible numeric precision and memory layout without runtime overhead.
- [Multi-Language Bindings](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/native-library-integrations/c-library-bindings/multi-language-bindings.md) — Generates bindings for Python, R, Julia, Go, and the command line from a single C++ API definition.
- [ML Algorithm Callers](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/native-library-integrations/c-library-bindings/multi-language-bindings/direct-multi-language-ffi-calls/ml-algorithm-callers.md) — Ships bindings that let users call ML algorithms from Python, R, Julia, Go, and the command line. ([source](https://www.mlpack.org/doc/index.html))
- [Compile-Time Serialization](https://awesome-repositories.com/f/programming-languages-runtimes/erasure-based-type-systems/template-based-type-erasure/compile-time-serialization.md) — Serializes neural network parameters using template metaprogramming at compile time.
- [Neural Network Serializers](https://awesome-repositories.com/f/programming-languages-runtimes/erasure-based-type-systems/template-based-type-erasure/compile-time-serialization/neural-network-serializers.md) — Serializes neural network parameters at compile time using template metaprogramming to deduce matrix types.

### Software Engineering & Architecture

- [C++ API](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/programmatic-interfaces/binding-generators/c-api.md) — Automatically generates bindings for Python, R, Julia, Go, and the command line from a single C++ API definition.
- [Header-Only Algorithm Modules](https://awesome-repositories.com/f/software-engineering-architecture/modular-extension-architectures/algorithm-decomposition/header-only-algorithm-modules.md) — Organizes machine learning algorithms as independent, header-only modules for selective inclusion to reduce binary size.

### DevOps & Infrastructure

- [AI Model Production Deployment](https://awesome-repositories.com/f/devops-infrastructure/ai-model-production-deployment.md) — Deploys trained ML models in production using lightweight C++ code with bindings to Python, Julia, Go, and R. ([source](https://cdn.jsdelivr.net/gh/mlpack/mlpack@main/README.md))
- [Lightweight Inference Runtimes](https://awesome-repositories.com/f/devops-infrastructure/ai-model-production-deployment/lightweight-inference-runtimes.md) — Provides a lightweight C++ inference runtime that strips training infrastructure for minimal-dependency production deployment.
- [Minimal-Dependency Deployments](https://awesome-repositories.com/f/devops-infrastructure/ai-model-production-deployment/minimal-dependency-deployments.md) — Deploys trained ML models into production using minimal-dependency C++ inference code.

### Security & Cryptography

- [ML Production Runtimes](https://awesome-repositories.com/f/security-cryptography/authentication-services/self-hosted-deployments/lightweight-api-deployments/ml-production-runtimes.md) — Ships a lightweight production runtime that strips training infrastructure for minimal-dependency model deployment.

### Web Development

- [Compile-Time Neural Network Serializers](https://awesome-repositories.com/f/web-development/model-serializers/neural-network-binary-serialization/compile-time-neural-network-serializers.md) — Saves and loads neural network parameters to and from disk using compile-time matrix type definitions.

### Part of an Awesome List

- [AI & Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/ai-machine-learning.md) — Fast, header-only machine learning library
- [General Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/general-machine-learning.md) — Fast and flexible C++ machine learning library.
- [Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning.md) — Fast, header-only machine learning library.
- [Machine Learning Frameworks](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning-frameworks.md) — Fast, header-only C++ library with Python bindings for machine learning.
- [Machine Learning Packages](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning-packages.md) — Fast and flexible C++ machine learning library.
