Esempio n. 1
0
  Instance toSparseInstance(String[] t) throws Exception {
    SparseVector v = new SparseVector();
    float f;

    for (int i = 1; i < t.length; i++) {
      f = Float.parseFloat(t[i]);
      if (f != 0) v.add(i - 1, f);
    }

    return new Instance(t[0], v);
  }