Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top