This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Model Building and Assessment

Feature selection, hyperparameter optimization, cross-validation, predictive performance evaluation, classification accuracy comparison tests

When building a high-quality, predictive classification model, it is important to select the right features (or predictors) and tune hyperparameters (model parameters not fit to the data). You can tune hyperparameters by iterating between choosing values for them, and cross-validating a model using your choices. For example, to tune an SVM model, choose a set of box constraints and kernel scales, and then cross-validate a model for each pair of values. Certain Statistics and Machine Learning Toolbox™ classification functions additionally offer automatic hyperparameter tuning through Bayesian optimization, grid search, or random search. However, bayesopt, which is the main function to implement Bayesian optimization, is flexible enough for many other applications. For more details, see Bayesian Optimization Workflow.

Typically, feature selection and hyperparameter tuning can yield multiple models. You can simply compare the k-fold misclassification rates, ROC curves, or confusion matrices among the models. Or, conduct a statistical test to detect whether a classification model significantly outperforms another.

To build and assess classification models interactively, use the Classification Learner app.


Classification Learner Train models to classify data using supervised machine learning


sequentialfs Sequential feature selection
relieff Importance of attributes (predictors) using ReliefF algorithm
bayesopt Find global minimum of function using Bayesian Optimization
hyperparameters Variable descriptions for optimizing a fit function
crossval Loss estimate using cross validation
cvpartition Data partitions for cross validation
repartition Repartition data for cross-validation
test Test indices for cross-validation
training Training indices for cross-validation
confusionmat Confusion matrix
perfcurve Receiver operating characteristic (ROC) curve or other performance curve for classifier output
testcholdout Compare predictive accuracies of two classification models
testckfold Compare accuracies of two classification models by repeated cross validation

Using Objects

BayesianOptimization Bayesian optimization results
optimizableVariable Variable description for bayesopt or other optimizers
cvpartition Data partitions for cross validation


Classification Learner App

Train Classification Models in Classification Learner App

Workflow for training, comparing and improving 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

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

Feature Selection

Feature Selection

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

Hyperparameter Optimization

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 constraint for Bayesian optimization.

Optimize a Cross-Validated SVM Classifier Using Bayesian Optimization

Minimize cross-validation loss using bayesopt.

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 underlying algorithms for Bayesian optimization.


Implement Cross-Validation Using Parallel Computing

Speed up cross-validation using parallel computing.

Classification Performance Evaluation

Performance Curves

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

Was this topic helpful?