Pages: [1]
  Print  
Author Topic: How should I Create my New Classifier Operator  (Read 365 times)
siamak_want
Newbie
*
Posts: 41


« on: January 25, 2012, 04:56:41 PM »

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.

« Last Edit: January 25, 2012, 05:20:40 PM by siamak_want » Logged
Marco Boeck
Administrator
Sr. Member
*****
Posts: 264


WWW
« Reply #1 on: January 26, 2012, 01:58:47 PM »

Hi,

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
Logged

Did you try our new Marketplace? Upload or download new Extensions, add comments, and organize your operators. Have a look at  http://marketplace.rapid-i.com
siamak_want
Newbie
*
Posts: 41


« Reply #2 on: February 02, 2012, 08:01:06 PM »

Hi 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>
Logged
Marco Boeck
Administrator
Sr. Member
*****
Posts: 264


WWW
« Reply #3 on: February 03, 2012, 02:41:45 PM »

Hi,

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
Logged

Did you try our new Marketplace? Upload or download new Extensions, add comments, and organize your operators. Have a look at  http://marketplace.rapid-i.com
siamak_want
Newbie
*
Posts: 41


« Reply #4 on: February 05, 2012, 01:18:27 PM »

Thanks Marco, I studied the thread you mentioned. Now there is two key questions:

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.
« Last Edit: February 05, 2012, 02:49:15 PM by siamak_want » Logged
Nils
Administrator
Full Member
*****
Posts: 108


« Reply #5 on: February 06, 2012, 02:55:20 PM »

Hi,

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
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
siamak_want
Newbie
*
Posts: 41


« Reply #6 on: February 07, 2012, 12:34:18 PM »

Thanks a lot Nils. I thought that LibSVM is an external third party wich has been used by RM developers. This was due to the fact that I saw a class named JMySVMLearner class too. Anyway thanks your guide.
Logged
Pages: [1]
  Print  
 
Jump to: