void FeatureData::load(istream* is) { FeatureArray entry; while (!is->eof()) { if (!is->good()) { cerr << "ERROR FeatureData::load inFile.good()" << endl; } entry.clear(); entry.load(is); if (entry.size() == 0) break; if (size() == 0) setFeatureMap(entry.Features()); if (entry.hasSparseFeatures()) m_sparse_flag = true; add(entry); } }
void FeatureData::load(istream* is, const SparseVector& sparseWeights) { FeatureArray entry; while (!is->eof()) { if (!is->good()) { cerr << "ERROR FeatureData::load inFile.good()" << endl; } entry.clear(); entry.load(is, sparseWeights); if (entry.size() == 0) break; if (size() == 0) setFeatureMap(entry.Features()); add(entry); } }