亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? convert.cpp

?? clique code with sample data set. clique is a data clustering algorithm which follows hierarchical c
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
    i = 0;
    // Second pass: Actual conversion using the maps created before
    while(!ifile2.eof()){
      outColumn = 0;
      currentColumn = 0;
      buffer[0] = '\0';

      if (use_ascii) cout << i << " ";
      else cout.write((char*)&i, sizeof(int));
      if (use_ascii) cout << numberOfTuples << " ";
      else cout.write((char*)&numberOfTuples, sizeof(int));

      // cout << "Writing " << i << endl;

      while(outColumn < outColumns){
	ifile2 >> buffer;
	entry = buffer;

	if(currentColumn == labelColumn){
	  // cout << "Label is " << labelMap[entry] - 1 << endl;
	  ofile << labelMap[entry] - 1 << endl;
	}

	if(buffer[0] == '\n' || buffer[0] == ','){
	}
	else{
	  // Check if this column is blocked
	  for(columnIt = ignoredColumns.begin(); columnIt != ignoredColumns.end(); columnIt++){
	    if(currentColumn == *columnIt)
	      break;
	  }

	  
	  if(columnIt == ignoredColumns.end()){
	    outValue = columnOffset[outColumn] + attrMap[outColumn][entry] - 1;
	    // cout << "OV in " << outColumn << " = " << outValue << endl;
	    if (use_ascii) cout << outValue << " ";
            else cout.write((char*)&outValue, sizeof(int));
	    // cout << "DONE" << endl;
	    outColumn++;
	  }
	  currentColumn++;
	}
      }
      while(currentColumn < totalColumns){
	ifile2 >> buffer;
	currentColumn++;
      }
      if (use_ascii) cout << i << endl;
      else cout.write((char*)&i, sizeof(int));

      outValue = -1;
      i++;
    }

    // Finally, create the mapping file so we know what the original attribute
    // values were
    //for(attrMapIt = labelMap.begin(); attrMapIt != labelMap.end(); attrMapIt++){
    //  ofile2 << "Label " << ": '" << attrMapIt->first << "' = " << attrMapIt->second << endl;
    //}

    for(i = 0; i < outColumns; i++){
      ofile2 << "*A* " << i << endl;

      for(attrMapIt = attrMap[i].begin(); attrMapIt != attrMap[i].end(); attrMapIt++){
	if(attrMapIt->first != ""){
	  ofile2 << attrMapIt->first << " " << attrMapIt->second << endl;
	}
	else{
	  ofile2 << "- " << attrMapIt->second << endl;
	}
      }
    }

    ifile2.close();
    ofile.close();
    delete[] attrMap;

    break;
  case CLICKTOROCK:
    if(argc < 4){
      printf("convert: You need to specify the number of values you want in the output file\n");
      printf("convert: CLICKTOROCK <sourcefile> <itemlimit>\n");
      exit(1);
    }

    items = NULL;

    ifile.read((char*)&numberOfTuples, sizeof(int));
    
    ifile.read((char*)&numItems, sizeof(int));
    
    items = new int[numItems];
    ifile.read((char*)items, numItems*sizeof(int));
    delete items;    
    items = new int[numItems + 3];

    int effectiveTuples;
    effectiveTuples = atoi(argv[3]) < numberOfTuples ? atoi(argv[3]) : numberOfTuples;

    tuples = new int[effectiveTuples * (numItems + 3)];
    ifile.read((char*)tuples, effectiveTuples * (numItems+3)*sizeof(int));
      
    cout << "1 " << effectiveTuples << " 1" << endl;
    for(i = 0; i < effectiveTuples - 1; i++){
      for(j = i+1; j < effectiveTuples; j++){
	common = total = 0;
	for(k = 2; k < numItems + 2; k++){
	  if(tuples[i * (numItems+3) + k] == tuples[j * (numItems + 3) + k]){
	    common++;
	    total++;
	  }
	  else{
	    total += 2;
	  }
	}
	
	if(total != 0){
	  cout << (double)common / double(total) << " " << i+1 << " " << j+1 << endl;
	}
	else{
	  cout << 0.0 << " " << i+1 << " " << j+1 << endl;
	}
      }
    }
    
   
    break;

  case CONFUSION:
  
    if(argc < 5){
      printf("convert: You need to give two confusion files and a mapping file.\n");
      printf("convert: CONFUSION <confusion1> <confusion2> <mapping file for 1>\n");
      exit(1);
    }

    ifile2.open(argv[3]);
    if(!ifile2.is_open()){
      printf("Could not open confusion file '%s'\n", argv[3]);
      ifile.close();
      exit(1);
    }

    ifile3.open(argv[4]);
    if(!ifile3.is_open()){
      printf("Could not open mapping file '%s'\n", argv[4]);
      ifile.close();
      ifile2.close();
      exit(1);
    }

    // First read the cluster number mapping
    while(!ifile3.eof()){
      ifile3 >> buffer;
      mapFrom = atoi(buffer);
      ifile3 >> buffer;
      mapTo = atoi(buffer);
      
      if(mapFrom == mapTo)
	continue;
  
      //cout << "convert: Mapping " << mapFrom << " to " << mapTo << endl;

      // Confusion files start counting at -1 (for "no cluster") and we need the
      // 0 as reserved value for "no mapping specified"
      confusionMap[mapFrom + 2] = mapTo + 2;

    }
    ifile3.close();


    numberOfTuples = 0;
    maxDim1 = maxDim2 = 0;

    while(!ifile.eof()){
      if(ifile2.eof()){
	printf("Warning: Confusion files have different length\n");
	break;
      }
      
      tokenizer.clear();
      clusters1.clear();
      ifile >> tokenizer;

      if(tokenizer.empty())
	break;

      while(!tokenizer.empty()){
        if((position = tokenizer.find_first_of(",")) >= 0){
	  clusterNumber = atoi(tokenizer.substr(0, position).c_str()) + 2;
	  tokenizer.erase(0, position + 1);
	}
	else{
	  clusterNumber = atoi(tokenizer.c_str()) + 2;
	  tokenizer.clear();
	}
	if(confusionMap[clusterNumber] != 0)
	  clusterNumber = confusionMap[clusterNumber];
	
	clusters1.push_back(clusterNumber);
	
	if(clusterNumber > maxDim1)
	  maxDim1 = clusterNumber;
      }

      tokenizer.clear();
      clusters2.clear();
      ifile2 >> tokenizer;

      while(!tokenizer.empty()){
        if((position = tokenizer.find_first_of(",")) >= 0){
	  clusterNumber = atoi(tokenizer.substr(0, position).c_str()) + 2;
	  tokenizer.erase(0, position + 1);
	}
	else{
	  clusterNumber = atoi(tokenizer.c_str()) + 2;
	  tokenizer.clear();
	}
	if(confusionMap[clusterNumber] != 0)
	  clusterNumber = confusionMap[clusterNumber];
	
	clusters2.push_back(clusterNumber);
	
	if(clusterNumber > maxDim2)
	  maxDim2 = clusterNumber;
      }
 
      numberOfTuples++;

      // See if there's a case where the actual class and the predicted class
      // match. If not so, take the first (actual, predicted) pair and add it to the
      // confusion matrix

      cluster1 = -1;
      cluster2 = -1;
      for(i = 0; i < clusters1.size(); i++){
	for(j = 0; j < clusters2.size(); j++){
	  if(clusters1[i] == clusters2[j]){
	    cluster1 = clusters1[i];
	    cluster2 = clusters2[j];
	    break;
	  }
	}
      }

      if(cluster1 == -1 && cluster2 == -1){
	cluster1 = clusters1[0];
	cluster2 = clusters2[0];
      }

      if(cluster1 >= MAXCLUSTERS || cluster2 >= MAXCLUSTERS){
	cout << "Warning: The maximal size of the confusion matrix is " << MAXCLUSTERS << "^2." << endl;
	continue;
      }

      confusionMatrix[cluster1][cluster2]++;
    }

    ifile2.close();

    if(numberOfTuples == 0){
      cout << "No tuples in the confusion files.\n" << endl;
      exit(1);
    }

    cout << "\\begin{table}" << endl;
    cout << "  \\begin{center}" << endl;
    cout << "    \\begin{tabular}";

    for(j = 1; j <= maxDim2+1; j++){
      if(j == 1){
	cout << "{c";
      }
      else if(j == maxDim2+1){
	cout << "|c}";
      }
      else{
	cout << "|c";
      }
    }
    cout << endl;
   
    for(j = 1; j<= maxDim2; j++){
      if(j == 1){
	cout << " & None ";
      }
      else{
	cout << " & $C_" << j-1 << "$";
      }
    }
    cout << " \\\\" << endl << "\\hline" << endl;


    for(i = 1; i <= maxDim1; i++){
      if(i == 1){
	cout << " None ";
      }
      else{
	cout << "$C_" << i-1 << "$ ";
      }
      for(j = 1; j <= maxDim2; j++){
	printf("& %.1f\\%% ", 100 * (double)confusionMatrix[i][j] / (double)numberOfTuples);
      }
      if(i < maxDim1){
	cout << "\\\\" << endl << "\\hline" << endl;
      }
      else{
	cout << endl;
      }
    }

    cout << "    \\end{tabular}" << endl;
    cout << "  \\end{center}" << endl;
    cout << "  \\caption{Confusion Matrix}" << endl;
    cout << "\\end{table}" << endl;
    
    

    break;
 
  default:
    break;
  }

  ifile.close();

  return 0;

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av网站免费观看| 亚洲日本成人在线观看| 美女视频一区在线观看| 欧美精品在线一区二区三区| 国产99精品视频| 国产色婷婷亚洲99精品小说| 国产精品亚洲综合一区在线观看| 久久久久久免费网| www.爱久久.com| 亚洲三级电影全部在线观看高清| 在线免费观看日本一区| 日韩在线一区二区| 久久久天堂av| 91在线观看成人| 日韩精品成人一区二区在线| 欧美xxxxx裸体时装秀| 国产99久久久国产精品潘金| 亚洲精品国产成人久久av盗摄 | 亚洲品质自拍视频网站| 色哟哟在线观看一区二区三区| 亚洲国产精品嫩草影院| 欧美电影免费观看高清完整版在线| 国产成人一级电影| 亚洲三级久久久| 日韩欧美国产成人一区二区| av激情成人网| 日本伊人精品一区二区三区观看方式 | 懂色av一区二区三区蜜臀| 国产精品久久毛片av大全日韩| 欧美这里有精品| 国内一区二区在线| 亚洲精品v日韩精品| 日韩美女主播在线视频一区二区三区| 国产丶欧美丶日本不卡视频| 亚洲资源中文字幕| 欧美精品一区二区三区蜜臀 | 日韩精品成人一区二区三区| 国产亚洲一本大道中文在线| 欧美偷拍一区二区| 国产成人久久精品77777最新版本| 一二三区精品视频| 国产日韩精品视频一区| 欧美日韩日本视频| av成人免费在线观看| 精油按摩中文字幕久久| 亚洲一级片在线观看| 国产三级一区二区三区| 91精品国产综合久久精品图片| 97久久久精品综合88久久| 精品影院一区二区久久久| 一区二区三区毛片| 国产精品久久久久aaaa| 精品入口麻豆88视频| 欧美视频一区二区三区在线观看| 国产成人午夜99999| 日本视频一区二区三区| 亚洲综合无码一区二区| 国产精品乱码人人做人人爱| 精品国产百合女同互慰| 日韩一级欧美一级| 欧美日韩高清影院| 在线观看视频一区二区| 91亚洲精华国产精华精华液| 国产福利电影一区二区三区| 久久国产精品免费| 日本aⅴ免费视频一区二区三区 | 欧美视频一二三区| 91网站黄www| www.成人在线| 不卡大黄网站免费看| 国产成人综合在线播放| 精品一区二区免费视频| 美女被吸乳得到大胸91| 美女www一区二区| 免费在线成人网| 老司机精品视频导航| 色av综合在线| 91麻豆蜜桃一区二区三区| a在线播放不卡| 91色婷婷久久久久合中文| 99久久久免费精品国产一区二区| 不卡影院免费观看| av网站一区二区三区| 99re热视频这里只精品| 91蝌蚪国产九色| 欧美亚洲综合色| 欧美精品第一页| 日韩欧美在线影院| 久久久久久毛片| 国产精品久久夜| 亚洲影院久久精品| 日韩高清在线一区| 老司机精品视频在线| 国产传媒欧美日韩成人| www.一区二区| 欧美亚洲综合在线| 337p亚洲精品色噜噜狠狠| 欧美一卡在线观看| 久久久精品蜜桃| 自拍偷拍亚洲激情| 亚洲成a人片在线不卡一二三区| 日韩高清不卡一区二区三区| 免费一级片91| 成人综合在线观看| 欧美午夜精品久久久| 777午夜精品视频在线播放| 精品sm在线观看| 自拍偷拍欧美激情| 亚洲不卡av一区二区三区| 精品一区二区在线免费观看| 国产精品18久久久久久久久| 91蜜桃在线免费视频| 欧美一区二区三区免费大片| 久久久久久久久蜜桃| 亚洲一区二区三区小说| 狠狠色综合播放一区二区| 99热99精品| 日韩欧美一区二区免费| 国产精品白丝在线| 免费成人结看片| 91亚洲大成网污www| 欧美大片一区二区| 亚洲婷婷在线视频| 欧美视频一二三区| 久久综合狠狠综合久久激情| 亚洲婷婷综合色高清在线| 久久精品国产网站| 91免费看`日韩一区二区| 精品免费视频一区二区| 一区二区三区av电影 | 五月婷婷久久丁香| 国产精品一二三区在线| 欧美视频一区在线| 国产无遮挡一区二区三区毛片日本| 亚洲伊人色欲综合网| 国产激情精品久久久第一区二区| 欧美亚洲一区二区在线观看| 国产亚洲欧美日韩俺去了| 日本 国产 欧美色综合| 91麻豆高清视频| 国产精品久久久久永久免费观看 | 日韩欧美成人一区| 一区二区激情视频| 成人av电影在线| 精品国精品自拍自在线| 午夜一区二区三区视频| 99久久精品国产观看| 国产色一区二区| 国产一区二区三区最好精华液| 欧美日韩免费电影| 亚洲尤物视频在线| 91色porny蝌蚪| 中文字幕在线一区| 国产成人免费在线视频| 精品精品国产高清a毛片牛牛 | 99久久久国产精品| 久久久久久影视| 精品一区二区三区在线视频| 欧美精品一二三区| 爽好多水快深点欧美视频| 欧亚洲嫩模精品一区三区| 亚洲日本va午夜在线电影| av中文字幕在线不卡| 国产精品入口麻豆九色| 床上的激情91.| 精品写真视频在线观看 | 91福利资源站| 亚洲色图制服丝袜| 91丨porny丨蝌蚪视频| 成人欧美一区二区三区在线播放| 成人午夜视频网站| 国产精品久久久久久久久免费桃花 | 国产精品国产三级国产三级人妇| 国产精品综合在线视频| 久久久蜜桃精品| 成人夜色视频网站在线观看| 亚洲国产精华液网站w| 成年人午夜久久久| 亚洲精品一二三四区| 欧美视频一二三区| 日韩制服丝袜av| 亚洲精品一区二区三区影院| 国产一区二区三区电影在线观看 | 国产a区久久久| 国产精品青草综合久久久久99| 成人爽a毛片一区二区免费| 最新日韩av在线| 在线欧美小视频| 蜜臀久久99精品久久久画质超高清| 日韩精品一区二区三区蜜臀 | jlzzjlzz亚洲女人18| 一区二区三区鲁丝不卡| 欧美一级二级三级乱码| 国产真实精品久久二三区| 国产精品毛片a∨一区二区三区| 91美女视频网站| 免费在线观看一区二区三区| 国产亚洲精品久| 日本高清不卡在线观看| 日本怡春院一区二区|