Example usage for weka.filters.unsupervised.attribute Normalize setScale

List of usage examples for weka.filters.unsupervised.attribute Normalize setScale

Introduction

In this page you can find the example usage for weka.filters.unsupervised.attribute Normalize setScale.

Prototype

public void setScale(double value) 

Source Link

Document

Sets the scaling factor.

Usage

From source file:mao.datamining.Util.java

/**
 * To normalize all the attributes in a dataset
 * @param newData/*from  w  w  w  .  j a v a  2 s .  c  om*/
 * @return 
 */
public static Instances normalizeDS(Instances newData) {
    try {
        Normalize normal = new Normalize();
        normal.setInputFormat(newData);
        normal.setIgnoreClass(true);
        normal.setScale(1.0);
        newData = Filter.useFilter(newData, normal);
        //            Main.logging("== New Data after normalizing data : ===\n" + newData.toSummaryString());

    } catch (Exception ex) {
        Logger.getLogger(DataSetPair.class.getName()).log(Level.SEVERE, null, ex);
    }
    return newData;
}