The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
How should I Create my New Classifier Operator
siamak_want
Member Posts: 98 Contributor II
Hi,
I want to create a new Naive Bayes classifier. So, I have got confused with the following issues:
1- Should I extend Operator class or AbstractLearner class?
2- Should I put my algorithm in dowork() method or in Learn() method?
3- Why does a clustering operator like kmeans directly extend Operator but another clustering operator extends RMAbstractClusterer?
4- What are learners? are they equivalent of classifiers? All of the classifiers should extend Abstract learner?
I am really confused:(
Would you please guide me through making a new classifier operator?
Any help will be appreciated.
I want to create a new Naive Bayes classifier. So, I have got confused with the following issues:
1- Should I extend Operator class or AbstractLearner class?
2- Should I put my algorithm in dowork() method or in Learn() method?
3- Why does a clustering operator like kmeans directly extend Operator but another clustering operator extends RMAbstractClusterer?
4- What are learners? are they equivalent of classifiers? All of the classifiers should extend Abstract learner?
I am really confused:(
Would you please guide me through making a new classifier operator?
Any help will be appreciated.
Tagged:
0
Answers
noone forces you to follow the approach RM uses, but it is strongly recommended.
1 - NaiveBayes and KernelNaiveBayes both extend AbstractLearner, so I suggest you do the same
2 - have a look at the learn(ExampleSet) method of these aforementioned classes
3 - the first 5 clustering operators I checked all extend RMAbstractClusterer
4 - Have a look at the JavaDoc for the AbstractLearner class
Regards,
Marco
Thanks to your guides. But now I have a new issue when I wanted to see my new operator in RM GUI. I added my new operator to Operators.XML file located in resources folder. Now, when I start off the GUI, RM says something like: "no valid XML". My added code in operatorsXML is:
<operator>
<key>MyOp</key>
<class>my.myop</class>
</operator>
well I can't help you there, looks like you have messed something up in the file. But I encourage you to take a look at this thread (click), as that is a much better way of adding something to RapidMiner. Editing the RM sourcecode directly is not a good idea because if you add something to the RM Core, it may get overwritten or create a conflict if we update RapidMiner sources ourselves - and we work on the RM sources on a daily basis.
Regards,
Marco
1- It was really helpful. By the way, If the right way to extend rapidminer is plugin, why hadn't the RM developers used this approach for LibSVM component?! (They have insert the Libsvm code directly in RM code!)
2- As far as I understood from your guides, I should write my own "learning algorithm" in Learn() method and then set the PredictionAttribute in Model class. Am i right? I mean Is it a standard way for creating my new classifier?
Thanks in advance.
the LibSVM Operator is no plugin because it has been developed - as you have stated - by the RM developers. Only they are allowed to change the RM core and the LibSVM Operator is part of the RM core.
Developing plugins is a good opportunity for other developers (like you) to extend RapidMiner without touching the core of RM.
Your approach to write your own learning algorithm seems to be okay the way you described it.
Best,
Nils