http://liouwei20051000285.blog.163.com/blog/static/2523674201052394826984/
1 在weka中新建一个包,比如建立 报名为"weka.classifiers.myalgorithm"的包.
2 在"weka.classifiers.myalgorithm"包中写好自己的代码,这里方便起见,我直接在"weka.classifiers.trees"包下复制ID3算法的java文件添加到"weka.classifiers.myalgorithm"包中.然后改名字为"MyId3"
3 修改"weka.gui"包下的两个两个配置文件"GenericPropertiesCreator.props"与"GenericObjectEditor.props"
4 在文件"GenericPropertiesCreator.props"中找到"# Lists the Classifiers-Packages I want to choose from"这一项,然后在" weka.classifiers.rules"上一行新增"weka.classifiers.myalgorithm,/"最后保存设置.
5 在文件"GenericObjectEditor.props"中找到"# Lists the Classifiers I want to choose from"这一项,然后在" weka.classifiers.rules.ZeroR"上一行新增" weka.classifiers.myalgorithm.MyId3,/"最后保存设置.
在此之前, 我在网上找到spectral clustering的java code for weka, 已经成功加入到weka中。 但是类的extends, implements似乎有点问题, 无法正常使用spectral clustering