问题
I am using logistic regression
with my data in weka. Now I want to try different scaling approaches to improve my results, such as min/max, zero mean/unit, variance, length etc.
Is there any option in weka for using scaling?
回答1:
Weka includes methods for data preprocessing:
weka.filters.unsupervised.attribute.Normalize
weka.filters.unsupervised.attribute.Standardize
In Java:
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);
In Weka Explorer, under "Filter" choose the "Standardize" filter and apply it to all attributes. Check this tutorial for more details.
来源:https://stackoverflow.com/questions/20904071/how-to-use-different-scaling-approaches-in-weka