@Test public void testSparse() throws Exception { Iterable<Vector> iterable = readModelFromResource("sample-sparse.arff"); Vector firstVector = iterable.iterator().next(); assertEquals(23.1, firstVector.get(1), 0); assertEquals(3.23, firstVector.get(2), 0); assertEquals(1.2, firstVector.get(3), 0); int count = 0; for (Vector vector : iterable) { assertTrue("Vector is not dense", vector instanceof RandomAccessSparseVector); count++; } assertEquals(9, count); }
@Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model);  ARFFVectorIterable(File file, Charset encoding, ARFFModel model);  ARFFVectorIterable(String arff, ARFFModel model);  ARFFVectorIterable(Reader reader, ARFFModel model); }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model);  ARFFVectorIterable(File file, Charset encoding, ARFFModel model);  ARFFVectorIterable(String arff, ARFFModel model);  ARFFVectorIterable(Reader reader, ARFFModel model); @Override Iterator<Vector> iterator(); ARFFModel getModel(); }
ARFFVectorIterable implements Iterable<Vector> { @Override public Iterator<Vector> iterator() { return new ARFFIterator(buff, model); } ARFFVectorIterable(File file, ARFFModel model);  ARFFVectorIterable(File file, Charset encoding, ARFFModel model);  ARFFVectorIterable(String arff, ARFFModel model);  ARFFVectorIterable(Reader reader, ARFFModel model); @Override Iterator<Vector> iterator(); ARFFModel getModel();  }