Ejemplo n.º 1
0
void FeatureStats::Copy(const FeatureStats &stats)
{
  m_available_size = stats.available();
  m_entries = stats.size();
  m_array = new FeatureStatsType[m_available_size];
  memcpy(m_array, stats.getArray(), GetArraySizeWithBytes());
  m_map = stats.getSparse();
}
Ejemplo n.º 2
0
void Data::outputSample( ostream &out, const FeatureStats &f1, const FeatureStats &f2 ) 
{
  // difference in score in regular features
	for(unsigned int j=0; j<f1.size(); j++)
		if (abs(f1.get(j)-f2.get(j)) > 0.00001)
			out << " F" << j << " " << (f1.get(j)-f2.get(j));

  if (!hasSparseFeatures())
    return;

  out << " ";

  // sparse features
  const SparseVector &s1 = f1.getSparse();
  const SparseVector &s2 = f2.getSparse();
  SparseVector diff = s1 - s2;
  diff.write(out);
}