RapidMiner

RapidMiner

"Hello World" Plugin

Contributor II

"Hello World" Plugin

Hello, I'm new here in the RapidMinner Community. I'm starting to develop a new open source clustering plugin for rapid miner. I followed the steps from the manual but I'm having some problems to create my first plugin.  :'(
I got a plugin from the web site, changed the manifest attributes and the operators.xml, and I created a new class extendind the  "AbstractFlatClusterer", and put all these stuff in jar file. At the end I put the jar file in the plugins directory.
My about scren apeared in the Help menu, but the plugin didn't show up in the Clustering operators folder in Rapid Miner GUI.
What Did I do wrong?
Here are the sttuf I wrote:

ABOUT.NFO:
Teste

MANIFEST.MF:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.5.0_16-b02 (Sun Microsystems Inc.)
Implementation-Vendor: Rapid-I
Implementation-Title: Teste
Implementation-URL: http://www.rapid-i.com
Implementation-Version: 4.2
RapidMiner-Version: 4.2
RapidMiner-Type: RapidMiner_Plugin

operators.xml:
<operators>

  operator
    name        = "Teste"       
    class      = "com.rapidminer.operator.learner.clustering.clusterer.TesteTacioCluster"
    description = "teste"
    group      = "Learner.Unsupervised.Clustering"/>

</operators>

TesteTacioCluster.java:
package com.rapidminer.operator.learner.clustering.clusterer;

import com.rapidminer.example.ExampleSet;
import com.rapidminer.operator.OperatorDescription;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.learner.clustering.ClusterModel;
import com.rapidminer.operator.learner.clustering.FlatCrispClusterModel;


public class TesteTacioCluster extends AbstractFlatClusterer
{

public TesteTacioCluster(OperatorDescription description)
{
super(description);
// TODO Auto-generated constructor stub
}

@Override
public ClusterModel createClusterModel(ExampleSet exampleSet)
throws OperatorException
{
// TODO Auto-generated method stub
return new FlatCrispClusterModel();
}

@Override
public boolean isFlatClusterer()
{
// TODO Auto-generated method stub
return false;
}

}

Thanks in advance for any help.
8 REPLIES
Moderator

Re: "Hello World" Plugin

Hi Tacio,

you mean that no operator [tt]Teste[/tt] appeared in the operator group [tt]Leaner.Unsupervised.Clustering[/tt]?

May I ask you, why you want to implement a new clustering plugin? Are there any clustering approaches you especially miss? The reason why I am asking is that we are currently revising the complete bunch of clustering approaches in RapidMiner which seem to result in at least a partial re-implementation. This will on the one hand increase the performance, on the other hand certainly crucially change the program structures concerning the clustering parts which might then lead to problems when you implement a plugin on the basis of the soon deprecated code.

Regards,
Tobias
Contributor II

Re: "Hello World" Plugin

Hi Mr. Tobias, the operator "Teste" didn't appear in the operator group "Leaner.Unsupervised.Clustering", but there is a "About Teste..." menu item in the "Help" Menu. I didn't understand why it's happened.

About yours questions:

Sure, you may ask.  Smiley Happy
Well, I want to implement a new clustering plugin because my master thesis is about spatial clustering, so I'm planning to implement some spatial clustering algorithms (like CLARANS or BIRCH for example) in order to make a comparison about their results, since I didn't find these clustering algorithms implemented in any free software.

Regards,
Tacio
Moderator

Re: "Hello World" Plugin

Hi,

did maybe a line such as the following show up in the console when you started RapidMiner?

G Aug 27, 2008 4:09:16 PM: [Error] Cannot register 'TesteTacioCluster': java.lang.ClassNotFoundException: com.rapidminer.operator.learner.clustering.clusterer.TesteTacioCluster


Well, maybe these clustering algorithms may be interesting for us or the RapidMiner community as well and you would like to think about contributing them?! Smiley Wink

Regards,
Tobias
Contributor II

Re: "Hello World" Plugin

No, this line didn't appeared here. The log from the console is below.
And I will contribute with these plugins for sure. As son as a finish one them, I may upload it. But how can you see, I'm just in the begining. I would appreciate any help, too. Smiley Wink

The jar with the plugin is "teste.jar".
Here is the log:
RAPIDMINER_HOME is not set. Trying the directory 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..'...

Using local jre: C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..\jre\bin\java.exe...
Starting RapidMiner from 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..' using classes from 'C:\Arq
uivos de programas\Rapid\RapidMiner-4.2\scripts\..\lib\rapidminer.jar'...
G Aug 27, 2008 11:54:21 AM: rapidminer.home is 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..'.
G Aug 27, 2008 11:54:21 AM: Loading operators from 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..\l
ib\plugins\teste.jar'.
G Aug 27, 2008 11:54:21 AM: ----------------------------------------------------
G Aug 27, 2008 11:54:21 AM: Initialization Settings
G Aug 27, 2008 11:54:21 AM: ----------------------------------------------------
G Aug 27, 2008 11:54:21 AM: Default system encoding for IO: windows-1252
G Aug 27, 2008 11:54:21 AM: Load core operators...
G Aug 27, 2008 11:54:21 AM: Load Weka operators: true
G Aug 27, 2008 11:54:21 AM: Load JDBC drivers from lib directory: true
G Aug 27, 2008 11:54:21 AM: Load JDBC drivers from classpath: false
G Aug 27, 2008 11:54:21 AM: Load plugins: true
G Aug 27, 2008 11:54:21 AM: Load plugins from 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..\lib\pl
ugins'
G Aug 27, 2008 11:54:21 AM: ----------------------------------------------------
G Aug 27, 2008 11:54:21 AM: Read rcfile 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..\etc\rapidmin
errc'.
G Aug 27, 2008 11:54:21 AM: Trying rcfile 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\..\etc\rapidm
inerrc.Windows XP'...skipped
G Aug 27, 2008 11:54:21 AM: Trying rcfile 'C:\Documents and Settings\Tßcio Vinicius\.rapidminer\4_2_0_rapidmin
errc'...skipped
G Aug 27, 2008 11:54:21 AM: Read rcfile 'C:\Documents and Settings\Tßcio Vinicius\.rapidminer\4_2_0_rapidminer
rc.Windows XP'.
G Aug 27, 2008 11:54:21 AM: Trying rcfile 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\rapidminerrc'
...skipped
G Aug 27, 2008 11:54:21 AM: Trying rcfile 'C:\Arquivos de programas\Rapid\RapidMiner-4.2\scripts\rapidminerrc.
Windows XP'...skipped
G Aug 27, 2008 11:54:21 AM: Trying rapidminer.rcfile. Property not specified...skipped
G Aug 27, 2008 11:54:21 AM: Loading operators from 'operators.xml'.
G Aug 27, 2008 11:54:26 AM: Loading JDBC driver information from 'etc:jdbc_properties.xml'.
-------------------------------------------------------------------------------------------------------------------------------------------

Re: "Hello World" Plugin

Hello,

may it be that your operators.xml does not contain an opening branch "<" before "operator" in line 3?
I found out that even the smallest errors in operators.xml lead to a total ignorance of your plugin by rapidminer.

Greets, Pascal
Moderator

Re: "Hello World" Plugin

Hi,

this indeed might be the problem combined with the fact, that there is only one operator is present in Tacios operators.xml. If there is an improper operator tag in an operators.xml where there are more operators, at least some class not found errors appear. As a consequence, we should add an error message in the case the operators.xml of a plugin can not be properly read, if this is technically feasible (which I have not checked yet).

Regards,
Tobias
Contributor II

Re: "Hello World" Plugin

Yeah! I was only missing a "<". Now it's working. Thanks for the help.  ;D
Contributor II

Re: "Hello World" Plugin

Just closing the topic... My "Hello world" plugin became the "Clarans" plugin. As I promised, I sent it to the Rapid Miner staff using the "feature request tracker". If anyone has any observation about this plugin, get in contact with me.  Smiley Wink

Thanks for Helping.