Hauptinhalt

Modellerstellung und -Bewertung

Synthetische Datengenerierung, Merkmalsauswahl, Merkmalsentwicklung, Modellauswahl, Hyperparameter-Optimierung, Kreuzvalidierung, Rückstandsdiagnose und Diagramme

Wenn Sie ein hochwertiges Regressionsmodell erstellen, ist es wichtig, die richtigen Merkmale (oder Prädiktoren) auszuwählen, Hyperparameter (Modellparameter, die nicht an die Daten angepasst sind) abzustimmen und die Modellannahmen durch Rückstandsdiagnose zu bewerten. Sie können Hyperparameter abstimmen, indem Sie iterativ Werte für diese Parameter wählen und ein Modell mit diesen Einstellungen kreuzvalidieren. Dieser Prozess ergibt mehrere Modelle; das beste dieser Modelle könnte das sein, das den geschätzten Generalisierungsfehler minimiert.

Sie können die folgenden Aktionen durchführen, um Regressionsmodelle zu erstellen und zu bewerten:

  • Vor dem Training eines Regressionsmodells mithilfe von synthesizeTabularData, binningTabularSynthesizer oder smoteTabularSynthesizer synthetische Daten aus einem bestehenden Datensatz generieren.

  • Vor dem Training eines Regressionsmodells mithilfe von genrfeatures neue Merkmale entwickeln.

  • Regressionsmodelle interaktiv mithilfe der Regression Learner App erstellen und bewerten.

  • Mithilfe von fitrauto automatisch ein Modell mit abgestimmten Hyperparametern auswählen. Die Funktion probiert eine Auswahl an Regressionsmodelltypen mit verschiedenen Hyperparameterwerten aus und gibt ein finales Modell zurück, das eine gute Leistung aufweisen sollte. Verwenden Sie fitrauto, wenn Sie sich nicht sicher sind, welche Regressionsmodelltypen am besten zu Ihren Daten passen.

  • Hyperparameter eines bestimmten Modells abstimmen, indem Sie die Hyperparameterwerte auswählen und das Modell mit diesen Werten kreuzvalidieren. Um ein SVM-Modell abzustimmen, wählen Sie beispielsweise einen Satz Box-Randbedingungen und Kernel-Skalen, kreuzvalidieren ein Modell für jedes Wertepaar und vergleichen daraufhin die 10-fachen kreuzvalidierten mittleren quadratischen Fehlerschätzungen. Bestimmte nichtparametrische Regressionsfunktionen in Statistics and Machine Learning Toolbox™ bieten eine automatische Hyperparameter-Abstimmung über bayessche Optimierung, Rastersuche oder zufällige Suche. bayesopt, die Hauptfunktion zur Implementierung einer bayesschen Optimierung, ist zudem flexibel genug für viele andere Anwendungen. Weitere Informationen finden Sie unter Bayesian Optimization Workflow.

  • Mithilfe von lime, shapley und plotPartialDependence können Sie ein Regressionsmodell auswerten.

  • Mithilfe von sliceMetrics können Sie die Leistung eines Regressionsmodells bei separaten Datenslices auswerten.

Apps

Regression LearnerTrain regression models to predict data using supervised machine learning

Funktionen

alle erweitern

synthesizeTabularDataSynthesize tabular data (Seit R2024b)
binningTabularSynthesizerBinning-based synthesizer for tabular data synthesis (Seit R2024b)
smoteTabularSynthesizerSMOTE-based synthesizer for tabular data synthesis (Seit R2026a)
synthesizeTabularDataSynthesize tabular data using binning-based or SMOTE-based synthesizer (Seit R2024b)
mmdtestTwo-sample multivariate hypothesis test using maximum mean discrepancy (MMD) (Seit R2024b)
knntestTwo-sample multivariate hypothesis test using k-nearest neighbors (KNN) (Seit R2025a)
fsrftestUnivariate feature ranking for regression using F-tests
fsrmrmrRank features for regression using minimum redundancy maximum relevance (MRMR) algorithm (Seit R2022a)
fsrncaFeature selection using neighborhood component analysis for regression
oobPermutedPredictorImportanceOut-of-bag predictor importance estimates for random forest of regression trees by permutation
partialDependenceCompute partial dependence
permutationImportancePredictor importance by permutation (Seit R2024a)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
predictorImportanceEstimates of predictor importance for regression tree
predictorImportanceEstimates of predictor importance for regression ensemble of decision trees
relieffRank importance of predictors using ReliefF or RReliefF algorithm
selectFeaturesSelect important features for NCA classification or regression (Seit R2023b)
sequentialfsSequential feature selection using custom criterion
stepwiselmPerform stepwise regression
stepwiseglmCreate generalized linear regression model by stepwise regression
genrfeaturesPerform automated feature engineering for regression (Seit R2021b)
describeDescribe generated features
transformTransform new data using generated features
fitrautoAutomatically select regression model with optimized hyperparameters
bayesoptSelect optimal machine learning hyperparameters using Bayesian optimization
hyperparametersVariable descriptions for optimizing a fit function
optimizableVariableVariable description for bayesopt or other optimizers
learnersizeCompact size of trained machine learning model object (Seit R2024b)
plotPlot aggregated hyperparameter optimization results (Seit R2024b)
resumeResume hyperparameter optimization problems (Seit R2024b)
summarySummary table for AggregateBayesianOptimization object (Seit R2024b)

Für zeitunabhängige Daten

