Example usage for org.apache.mahout.classifier.df.data Dataset.Attribute hashCode

List of usage examples for org.apache.mahout.classifier.df.data Dataset.Attribute hashCode

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.df.data Dataset.Attribute hashCode.

Prototype

@Override
    public int hashCode() 

Source Link

Usage

From source file:com.wsc.myexample.decisionForest.MyDataset.java

License:Apache License

@Override
public int hashCode() {
    int hashCode = labelId + 31 * nbInstances;
    for (Dataset.Attribute attr : attributes) {
        hashCode = 31 * hashCode + attr.hashCode();
    }/*from  ww w .j  ava 2 s . c  om*/
    for (String[] valueRow : values) {
        if (valueRow == null) {
            continue;
        }
        for (String value : valueRow) {
            hashCode = 31 * hashCode + value.hashCode();
        }
    }
    return hashCode;
}