本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

模型的构建和评估

特征选择、超参数优化、交叉验证、预测性能评估、分类准确性比较检验

在构建高质量预测分类模型时,选择正确的特征(或预测变量)并调整超参数(未估计的模型参数)非常重要。

要调整超参数,请选择超参数值并使用这些值对模型进行交叉验证。例如,要调整 SVM 模型,可以选择一组框约束和核尺度,然后使用每对值对模型进行交叉验证。Statistics and Machine Learning Toolbox™ 中的某些分类函数可以通过贝叶斯优化、网格搜索或随机搜索自动调整超参数。用于实现贝叶斯优化的主函数 bayesopt 是足够灵活的,还可以用在其他许多应用中使用。请参阅Bayesian Optimization Workflow

特征选择和超参数调整可能会产生多个模型。您可以比较模型之间的 k 折分类错误率、受试者工作特征 (ROC) 曲线或混淆矩阵。还可以进行统计检验,以检测一个分类模型是否明显优于另一个。

要以交互方式构建和评估分类模型,可以使用 Classification Learner App。

App

Classification LearnerTrain models to classify data using supervised machine learning

函数

全部展开

sequentialfsSequential feature selection
relieffRank importance of predictors using ReliefF or RReliefF algorithm
bayesoptSelect optimal machine learning hyperparameters using Bayesian optimization
hyperparametersVariable descriptions for optimizing a fit function
optimizableVariableVariable description for bayesopt or other optimizers
crossvalLoss estimate using cross-validation
cvpartitionCreate cross-validation partition for data
repartitionRepartition data for cross-validation
testTest indices for cross-validation
trainingTraining indices for cross-validation
confusionchartCreate confusion matrix chart for classification problem
confusionmatCompute confusion matrix for classification problem
perfcurveReceiver operating characteristic (ROC) curve or other performance curve for classifier output
testcholdoutCompare predictive accuracies of two classification models
testckfoldCompare accuracies of two classification models by repeated cross validation

对象

全部展开

BayesianOptimizationBayesian optimization results
cvpartitionData partitions for cross validation

主题

Classification Learner App

Train Classification Models in Classification Learner App

Workflow for training, comparing and improving classification models, including automated, manual, and parallel training.

Assess Classifier Performance in Classification Learner

Compare model accuracy scores, visualize results by plotting class predictions, and check performance per class in the Confusion Matrix.

Feature Selection and Feature Transformation Using Classification Learner App

Identify useful predictors using plots, manually select features to include, and transform features using PCA in Classification Learner.

特征选择

Feature Selection

Learn about feature selection algorithms, such as sequential feature selection.

超参数优化

Bayesian Optimization Workflow

Perform Bayesian optimization using a fit function or by calling bayesopt directly.

Variables for a Bayesian Optimization

Create variables for Bayesian optimization.

Bayesian Optimization Objective Functions

Create the objective function for Bayesian optimization.

Constraints in Bayesian Optimization

Set different types of constraints for Bayesian optimization.

Optimize a Cross-Validated SVM Classifier Using bayesopt

Minimize cross-validation loss using Bayesian Optimization.

Optimize an SVM Classifier Fit Using Bayesian Optimization

Minimize cross-validation loss using the OptimizeParameters name-value pair in a fitting function.

Bayesian Optimization Plot Functions

Visually monitor a Bayesian optimization.

Bayesian Optimization Output Functions

Monitor a Bayesian optimization.

Bayesian Optimization Algorithm

Understand the underlying algorithms for Bayesian optimization.

Parallel Bayesian Optimization

How Bayesian optimization works in parallel.

交叉验证

Implement Cross-Validation Using Parallel Computing

Speed up cross-validation using parallel computing.

分类性能计算

Performance Curves

Examine the performance of a classification algorithm on a specific test data set using a receiver operating characteristic curve.