编辑“
How to Add Your Own Custom Classifier to Weka
”
跳到导航
跳到搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
Adding your own custom classifier to Weka can be done in a few simple steps. Here's a general outline: 1. Write your classifier code: You can write your classifier code in any programming language that supports the Java Virtual Machine (JVM), as Weka is built in Java. Your classifier should implement the Weka `Classifier` interface, which requires you to implement a few key methods, such as `buildClassifier`, `classifyInstance`, and `toString`. 2. Compile your code: Once you have written your classifier code, you'll need to compile it into a Java class file. You can do this using any Java compiler, such as `javac` or an integrated development environment (IDE) like Eclipse or IntelliJ. 3. Create a new package for your classifier: Weka organizes classifiers into packages, which are essentially Java packages that contain the classifier code and any necessary resources (e.g., models, data files). You can create a new package for your classifier by creating a new Java package in Weka's source code directory (usually called `src`) and putting your classifier code and resources there. 4. Register your classifier: Weka uses a service provider interface (SPI) to discover and load classifiers at runtime. To register your classifier with Weka, you need to create a file called `weka.classifiers.Classifier` in your package's `META-INF/services` directory. This file should contain the fully qualified name of your classifier class (e.g., `com.example.MyClassifier`). 5. Build Weka: After you have registered your classifier, you'll need to rebuild Weka to include your classifier in the distribution. You can do this by running the `ant` build script in Weka's root directory. 6. Test your classifier: Once you have rebuilt Weka, you can test your classifier by running Weka and selecting your classifier from the list of available classifiers. You can also use Weka's command line interface to test your classifier on a dataset. That's it! With these steps, you should be able to add your own custom classifier to Weka.
摘要:
请注意,您对freem的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Freem:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
页面
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
编辑源代码
查看历史
更多
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息