Using the GUI (graphical user interface)
Data must be organised as samples (rows) x variables (columns). The class vector must have dimensions samples x 1. Class labels must be numerical. If G classes are present, class labels must range from 1 to G (0 values are not allowed). Type:
on the MATLAB command window to see an example of data structure.
Both sample and variable labels can be used to visualize the results. Labels must be structured as cell array vectors with a number of entries equal to the number of samples or variables.
Starting the graphical interface
The Classification toolbox can work both on the MATLAB command window (see details
) or with its graphical interface. The graphical interface enables you to do all the steps of the analysis (data loading, setting preparation, model calculation, sample prediction, model validation). In order to start the graphical interface, type the following code in the MATLAB command window:
the main form of the graphical interface will appear:
In order to activate the menu of the form, data or models must be loaded. In the window, two listboxes will show the details of the loaded data (on the left) and of the loaded (or calculated) model (on the right).
Loading data and models
Data, class vectors, models and labels can be loaded directly from the MATLAB workspace or from a MATLAB data file, using the file menu. Here it is also possible to save models and predictions.
Viewing the data
Data and class vector (as well as basic plots, and a simple variable selection based on the Wilks' lambda) can be seen in the view menu. In this menu, samples can be also deleted from the dataset.
How to calculate classification models
In order to calculate classification models select the calculate menu.
After the model calculation, the model window in the main form is updated with the model details (type of calculated models and options, error rates associated to the model). Then, it is possible to see the classification performances as well as details of the calculated model in the results menu.
Classification models can be saved from the file menu.
Predicting new samples
When a model is loaded or calculated, a new set of samples can be loaded, overwriting the set of samples used for the calculation. This new set of samples can be predicted by using the predict menu.