Incremental Learning
Incremental learning, or online learning, involves processing incoming data from a data stream, possibly given little to no knowledge of the distribution of the predictor variables, aspects of the objective function, and whether the observations are labeled. Incremental learning is often used in on-device learning applications, where models are trained on low-power edge devices using locally generated streaming data. Incremental learning problems contrast with traditional machine learning methods, in which enough labeled data is available to fit to a model, perform cross-validation to tune hyperparameters, and infer the predictor distribution characteristics.
Incremental learning requires a configured incremental model. You can create and configure
most incremental models directly by calling an object, for example incrementalClassificationLinear, or you can convert a supported, traditionally
trained model to an incremental learner by using incrementalLearner. After
configuring a model and setting up a data stream, you can fit the incremental model to the
incoming chunks of data, track the predictive performance of the model, or perform both actions
simultaneously.
For more details, see Incremental Learning Overview.
Statistics and Machine Learning Toolbox™ also provides functions that allow you to:
Normalize streaming data incrementally, by creating a normalizer model using
incrementalNormalizer, and updating the model using the incrementalfitfunction. Usefitortransformto return normalized data.Compute the principal component coefficients and variances of streaming data incrementally, by creating a principal component analysis (PCA) model using
incrementalPCA, and updating the model using the incrementalfitfunction. Usefitortransformto return principal component scores.Monitor for drift incrementally in concept data, such as classification error, by creating a drift detector using
incrementalConceptDriftDetector. After setting up a data stream, update the drift detector and check for any drift usingdetectdrift.
For more information, see the reference pages.
Blocks
| IncrementalClassificationLinear Predict | Classify observations using incremental linear classification model (Since R2023b) |
| IncrementalClassificationLinear Fit | Fit incremental linear binary classification model (Since R2023b) |
| IncrementalClassificationECOC Predict | Classify observations using incremental ECOC classification model (Since R2024a) |
| IncrementalClassificationECOC Fit | Fit incremental ECOC classification model (Since R2024a) |
| IncrementalClassificationKernel Fit | Fit incremental kernel classification model (Since R2024b) |
| IncrementalClassificationKernel Predict | Classify observations using incremental kernel classification model (Since R2024b) |
| IncrementalClassificationNaiveBayes Fit | Fit incremental naive Bayes classification model (Since R2025a) |
| IncrementalClassificationNaiveBayes Predict | Classify observations using incremental naive Bayes classification model (Since R2025a) |
| Per Observation Loss | Per observation regression or classification error of incremental model (Since R2025a) |
| Update Metrics | Update performance metrics in incremental learning model given new data (Since R2023b) |
| Detect Drift | Update drift detector states and drift status with new data (Since R2024b) |
Functions
Objects
Topics
- Incremental Learning Overview
Discover fundamental concepts about incremental learning, including incremental learning objects, functions, and workflows.
- Configure Incremental Learning Model
Prepare an incremental learning model for incremental performance evaluation and training on a data stream.
- Implement Incremental Learning for Classification Using Succinct Workflow
Use the succinct workflow to implement incremental learning for binary classification with prequential evaluation.
- Implement Incremental Learning for Classification Using Flexible Workflow
Use a flexible workflow to implement incremental learning for binary classification with prequential evaluation.
- Initialize Incremental Learning Model from Logistic Regression Model Trained in Classification Learner
Train a logistic regression model using the Classification Learner app, and then initialize an incremental model for binary classification using the estimated coefficients.
- Perform Conditional Training During Incremental Learning
Use the flexible workflow to implement conditional training during incremental learning with a naive Bayes multiclass classification model.
- Perform Text Classification Incrementally
This example shows how to incrementally train a model to classify documents based on word frequencies in the documents; a bag-of-words model.
- Incremental Learning with Naive Bayes and Heterogeneous Data
This example shows how to prepare heterogeneous predictor data, containing real-valued and categorical measurements, for incremental learning using a naive Bayes classifier.
- Monitor Equipment State of Health Using Drift-Aware Learning
This example shows how to automate the process of monitoring the state of health for a cooling system using an incremental drift-aware learning model and Streaming Data Framework for MATLAB® Production Server™.