   _dim = isSparse ? findMaxDimension(fin) : findDimension(fin);
   size_t N = getLineNumber(fin);
 
-  _hx.resize(N, _dim + 1);
-  _hy.resize(N, 1);
+  _hx.resize(_dim + 1, N);
+  _hy.resize(1, N);
 
   if (isSparse)
     readSparseFeature(fin);


void DataSet::shuffleFeature() {

  size_t rows = _hx.getRows(),
	 cols = _hx.getCols();

  std::vector<size_t> perm = randperm(rows);

  hmat x(_hx), y(_hy);

  for (size_t i=0; i<rows; ++i) {
    for (size_t j=0; j<cols; ++j)
      _hx(perm[i], j) = x (i, j);
    _hy[perm[i]] = y[i];
  }



    size_t j = 0;
    while (ss >> token)
      _hx(j++, i) = str2float(token);
    ++i;
  }
}
