Optimized classify function

The problem was that
  ds[i,]$col
is much slower than
  ds$col[i]