tokens[attr] = token;
}
int nbattrs = Dataset.countAttributes(attrs);
DenseVector vector = new DenseVector(nbattrs);
int aId = 0;
int label = -1;
for (int attr = 0; attr < attrs.length; attr++) {
if (attrs[attr].isIgnored())
continue;
String token = tokens[attr];
if (attrs[attr].isNumerical()) {
vector.set(aId++, Double.parseDouble(token));
} else { // CATEGORICAL or LABEL
// update values
if (values[attr] == null)
values[attr] = new ArrayList<String>();
if (!values[attr].contains(token))
values[attr].add(token);
if (attrs[attr].isCategorical()) {
vector.set(aId++, values[attr].indexOf(token));
} else { // LABEL
label = values[attr].indexOf(token);
}
}
}