weka: backwards with delete
paper:
Mark Hall, Eibe Frank: Combining Naive Bayes and Decision Tables. In: Proceedings of the 21st Florida Artificial Intelligence Society Conference (FLAIRS)
?
?
code:
// best_group初始包含所有屬性 // main search loopboolean done = false;boolean addone = false;boolean z;boolean deleted = false;while (!done) {temp_group = (BitSet)best_group.clone();temp_best = best_merit;done = true;addone = false;for (i = 0; i < numAttribs;i++) {z = ((i != classIndex) && (temp_group.get(i)));if (z) {temp_group.clear(i);//TODO 核心在這。。如果數據樣本中不包含屬性i時,待測屬性集的評價分高于數據樣本中包含屬性i時待測屬性集的評價分, 則從“數據樣本”中永久性刪除該屬性(實際上是在評價時忽略該屬性)temp_merit = ((SubsetEvaluator)eval).evaluateSubset(temp_group);temp_merit_delete = ((EvalWithDelete)eval).evaluateSubsetDelete(temp_group, i);boolean deleteBetter = false;if (temp_merit_delete >= temp_merit) {temp_merit = temp_merit_delete;deleteBetter = true; //標記為刪除可能會好點, 具體刪除的更多限制條件在后面。。}z = (temp_merit >= temp_best); if (z) { //還要高于當前最佳temp_best = temp_merit;temp_index = i;addone = true;done = false;if (deleteBetter) {deleted = true;} else {deleted = false;}}// unset this addition/deletiontemp_group.set(i);}// end if(z)}//end for(i=0;if (addone) { //如果刪除該屬性后的評價分比不刪除的要高、且高于當前最高評價, 則刪除該屬性://從best_group中永久性刪除, 從數據樣本中永久性刪除best_group.clear(temp_index);best_merit = temp_best;if (deleted) {((EvalWithDelete)eval).getDeletedList().set(temp_index);}}}// end while(!done)return attributeList(best_group);
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的weka: backwards with delete的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: weka: best first sea
- 下一篇: weka: exhaustive sea