I'm training a model using Weka's LibSVM wrapper, which includes an option to apply normalization to the training data. When applying this model to new instances (test data), will Weka normalize automatically using the same mean values from the training data or do I have to do this explicitly ?
1
votes
1 Answers
1
votes
Instances train_data = ...
Instances test_data = ...
Standardize filter = new Standardize();
filter.setInputFormat(train_data);
Instances normalizedTrain_data = Filter.useFilter(train_data, filter);
Instances normalizedTest_data = Filter.useFilter(test_data, filter);
As you can see, the filter is initialized using the training data. And the filter applies on both training data and test data.