List of usage examples for org.apache.mahout.classifier.df DFUtils readIntArray
public static int[] readIntArray(DataInput in) throws IOException
From source file:com.wsc.myexample.decisionForest.MyDataset.java
License:Apache License
public void readFields(DataInput in) throws IOException { int nbAttributes = in.readInt(); attributes = new Dataset.Attribute[nbAttributes]; for (int attr = 0; attr < nbAttributes; attr++) { String name = readString(in); attributes[attr] = Dataset.Attribute.valueOf(name); }// www . jav a 2s.com ignored = DFUtils.readIntArray(in); // only CATEGORICAL attributes have values values = new String[nbAttributes][]; for (int attr = 0; attr < nbAttributes; attr++) { if (attributes[attr].isCategorical()) { values[attr] = readStringArray(in); } } labelId = in.readInt(); nbInstances = in.readInt(); }