1
votes

I have a large dataset for two classes with different attributes scales (some attributes from 5 to 10, others from 0 to 100, for example). I know if I use directly a kNN algorithm that difference will invalidate the analysis and I need to normalize the attributes.

Some classifiers on WEKA appear to do that normalization, like the RBF or SMO, but I need to use other classifiers, firstly IBK classifier (KNN).

Does weka lead with it in some way? How can I incorporate a normalization process in KNN classification?

Thanks

2

2 Answers

0
votes

In the "Preprocess" Panel there is an unsupervised attribute filter called "Normalize".

0
votes

For maximal freedom (ability to transform your attributes in the way that suits you best: standardization, min-max normalization, etc.), you can normalize your attributes using for instance MATLAB (or Python...). For this, you have to load/store your dataset in form of a matrix (where the columns correspond to your attributes, while the rows to your training instances/examples, which is typically for a CSV file). Then you can easily manipulate with the columns, e.g. loop over each columns and normalize it.

Finally, you may feed the new dataset with normalized features into Weka.