crossvalEstimate loss using cross-validation
cvpartitionPartition data for cross-validation
repartitionRepartition data for cross-validation
summarySummarize cross-validation partition with stratification or grouping variable (Seit R2025a)
testTest indices for cross-validation
trainingTraining indices for cross-validation

Für Zeitreihendaten

tspartitionPartition time series data for cross-validation (Seit R2022b)
testTest indices for time series cross-validation (Seit R2022b)
trainingTraining indices for time series cross-validation (Seit R2022b)

Local Interpretable Model-Agnostic Explanations (LIME)

limeLocal interpretable model-agnostic explanations (LIME)
fitFit simple model of local interpretable model-agnostic explanations (LIME)
plotPlot results of local interpretable model-agnostic explanations (LIME)

Shapley-Werte

shapleyShapley values
fitCompute Shapley values for query points
plotPlot Shapley values using bar graphs
boxchartVisualize Shapley values using box charts (box plots) (Seit R2024a)
plotDependencePlot dependence of Shapley values on predictor values (Seit R2024b)
swarmchartVisualize Shapley values using swarm scatter charts (Seit R2024a)

Partielle Abhängigkeit

partialDependenceCompute partial dependence
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
sliceMetricsMetrics on data slices for machine learning model (Seit R2026a)
plotPlot bar graph of slice metric (Seit R2026a)
reportGenerate slice metrics report (Seit R2026a)
coefCIConfidence intervals of coefficient estimates of linear regression model
coefTestLinear hypothesis test on linear regression model coefficients
dwtestDurbin-Watson test with linear regression model object
plotScatter plot or added variable plot of linear regression model
plotAddedAdded variable plot of linear regression model
plotAdjustedResponseAdjusted response plot of linear regression model
plotDiagnosticsPlot observation diagnostics of linear regression model
plotEffectsPlot main effects of predictors in linear regression model
plotInteractionPlot interaction effects of two predictors in linear regression model
plotResidualsPlot residuals of linear regression model
plotSlicePlot of slices through fitted linear regression surface
coefCIConfidence intervals of coefficient estimates of generalized linear regression model
coefTestLinear hypothesis test on generalized linear regression model coefficients
devianceTestAnalysis of deviance for generalized linear regression model
plotDiagnosticsPlot observation diagnostics of generalized linear regression model
plotResidualsPlot residuals of generalized linear regression model
plotSlicePlot of slices through fitted generalized linear regression surface
coefCIConfidence intervals of coefficient estimates of nonlinear regression model
coefTestLinear hypothesis test on nonlinear regression model coefficients
plotDiagnosticsPlot diagnostics of nonlinear regression model
plotSlicePlot of slices through fitted nonlinear regression surface
linhyptestLinear hypothesis test

Objekte

alle erweitern

FeatureSelectionNCARegressionFeature selection for regression using neighborhood component analysis (NCA)
FeatureTransformerGenerated feature transformations
BayesianOptimizationBayesian optimization results
HyperparameterOptimizationOptionsHyperparameter optimization options (Seit R2024b)
AggregateBayesianOptimizationAggregate Bayesian optimization results (Seit R2024b)
SupervisedLearningBayesianOptimizationResults of Bayesian optimization for supervised learning model (Seit R2026a)

Themen

Workflow der Regression Learner App

Merkmalsauswahl

Merkmalsentwicklung

  • Automated Feature Engineering for Regression
    Use genrfeatures to engineer new features before training a regression model. Before making predictions on new data, apply the same feature transformations to the new data set.

Automatische Modellauswahl

Hyperparameter-Optimierung

Kreuzvalidierung

Modellauswertung

Unsicherheitsschätzung

Diagnostik linearer Modelle

  • Interpret Linear Regression Results
    Display and interpret linear regression output statistics.
  • Linear Regression
    Fit a linear regression model and examine the result.
  • Linear Regression with Interaction Effects
    Construct and analyze a linear regression model with interaction effects and interpret the results.
  • Summary of Output and Diagnostic Statistics
    Evaluate a fitted model by using model properties and object functions.
  • F-statistic and t-statistic
    In linear regression, the F-statistic is the test statistic for the analysis of variance (ANOVA) approach to test the significance of the model or the components in the model. The t-statistic is useful for making inferences about the regression coefficients.
  • Coefficient of Determination (R-Squared)
    Coefficient of determination (R-squared) indicates the proportionate amount of variation in the response variable y explained by the independent variables X in the linear regression model.
  • Coefficient Standard Errors and Confidence Intervals
    Estimated coefficient variances and covariances capture the precision of regression coefficient estimates.
  • Residuals
    Residuals are useful for detecting outlying y values and checking the linear regression assumptions with respect to the error term in the regression model.
  • Durbin-Watson Test
    The Durbin-Watson test assesses whether or not there is autocorrelation among the residuals of time series data.
  • Cook’s Distance
    Cook's distance is useful for identifying outliers in the X values (observations for predictor variables).
  • Hat Matrix and Leverage
    The hat matrix provides a measure of leverage.
  • Delete-1 Statistics
    Delete-1 change in covariance (CovRatio) identifies the observations that are influential in the regression fit.

Diagnostik generalisierter linearer Modelle

  • Generalized Linear Models
    Generalized linear models use linear methods to describe a potentially nonlinear relationship between predictor terms and a response variable.

Diagnostik nichtlinearer Modelle

  • Nonlinear Regression
    Parametric nonlinear models represent the relationship between a continuous response variable and one or more continuous predictor variables.