kNN classifiers 2. Quick start

An example: Learning the Iris data set

In the the feedforward neural networks tutorial a description of how the FFNet classifier in Praat can be applied to the Iris data set can be found.

The same data can be used to test the kNN feature of Praat. To do so create an example data set using the Create iris example... command found in the Feedforward neural networks submenu. The form prompting for network topology settings can be ignored by selecting OK. Select the newly created PatternList and Categories objects and click To KNN Classifier.... A form prompting for a name of the classifier to be created will be shown. The ordering in which instances are to be inserted into the instance base can also be specified, make sure that Random is selected and thereafter close the form by selecting OK. The newly created and trained classifier will be shown in the list of objects.

To estimate how well the classifier can be expected to classify new samples of Irises select Query -Get accuracy estimate.... A form prompting for kNN parameter settings and evaluation method will be shown. Experiment with the parameter settings until satisfactory results are achieved. If everything worked out the estimate will likely end up somewhere in the range of 94-98 percent.

An alternative to manually experimenting with model parameters is to let the computer do the job. This is done be choosing the KNN object and thereafter selecting Query -Get optimized parameters.... The form shown prompts for a selection of parameters controlling the search. The default values will in most cases, including this, be appropriate.

Another way of improving classification accuracy is to transform the instance space in which the individual instances, in this case Irises, are stored as to maximize the distance between instances of different classes and minimize the distance between instances of the same class. This can be done by means of feature weighting. To do so select the KNN object and choose To FeatureWeights.... Adjust the kNN settings according to the ones found by the model search algorithm and let the remaining options retain the default values. Click OK. A FeatureWeights object will be added to the objects list. The feature weights contained within the newly created object can be used by selecting named object in conjunction with the KNN classifier and thereafter choosing the desired action.

Links to this page


© Ola Söder, August 9, 2008