reset
Syntax
Description
Examples
Load the robot arm data set. Obtain the sample size n
and the number of predictor variables p
.
load robotarm
n = numel(ytrain);
p = size(Xtrain,2);
For details on the data set, enter Description
at the command line.
Create an incremental linear model for regression. Configure the model as follows:
Specify a metrics warm-up period of 1000 observations.
Specify a metrics window size of 500 observations.
Configure the model to predict responses by specifying that all regression coefficients and the bias are 0.
Mdl = incrementalRegressionLinear('MetricsWarmupPeriod',1000,'MetricsWindowSize',500, ... 'Beta',zeros(p,1),'Bias',0,'EstimationPeriod',0)
Mdl = incrementalRegressionLinear IsWarm: 0 Metrics: [1×2 table] ResponseTransform: 'none' Beta: [32×1 double] Bias: 0 Learner: 'svm' Properties, Methods
Mdl
is an incrementalRegressionLinear
model object configured for incremental learning. All properties are read-only.
Simulate a data stream with incoming chunks of 50 observations each. For each iteration:
Call
updateMetricsAndFit
to update the performance metrics and fit the model to the incoming window of data. Overwrite the previous incremental model with the new one.Investigate the model.
Call
reset
to reset the learned parameters and compare to the previous model to see which parameters are reset.
numObsPerChunk = 50; nchunk = floor(n/numObsPerChunk); for j = 1:nchunk ibegin = min(n,numObsPerChunk*(j-1) + 1); iend = min(n,numObsPerChunk*j); idx = ibegin:iend; Mdl = updateMetricsAndFit(Mdl,Xtrain(idx,:),ytrain(idx)); L(j) = loss(Mdl,Xtrain(idx,:),ytrain(idx)); PoL(j,:) = perObservationLoss(Mdl,Xtrain(idx,:),ytrain(idx)); end
Display the model.
Mdl
Mdl = incrementalRegressionLinear IsWarm: 1 Metrics: [1×2 table] ResponseTransform: 'none' Beta: [32×1 double] Bias: -1.9425e-04 Learner: 'svm' Properties, Methods
The model is warm (IsWarm
=1), you can see the values of some of the properties.
Display the Metrics
property.
Mdl.Metrics
ans=1×2 table
Cumulative Window
__________ _______
EpsilonInsensitiveLoss 0.68922 0.68538
This property contains the model performance metrics, which, in this case, is the epsilon insensitive loss. It shows the cumulative loss and the loss for the latest data window.
Display the model coefficients.
Mdl.Beta(1:10)
ans = 10×1
-0.0002
-0.0002
-0.0004
0.0000
0.0006
0.0000
0.0003
-0.0010
0.0004
-0.0011
Reset the model and display the same parameters.
newMdl = reset(Mdl)
newMdl = incrementalRegressionLinear IsWarm: 0 Metrics: [1×2 table] ResponseTransform: 'none' Beta: [32×1 double] Bias: 0 Learner: 'svm' Properties, Methods
newMdl.Metrics
ans=1×2 table
Cumulative Window
__________ ______
EpsilonInsensitiveLoss NaN NaN
newMdl.Beta(1:10)
ans = 10×1
0
0
0
0
0
0
0
0
0
0
reset
function resets the warmup status of the model (IsWarm
= 0), the values of the performance metrics, and the estimated model parameters. In addition to these, it resets the properties, such as NumTrainingObservations
, that the software updates at each iteration.
Input Arguments
Incremental learning model, specified as an incrementalRegressionKernel
or incrementalRegressionLinear
model object. You can create
Mdl
directly or by converting a supported, traditionally trained
machine learning model using the incrementalLearner
function. For
more details, see the corresponding object page.
Version History
Introduced in R2022a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)