"Questions abour RM DBScan arff in java source"
Hi guys, I'm a Weka User trying to learn how to use rapidminer clustering algorithms in a simple application java.
I want to do a simple process that reads a arff file and use the DBScan. After that, show the results in the console of netbeans.
My code:
Well, that's my questions:
1. How can I print the dbscan output in netbeans console?
2 When I executed the code, this error message was showed:
I want to do a simple process that reads a arff file and use the DBScan. After that, show the results in the console of netbeans.
My code:
package rapidminer;
import com.rapidminer.Process;
import com.rapidminer.RapidMiner;
import com.rapidminer.RapidMiner.ExecutionMode;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorCreationException;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.clustering.clusterer.DBScan;
import com.rapidminer.operator.io.ArffExampleSource;
import com.rapidminer.operator.ports.PortException;
import com.rapidminer.tools.OperatorService;
public class Rapidminer
{
public static Process createProcess() {
try
{
// invoke init before using the OperatorService
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
}
catch (Exception e)
{
e.printStackTrace(System.out);
}
// create process
Process process = new Process();
try
{
// create operator
Operator inputData = OperatorService.createOperator(ArffExampleSource.class);
// set parameters
inputData.setParameter("data_file", "C:/iris.arff");
// Clustering
Operator scan = OperatorService.createOperator(DBScan.class);
scan.setParameter("min_points", Double.toString(5));
scan.setParameter("epsilon", Double.toString(0.1));
// add operator to process
process.getRootOperator().getSubprocess(0).addOperator(inputData);
process.getRootOperator().getSubprocess(0).addOperator(scan);
inputData.getOutputPorts().getPortByName("output").connectTo(scan.getInputPorts().getPortByName("training set"));
}
catch (OperatorCreationException | PortException e)
{
e.printStackTrace(System.out);
}
return process;
}
public static void main(String[] argv)
{
// create process
Process process = createProcess();
// print process setup
System.out.println(process.getRootOperator().createProcessTree(0));
try
{
// perform process
process.run();
}
catch (OperatorException e)
{
e.printStackTrace(System.out);
}
}
}
Well, that's my questions:
1. How can I print the dbscan output in netbeans console?
2 When I executed the code, this error message was showed:
Well, that's newbie questions, but that's my doubts. ;D
com.rapidminer.operator.UserError: No data was delivered at port Clustering.example set (disconnected).
at com.rapidminer.operator.ports.impl.AbstractPort.getData(AbstractPort.java:99)
at com.rapidminer.operator.clustering.clusterer.AbstractClusterer.doWork(AbstractClusterer.java:94)
at com.rapidminer.operator.Operator.execute(Operator.java:855)
at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:379)
at com.rapidminer.operator.Operator.execute(Operator.java:855)
at com.rapidminer.Process.run(Process.java:949)
at com.rapidminer.Process.run(Process.java:873)
at com.rapidminer.Process.run(Process.java:832)
at com.rapidminer.Process.run(Process.java:827)
at com.rapidminer.Process.run(Process.java:817)
at rapidminer.Rapidminer.main(Rapidminer.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.javafx.main.Main.launchApp(Main.java:658)
at com.javafx.main.Main.main(Main.java:805)
Find more posts tagged with
Sort by:
1 - 5 of
51

More or Less I did the process in the rapidminer software:
I would like to take this idea to the java code. :-\Hello, it seems you have to connect to the ports. This thread gives an example how to do it.
Most probably you will need to iterate through the exampleset, here is an example.
Hope this helps, gabor
Most probably you will need to iterate through the exampleset, here is an example.
Hope this helps, gabor
Ah, sorry, I had the impression you want to create the process on demand not load it. For loading, you can check this code.
Cheers, gabor
Cheers, gabor
Hi,
is there any particular reason why you are trying to create the process by hand instead of using a RapidMiner process you created via the RapidMiner GUI as shown in the READ BEFORE POSTING: Frequently Asked Questions (Development) thread?
Regards,
Marco
is there any particular reason why you are trying to create the process by hand instead of using a RapidMiner process you created via the RapidMiner GUI as shown in the READ BEFORE POSTING: Frequently Asked Questions (Development) thread?
Regards,
Marco