Contenuto principale

Incremental Learning

Fit classification model to streaming data and track its performance

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 incremental fit function. Use fit or transform to 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 incremental fit function. Use fit or transform to 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 using detectdrift.

For more information, see the reference pages.

Blocks

IncrementalClassificationLinear PredictClassify observations using incremental linear classification model (Since R2023b)
IncrementalClassificationLinear FitFit incremental linear binary classification model (Since R2023b)
IncrementalClassificationECOC PredictClassify observations using incremental ECOC classification model (Since R2024a)
IncrementalClassificationECOC FitFit incremental ECOC classification model (Since R2024a)
IncrementalClassificationKernel FitFit incremental kernel classification model (Since R2024b)
IncrementalClassificationKernel PredictClassify observations using incremental kernel classification model (Since R2024b)
IncrementalClassificationNaiveBayes FitFit incremental naive Bayes classification model (Since R2025a)
IncrementalClassificationNaiveBayes PredictClassify observations using incremental naive Bayes classification model (Since R2025a)
Per Observation LossPer observation regression or classification error of incremental model (Since R2025a)
Update MetricsUpdate performance metrics in incremental learning model given new data (Since R2023b)
Detect DriftUpdate drift detector states and drift status with new data (Since R2024b)

Functions

expand all

Create Incremental Normalizer Model

incrementalNormalizerInstantiate incremental data normalizer (Since R2026a)

Incrementally Fit and Normalize Data

fitFit incremental normalizer model to streaming data (Since R2026a)
transformNormalize streaming data (Since R2026a)

Reset Normalizer Model

resetReset incremental normalizer model (Since R2026a)

Create Incremental Drift-Aware Model

incrementalDriftAwareLearnerConstruct drift-aware model for incremental learning (Since R2022b)

Incrementally Fit and Track Performance

fitTrain drift-aware learner for incremental learning with new data (Since R2022b)
updateMetricsUpdate performance metrics in incremental drift-aware learning model given new data (Since R2022b)
updateMetricsAndFitUpdate performance metrics in incremental drift-aware learning model given new data and train model (Since R2022b)

Other Model Operations

lossRegression or classification error of incremental drift-aware learner (Since R2022b)
perObservationLossPer observation regression or classification error of incremental drift-aware learner (Since R2022b)
predictPredict responses for new observations from incremental drift-aware learning model (Since R2022b)
resetReset incremental drift-aware learner (Since R2022b)

Create Incremental Model

incrementalClassificationKernel Binary classification kernel model for incremental learning (Since R2022a)
incrementalLearnerConvert kernel model for binary classification to incremental learner (Since R2022a)

Incrementally Fit and Track Performance

fitTrain kernel model for incremental learning (Since R2022a)
updateMetricsUpdate performance metrics in kernel incremental learning model given new data (Since R2022a)
updateMetricsAndFitUpdate performance metrics in kernel incremental learning model given new data and train model (Since R2022a)

Other Model Operations

predictPredict responses for new observations from kernel incremental learning model (Since R2022a)
lossLoss of kernel incremental learning model on batch of data (Since R2022a)
perObservationLossPer observation classification error of model for incremental learning (Since R2022a)
resetReset incremental classification model (Since R2022a)

Create Incremental Model

incrementalClassificationLinearBinary classification linear model for incremental learning
incrementalLearnerConvert binary classification support vector machine (SVM) model to incremental learner
incrementalLearnerConvert linear model for binary classification to incremental learner

Incrementally Fit and Track Performance

fitTrain linear model for incremental learning
updateMetricsUpdate performance metrics in linear incremental learning model given new data
updateMetricsAndFitUpdate performance metrics in linear incremental learning model given new data and train model

Other Model Operations

predictPredict responses for new observations from linear incremental learning model
lossLoss of linear incremental learning model on batch of data
perObservationLossPer observation classification error of model for incremental learning (Since R2022a)
resetReset incremental classification model (Since R2022a)

Create Incremental Model

incrementalClassificationECOC Multiclass classification model using binary learners for incremental learning (Since R2022a)
incrementalLearnerConvert multiclass error-correcting output codes (ECOC) model to incremental learner (Since R2022a)

Incrementally Fit and Track Performance

fitTrain ECOC classification model for incremental learning (Since R2022a)
updateMetricsUpdate performance metrics in ECOC incremental learning classification model given new data (Since R2022a)
updateMetricsAndFitUpdate performance metrics in ECOC incremental learning classification model given new data and train model (Since R2022a)

Other Model Operations

predictPredict responses for new observations from ECOC incremental learning classification model (Since R2022a)
lossLoss of ECOC incremental learning classification model on batch of data (Since R2022a)
perObservationLossPer observation classification error of model for incremental learning (Since R2022a)
resetReset incremental classification model (Since R2022a)

Create Incremental Model

incrementalClassificationNaiveBayesNaive Bayes classification model for incremental learning
incrementalLearnerConvert naive Bayes classification model to incremental learner

Incrementally Fit and Track Performance

fitTrain naive Bayes classification model for incremental learning
updateMetricsUpdate performance metrics in naive Bayes incremental learning classification model given new data
updateMetricsAndFitUpdate performance metrics in naive Bayes incremental learning classification model given new data and train model

Other Model Operations

predictPredict responses for new observations from naive Bayes incremental learning classification model
lossLoss of naive Bayes incremental learning classification model on batch of data
logpLog unconditional probability density of naive Bayes classification model for incremental learning
perObservationLossPer observation classification error of model for incremental learning (Since R2022a)
resetReset incremental classification model (Since R2022a)

Create Concept Drift Detector

incrementalConceptDriftDetectorInstantiate incremental concept drift detector (Since R2022a)

Detect Drift and Reset Model

detectdriftUpdate drift detector states and drift status with new data (Since R2022a)
resetReset incremental concept drift detector (Since R2022a)

Objects

expand all

ZScoreNormalizerSimple-weighted normalizer (Since R2026a)
ExponentiallyWeightedNormalizerExponentially weighted normalizer (Since R2026a)
ClassWeightedNormalizerClass-weighted normalizer (Since R2026a)
DriftDetectionMethodIncremental drift detector that utilizes Drift Detection Method (DDM) (Since R2022a)
HoeffdingDriftDetectionMethodIncremental concept drift detector that utilizes Hoeffding's Bounds Drift Detection Method (HDDM) (Since R2022a)

Topics