1
我想修改Weka中的J48算法是这样的:修改J48算法的Weka
我想改变J48的算法来划分类似于随机森林算法(负责寻找最佳的代码数据拆分节点)。
我该怎么办?我知道,我在随机森林改变C45ModelSelection代码的部分代码:
C45ModelSelection.java
...
// Find "best" attribute to split on.
minResult = 0;
for (i=0;i<data.numAttributes();i++){
if ((i != (data).classIndex()) &&
(currentModel[i].checkModel()))
// Use 1E-3 here to get a closer approximation to the original
// implementation.
if ((currentModel[i].infoGain() >= (averageInfoGain-1E-3)) &&
Utils.gr(currentModel[i].gainRatio(),minResult)){
bestModel = currentModel[i];
minResult = currentModel[i].gainRatio();
}
}
...