()
| 25 | } |
| 26 | |
| 27 | private void advance() { |
| 28 | next = null; |
| 29 | while((next==null)&&(i<rawdat.length)) { |
| 30 | final int category = rawdat[i][dim-1]>0.5?1:0; |
| 31 | final double[] vec = new double[dim]; |
| 32 | vec[0] = 1.0; |
| 33 | for(int j=0;j<dim-1;++j) { |
| 34 | if(rawdat[i][j]!=0.0) { |
| 35 | vec[j+1] = rawdat[i][j]; |
| 36 | } |
| 37 | } |
| 38 | next = new SparseExampleRow(new SparseSemiVec(vec),1.0,category); |
| 39 | ++i; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public boolean hasNext() { |