main content

模型的构建和评估 -凯发k8网页登录

特征选择、特征工程、模型选择、超参数优化、交叉验证、残差诊断和绘图

在构建高质量回归模型时,选择正确的特征(或预测变量)、调整超参数(未与数据拟合的模型参数)以及通过残差诊断评估模型假设非常重要。

您可以先为超参数选择值,然后使用您选择的值对模型进行交叉验证,通过这样的迭代对超参数进行调整。这个过程会生成多个模型,其中估计的泛化误差最小的可能是最佳模型。例如,要调整 svm 模型,可以选择一组框约束和核尺度,使用每对值对模型进行交叉验证,然后比较它们的 10 折交叉验证均方误差估计值。

要在训练回归模型之前对新函数进行工程处理,请使用 。

要以交互方式构建和评估回归模型,请使用

要自动选择具有调整后的超参数的模型,请使用 。该函数尝试选择具有不同超参数值的回归模型类型,并返回预期表现良好的最终模型。当您不确定哪些回归模型类型最适合您的数据时,请使用 fitrauto

statistics and machine learning toolbox™ 中的某些非参数化回归函数通过贝叶斯优化、网格搜索或随机搜索提供自动超参数调整。实现贝叶斯优化的主函数 对于许多其他应用来说也足够灵活。有关详细信息,请参阅bayesian optimization workflow

要解释回归模型,可以使用 limeshapleyplotpartialdependence

app

使用有监督机器学习训练回归模型来预测数据

函数

univariate feature ranking for regression using f-tests
rank features for regression using minimum redundancy maximum relevance (mrmr) algorithm
feature selection using neighborhood component analysis for regression
oobpermutedpredictorimportancepredictor importance estimates by permutation of out-of-bag predictor observations for random forest of regression trees
partialdependencecompute partial dependence
plotpartialdependencecreate partial dependence plot (pdp) and individual conditional expectation (ice) plots
estimates of predictor importance for regression tree
estimates of predictor importance for regression ensemble
rank importance of predictors using relieff or rrelieff algorithm
sequential feature selection using custom criterion
perform stepwise regression
create generalized linear regression model by stepwise regression
perform automated feature engineering for regression
describe generated features
transform new data using generated features
automatically select regression model with optimized hyperparameters
select optimal machine learning hyperparameters using bayesian optimization
variable descriptions for optimizing a fit function
variable description for bayesopt or other optimizers

对于与时间无关的数据

estimate loss using cross-validation
cvpartitionpartition data for cross-validation
repartition data for cross-validation
test indices for cross-validation
training indices for cross-validation

对于时间序列数据

partition time series data for cross-validation
test indices for time series cross-validation
training indices for time series cross-validation

与模型无关的局部可解释性解释 (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 值

shapleyshapley values
fitcompute shapley values for query point
plotplot shapley values

部分依赖

partialdependencecompute partial dependence
plotpartialdependencecreate partial dependence plot (pdp) and individual conditional expectation (ice) plots
confidence intervals of coefficient estimates of linear regression model
linear hypothesis test on linear regression model coefficients
durbin-watson test with linear regression model object
scatter plot or added variable plot of linear regression model
added variable plot of linear regression model
adjusted response plot of linear regression model
plot observation diagnostics of linear regression model
plot main effects of predictors in linear regression model
plot interaction effects of two predictors in linear regression model
plot residuals of linear regression model
plot of slices through fitted linear regression surface
confidence intervals of coefficient estimates of generalized linear regression model
linear hypothesis test on generalized linear regression model coefficients
analysis of deviance for generalized linear regression model
plot observation diagnostics of generalized linear regression model
plot residuals of generalized linear regression model
plot of slices through fitted generalized linear regression surface
confidence intervals of coefficient estimates of nonlinear regression model
linear hypothesis test on nonlinear regression model coefficients
plot diagnostics of nonlinear regression model
plot of slices through fitted nonlinear regression surface
linear hypothesis test

对象

feature selection for regression using neighborhood component analysis (nca)
generated feature transformations
bayesianoptimizationbayesian optimization results

主题

回归学习器工作流

  • train regression models in regression learner app
    workflow for training, comparing and improving regression models, including automated, manual, and parallel training.

  • in regression learner, automatically train a selection of models, or compare and tune options of linear regression models, regression trees, support vector machines, gaussian process regression models, kernel approximation models, ensembles of regression trees, and regression neural networks.

  • identify useful predictors using plots or feature ranking algorithms, select features to include, and transform features using pca in regression learner.

  • compare model metrics and visualize results.

特征选择

  • introduction to feature selection
    learn about feature selection algorithms and explore the functions available for feature selection.

  • this topic introduces sequential feature selection and provides an example that selects features sequentially using a custom criterion and the sequentialfs function.

  • neighborhood component analysis (nca) is a non-parametric method for selecting features with the goal of maximizing prediction accuracy of regression and classification algorithms.

  • perform feature selection that is robust to outliers using a custom robust loss function in nca.

  • select split-predictors for random forests using interaction test algorithm.

特征工程


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

自动模型选择


  • use fitrauto to automatically try a selection of regression model types with different hyperparameter values, given training predictor and response data.

超参数优化

  • bayesian optimization workflow
    perform bayesian optimization using a fit function or by calling bayesopt directly.

  • create variables for bayesian optimization.

  • create the objective function for bayesian optimization.

  • set different types of constraints for bayesian optimization.

  • minimize cross-validation loss of a regression ensemble.

  • visually monitor a bayesian optimization.

  • monitor a bayesian optimization.
  • bayesian optimization algorithm
    understand the underlying algorithms for bayesian optimization.

  • how bayesian optimization works in parallel.

模型解释

交叉验证

线性模型诊断


  • display and interpret linear regression output statistics.

  • fit a linear regression model and examine the result.

  • construct and analyze a linear regression model with interaction effects and interpret the results.

  • evaluate a fitted model by using model properties and object functions.

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

  • 决定系数(r 方)表示线性回归模型中由自变量 x 解释的响应变量 y 的变化比例。

  • estimated coefficient variances and covariances capture the precision of regression coefficient estimates.

  • residuals are useful for detecting outlying y values and checking the linear regression assumptions with respect to the error term in the regression model.

  • the durbin-watson test assesses whether or not there is autocorrelation among the residuals of time series data.

  • cook's distance is useful for identifying outliers in the x values (observations for predictor variables).

  • the hat matrix provides a measure of leverage.

  • delete-1 change in covariance (covratio) identifies the observations that are influential in the regression fit.

广义线性模型诊断


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

非线性模型诊断


  • parametric nonlinear models represent the relationship between a continuous response variable and one or more continuous predictor variables.
网站地图