Evaluation::Evaluation(std::string inputFile, std::string indexFile)
	{
		this->inputFile = inputFile;
		this->labelsName = readIndexFile(indexFile);

		int nLabels = this->labelsName.size();
		this->confusionMat.create(nLabels, nLabels);
		this->confusionMat = 0;

		this->confusionMatScores = new std::vector<float>*[nLabels];
		for (int i = 0; i < nLabels; i++)
			this->confusionMatScores[i] = new std::vector<float>[nLabels];
	}
Exemple #2
0
void PBIDBAccess::syncPbiRepoLists(bool reload){
  // NOTE: Uses the PKGAVAIL and PKGINSTALLED lists  - check your sync order!!
  //qDebug() << "Sync PBI repo";
  //All PBIs/Categories available in the index (jail independant)
  if(PBIAVAIL.isEmpty() || CATAVAIL.isEmpty() || reload){
    PBIAVAIL.clear(); CATAVAIL.clear();
    QStringList index = readIndexFile();
    index.sort(); //make sure that categories are first (Cat=, PBI=)
    for(int i=0; i<index.length(); i++){
      if(index[i].startsWith("Cat=")){
	NGCat cat = parseNgCatLine( index[i].section("=",1,50) );
	if(!cat.portcat.isEmpty()){
	  //qDebug() << "CAT:" << cat.portcat << cat.name;
	  CATAVAIL.insert(cat.portcat, cat);
	}
      }else if(index[i].startsWith("PBI=")){
	
	NGApp app = parseNgIndexLine( index[i].section("=",1,50) );
	//Prune the PBI app based upon package availability
	//qDebug() << "PBI:" << app.origin << PKGAVAILABLE.contains(app.origin);
	if( !app.origin.isEmpty() && PKGAVAIL.contains(app.origin) ){
	  //qDebug() << "PBI Available:" << app.origin << app.name;
	  //Also check for additional required packages
	  bool ok = true;
	  for(int i=0; i<app.needsPkgs.length(); i++){
	    if( !PKGAVAIL.contains(app.needsPkgs[i]) ){ ok = false; qDebug() << "BAD PBI:" << app.origin << app.needsPkgs; break; }
	  }
	  if(!ok && app.isInstalled){ qDebug() <<" - but is installed"; app.isInstalled=false; ok = true; }
	  if(ok){
	    //if(app.isInstalled){ qDebug() << "PBI Installed:" << app.origin << app.name << app.installedversion; }
	    PBIAVAIL.insert(app.origin, app);
	  }
	}
      }else if(index[i].startsWith("PKG=")){
	//Additional PKG info in the PBI index (to save on pkg calls for multi-line info)
	  //Just adds additional info for existing packages
	parseNgPkgLine( index[i].section("=",1,100) );
      }
    }
  } //end sync if necessary
  //qDebug() << " - end PBI repo sync";
}