Contenu principal

La traduction de cette page n'est pas à jour. Cliquez ici pour voir la dernière version en anglais.

Conception et évaluation de modèles

R2026a
Génération de données synthétiques, sélection de caractéristiques, ingénierie des caractéristiques, sélection de modèle, optimisation des hyperparamètres, validation croisée, diagnostics de résidus et tracés

Lorsque vous construisez un modèle de régression de haute qualité, il est important de sélectionner des caractéristiques (ou prédicteurs) appropriées, de régler les hyperparamètres (paramètres du modèle qui ne s’ajustent pas aux données) et d’évaluer les hypothèses du modèle via des diagnostics de résidus. Vous pouvez régler les hyperparamètres en effectuant des itérations entre la sélection des valeurs à leur appliquer et la validation croisée du modèle avec vos sélections. Ce processus produit plusieurs modèles, le meilleur d’entre eux étant peut-être celui qui minimise l’erreur de généralisation estimée.

Vous pouvez effectuer les actions suivantes pour créer et évaluer des modèles de régression :

  • Générer des données synthétiques à partir d’un jeu de données existant avant d’entraîner un modèle de régression avec synthesizeTabularData, binningTabularSynthesizer ou smoteTabularSynthesizer.

  • Définir de nouvelles caractéristiques avant d’entraîner un modèle de régression avec genrfeatures.

  • Créer et évaluer des modèles de régression de manière interactive avec l’application Regression Learner.

  • Sélectionner automatiquement un modèle comportant des hyperparamètres réglés avec fitrauto. La fonction essaie une sélection de types de modèles de régression avec différentes valeurs d’hyperparamètres et renvoie un modèle final censé être performant. Utilisez fitrauto lorsque vous ne savez pas quels sont les types de modèles de régression qui conviennent le mieux à vos données.

  • Régler les hyperparamètres d’un modèle spécifique en sélectionnant des valeurs pour ceux-ci et en effectuant une validation croisée du modèle avec ces valeurs. Par exemple, pour régler un modèle SVM, choisissez une ensemble de valeurs pour le paramètre de contrainte (box constraint) et l'échelle du noyau (kernel scale), effectuez la validation croisée d’un modèle pour chaque paire de valeurs, puis comparez les estimations d’erreur quadratique moyenne après validation croisée 10-fold. Certaines fonctions de régression non paramétrique de Statistics and Machine Learning Toolbox™ offrent un réglage automatique des hyperparamètres par optimisation bayésienne, recherche par grille ou recherche aléatoire. La principale fonction qui implémente l’optimisation bayésienne est bayesopt. Elle est suffisamment flexible pour convenir à de nombreuses autres applications. Pour plus d’informations, consultez Bayesian Optimization Workflow.

  • Interpréter un modèle de régression avec lime, shapley et plotPartialDependence.

  • Évaluer les performances d’un modèle de régression sur des tranches de données distinctes avec sliceMetrics.

Applications

Regression LearnerTrain regression models to predict data using supervised machine learning

Fonctions

développer tout

synthesizeTabularDataSynthesize tabular data (depuis R2024b)
binningTabularSynthesizerBinning-based synthesizer for tabular data synthesis (depuis R2024b)
smoteTabularSynthesizerSMOTE-based synthesizer for tabular data synthesis (depuis R2026a)
synthesizeTabularDataSynthesize tabular data using binning-based or SMOTE-based synthesizer (depuis R2024b)
mmdtestTwo-sample multivariate hypothesis test using maximum mean discrepancy (MMD) (depuis R2024b)
knntestTwo-sample multivariate hypothesis test using k-nearest neighbors (KNN) (depuis R2025a)
fsrftestUnivariate feature ranking for regression using F-tests
fsrmrmrRank features for regression using minimum redundancy maximum relevance (MRMR) algorithm (depuis 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 (depuis 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 (depuis R2023b)
sequentialfsSequential feature selection using custom criterion
stepwiselmPerform stepwise regression
stepwiseglmCreate generalized linear regression model by stepwise regression
genrfeaturesPerform automated feature engineering for regression
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 (depuis R2024b)
plotPlot aggregated hyperparameter optimization results (depuis R2024b)
resumeResume hyperparameter optimization problems (depuis R2024b)
summarySummary table for AggregateBayesianOptimization object (depuis R2024b)

Pour des données indépendantes du temps

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

Pour des données de séries temporelles

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

Explications locales interprétables par modèle agnostique (méthode de 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)

Valeurs de Shapley

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

Dépendance partielle

partialDependenceCompute partial dependence
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
sliceMetricsMetrics on data slices for machine learning model (depuis R2026a)
plotPlot bar graph of slice metric (depuis R2026a)
reportGenerate slice metrics report (depuis 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

Objets

développer tout

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

Rubriques

Workflow de l’application Regression Learner

Sélection de variables pertinentes

Ingénierie des caractéristiques

  • 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.

Sélection de modèle automatisée

Optimisation des hyperparamètres

Validation croisée

Interprétation des modèles

Estimation de l’incertitude

Diagnostics de modèles linéaires

  • 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.

Diagnostics de modèles linéaires généralisés

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

Diagnostics de modèles non linéaires

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