Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this 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 that are not estimated).

To tune hyperparameters, select the hyperparameter values and cross-validate the model using those values. 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 offer automatic hyperparameter tuning through Bayesian optimization, grid search, or random search. However, the main function used to implement Bayesian optimization, bayesopt, is flexible enough for use in other applications. See Bayesian Optimization Workflow.

Feature selection and hyperparameter tuning can yield multiple models. You can compare the k-fold misclassification rates, receiver operating characteristic (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.

Apps

Classification LearnerTrain models to classify data using supervised machine learning

Functions

sequentialfsSequential feature selection
relieffImportance of attributes (predictors) using ReliefF algorithm
bayesoptSelect optimal machine learning hyperparameters using Bayesian optimization
hyperparametersVariable descriptions for optimizing a fit function
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
confusionmatConfusion matrix
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

Using Objects

BayesianOptimizationBayesian optimization results
optimizableVariableVariable description for bayesopt or other optimizers
cvpartitionData partitions for cross validation

Topics

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

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

Parallel Bayesian Optimization

How Bayesian optimization works in parallel.

Cross-Validation

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?