reset
Syntax
Description
resets all data-dependent parameters (learnables) of the pipeline or component
unlearnedPipe = reset(learnedPipe)learnedPipe. The function unlocks learn parameters, but keeps any
learn and run parameters previously set. The returned pipeline or component
unlearnedPipe is ready to learn with new data.
resets all learnables of the unlearnedPipe = reset(learnedPipe,componentName)componentName component and any downstream
components in the pipeline learnedPipe.
also resets all learn and run parameters, using any of the input argument combinations in
previous syntaxes.unlearnedPipe = reset(___,ResetParameters=true)
You cannot reset structural parameters. Instead, you must create a component with new structural parameters.
Examples
Create a simple pipeline with two components in series.
pca = pcaComponent(VarianceExplained=0.95); ecoc = classificationECOCComponent; pipeline = series(pca,ecoc)
pipeline =
LearningPipeline with properties:
Name: "defaultName"
Inputs: ["DataIn" "Response"]
InputTags: [1 2]
Outputs: ["Predictions" "Scores" "Loss"]
OutputTags: [1 0 0]
Components: struct with 2 entries
Connections: [6×2 table]
HasLearnables: true
HasLearned: false
Show summary of the componentsThe pipeline has two components with learnable parameters.
Load sample data and define the predictor and response variables.
fisheriris = readtable("fisheriris.csv");
X = fisheriris(:,1:end-1);
Y = fisheriris(:,end);Learn the pipeline by passing data through it. To see the learned parameters, index into the components.
learnedPipeline = learn(pipeline,X,Y) learnedPCA = learnedPipeline.Components.PCA learnedECOC = learnedPipeline.Components.ClassificationECOC
learnedPipeline =
LearningPipeline with properties:
Name: "defaultName"
Inputs: ["DataIn" "Response"]
InputTags: [1 2]
Outputs: ["Predictions" "Scores" "Loss"]
OutputTags: [1 0 0]
Components: struct with 2 entries
Connections: [6×2 table]
HasLearnables: true
HasLearned: true
Show summary of the components
learnedPCA =
pcaComponent with properties:
Name: "PCA"
Inputs: "DataIn"
InputTags: 1
Outputs: "DataOut"
OutputTags: 1
Learnables (HasLearned = true)
Mu: [5.8433 3.0573 3.7580 1.1993]
Coefficients: [4×2 double]
UsedVariables: ["SepalLength" "SepalWidth" "PetalLength" "PetalWidth"]
Structural Parameters (locked)
UseWeights: 0
Learn Parameters (locked)
VarianceExplained: 0.9500
Show all parameters
learnedECOC =
classificationECOCComponent with properties:
Name: "ClassificationECOC"
Inputs: ["Predictors" "Response"]
InputTags: [1 2]
Outputs: ["Predictions" "Scores" "Loss"]
OutputTags: [1 0 0]
Learnables (HasLearned = true)
TrainedModel: [1×1 classreg.learning.classif.CompactClassificationECOC]
Structural Parameters (locked)
UseWeights: 0
Show all parametersThe components show the learned values, and the HasLearned
property of the pipeline is set to true.
Reset the pipeline and investigate the components.
resetPipeline = reset(learnedPipeline) resetPCA = resetPipeline.Components.PCA resetECOC = resetPipeline.Components.ClassificationECOC
resetPipeline =
LearningPipeline with properties:
Name: "defaultName"
Inputs: ["DataIn" "Response"]
InputTags: [1 2]
Outputs: ["Predictions" "Scores" "Loss"]
OutputTags: [1 0 0]
Components: struct with 2 entries
Connections: [6×2 table]
HasLearnables: true
HasLearned: false
Show summary of the components
resetPCA =
pcaComponent with properties:
Name: "PCA"
Inputs: "DataIn"
InputTags: 1
Outputs: "DataOut"
OutputTags: 1
Learnables (HasLearned = false)
Mu: []
Coefficients: []
UsedVariables: []
Structural Parameters (locked)
UseWeights: 0
Learn Parameters (unlocked)
VarianceExplained: 0.9500
Show all parameters
resetECOC =
classificationECOCComponent with properties:
Name: "ClassificationECOC"
Inputs: ["Predictors" "Response"]
InputTags: [1 2]
Outputs: ["Predictions" "Scores" "Loss"]
OutputTags: [1 0 0]
Learnables (HasLearned = false)
TrainedModel: []
Structural Parameters (locked)
UseWeights: 0
Show all parametersThe software resets all the learnable parameters of the components, and sets the
HasLearned property to false.
Input Arguments
Pipeline or component to reset, specified as a LearningPipeline object or a learning component object in one of the
following tables.
Data Preprocessing Components
| Component | Purpose |
|---|---|
equalWidthBinnerComponent | Grouping data into equal-width bins |
frequencyEncoderComponent | Frequency encoding categorical variables |
kmeansEncoderComponent | Feature extraction using k-means clustering |
normalizerComponent | Normalizing data |
observationImputerComponent | Imputing missing values |
observationRemoverComponent | Removing observations |
oneHotEncoderComponent | Encoding categorical data into one-hot vectors |
outlierImputerComponent | Imputing outlier values |
outlierRemoverComponent | Removing outlier values |
pcaComponent | Principal component analysis (PCA) |
quantileBinnerComponent | Binning data into equally probable bins |
ricaComponent | Feature extraction using reconstruction independent component analysis (RICA) |
sparseFilterComponent | Feature extraction using sparse filtering |
Feature Selection and Engineering Components
| Component | Purpose |
|---|---|
featureSelectionClassificationANOVAComponent | Feature selection using one-way ANOVA test |
featureSelectionClassificationChi2Component | Feature selection using chi-square tests |
featureSelectionClassificationKruskalWallisComponent | Feature selection using Kruskal-Wallis test |
featureSelectionClassificationMRMRComponent | Minimum redundancy maximum relevance (MRMR) feature selection in classification workflow |
featureSelectionClassificationNCAComponent | Neighborhood component analysis (NCA) feature selection in classification workflow |
featureSelectionClassificationReliefFComponent | ReliefF feature selection in classification workflow |
featureSelectionRegressionFTestComponent | Feature selection using F-tests |
featureSelectionRegressionMRMRComponent | Minimum redundancy maximum relevance (MRMR) feature selection in regression workflow |
featureSelectionRegressionNCAComponent | Neighborhood component analysis (NCA) feature selection in regression workflow |
featureSelectionRegressionReliefFComponent | ReliefF feature selection in regression workflow |
variableSelectorComponent | Manual variable selection |
Classification Model Components
| Component | Purpose |
|---|---|
classificationDiscriminantComponent | Discriminant analysis classification |
classificationECOCComponent | Multiclass classification using error-correcting output codes (ECOC) model |
classificationEnsembleComponent | Ensemble classification |
classificationGAMComponent | Binary classification using generalized additive model (GAM) |
classificationKernelComponent | Classification using Gaussian kernel with random feature expansion |
classificationKNNComponent | Classification using k-nearest neighbor model |
classificationLinearComponent | Binary classification of high-dimensional data using a linear model |
classificationNaiveBayesComponent | Multiclass classification using a naive Bayes model |
classificationNeuralNetworkComponent | Classification using a neural network model |
classificationSVMComponent | One-class and binary classification using a support vector machine (SVM) classifier |
classificationTreeComponent | Decision tree classifier |
Regression Model Components
| Component | Purpose |
|---|---|
regressionEnsembleComponent | Ensemble regression |
regressionGAMComponent | Regression using generalized additive model (GAM) |
regressionGPComponent | Gaussian process regression |
regressionKernelComponent | Kernel regression using explicit feature expansion |
regressionLinearComponent | Linear regression |
regressionNeuralNetworkComponent | Neural network regression |
regressionSVMComponent | Regression using a support vector machine (SVM) |
regressionTreeComponent | Decision tree regression |
Custom Components
| Component | Purpose |
|---|---|
functionComponent | Custom function |
Name of the component to reset, specified as a character vector or string scalar.
You can find the name of a component in a pipeline by indexing into the
Components property using
learnedPipe.Components.
Data Types: char | string
Output Arguments
Pipeline or component with reset data-dependent parameters, returned as a
LearningPipeline or learning component object. If
unlearnedPipe is a pipeline, the software either resets all its
components or resets only the component specified by componentName
and its downstream components.
Version History
Introduced in R2026a
See Also
LearningPipeline | learn | run
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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- 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)