How to use different scaling approaches in weka

陌路散爱 提交于 2020-01-03 04:54:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!