RapidMiner/Netbeans problem.
Hi,
I am working on text classification project, I was trying to integrate the model I built in Rapidminer GUI but I have problems in the code which I couldn't solve to move on!
- I'm using rapid miner 5.3.015
- I added all rapid miner jars to the netbean project
- I am beginner user.
- here is my xml file:
Following the API documentation:
So, I couldn't figure where is the problem exactly!
另一项试验这个线程:http://rapid-i.com/rapidforum/index.php/topic,3862.msg14364.html#msg14364
So, any idea how to solve this problem?
Thanks in advance
I am working on text classification project, I was trying to integrate the model I built in Rapidminer GUI but I have problems in the code which I couldn't solve to move on!
- I'm using rapid miner 5.3.015
- I added all rapid miner jars to the netbean project
- I am beginner user.
- here is my xml file:
and here is my initial trials:
<运营商激活= " true "类= compati“过程”bility="5.3.015" expanded="true" name="Process">
Following the API documentation:
public static void main(String[] args) {In this code there is no editor errors but it showed me this error: com.rapidminer.parameter.UndefinedParameterError: A value for the parameter 'operatorName' must be specified!
try {
RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
RapidMiner.init();
Process process = new Process(new File("W:/RapidMinerRepository/textKNNClassifier.rmp"));
process.run();
} catch (IOException | XMLException | OperatorException ex) {
ex.printStackTrace();
}
}
So, I couldn't figure where is the problem exactly!
另一项试验这个线程:http://rapid-i.com/rapidforum/index.php/topic,3862.msg14364.html#msg14364
public static void main(String[] args) throws MalformedRepositoryLocationException, RepositoryException {errors shown by netbean editor are for words creating Process object and calling run() method
// this initializes RapidMiner with your repositories available
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
// loads the process from the repository
RepositoryLocation pLoc = new RepositoryLocation("W:/RapidMinerRepository/textKNNClassifier.rmp");
ProcessEntry pEntry = (ProcessEntry) pLoc.locateEntry();
String processXML = pEntry.retrieveXML();
Process myProcess = new Process(processXML); //error
// execute the process and get the resulting objects
IOContainer ioInput = new IOContainer(new IOObject[] {myIOObject});
myProcess.run(); //error
}
So, any idea how to solve this problem?
Thanks in advance
Tagged:
0
Answers
in the thread you mention, Marco has given you an example on how to load the process via the RepositoryLocation. In your third code block you are using it incorrectly since you are not referncing a repository entry (starting with "//"), but a file.
For the second code block it would make sense to paste the stack trace. Looks like the parameter "operatorName" is not set in the process, but that parameter does not follow naming conventions, so I suspect a copy paste problem.
Cheers,
Simon
a couple of things:
1) new RepositoryLocation("W:/RapidMinerRepository/textKNNClassifier.rmp"); will not work because a repository location is NOT your filesystem, but rather the internal RapidMiner repository. So it should look more like new RepositoryLocation("//Local Repository/textKNNCLassifier").
2) You probably imported java.lang.Process by accident instead of com.rapidminer.Process in your second example.
3) The error you posted is not complete so helping you there is a bit difficult, however most of the time it simply means you did not specifiy a mandatory parameter for one of the operators.
Regards,
Marco
——所以,第一个问题是r的路径epository.
Do you mean it should be inside the workspace>java project?
Sorry but i need more explanation about the difference between "my filesystem" and "internal RapidMiner repository"
- I've double checked the imported lines, but It seems I imported com.rapidminer.Process not java.lang.Process.
- My main problem is how could I figure out what are the operator that I miss naming them or one of their parameters.
here is the code again with the error (I deleted couple of repeated lines since the post is limited to 20000 chars).
Thank you Simon & Marco
I appreciate your help.
Regards,
- When you start the RapidMiner GUI and use store processes or results, you will use a so called repository. The default one is called "Local Repository". These default one is simply located in a folder on your disk, however they can also come from RapidMiner Server etc. That is why RapidMiner Studio makes use of the repository, so no matter where the data is actually stored, there is only a single representation of the storage. You can ask the RepositoryManager class to get existing repositories or create new ones. To access a process called "My Process" in the subfolder "my folder" in your default repository, you would reference it like this: - You can add a breakpoint to the line where the UndefinedParameterError is thrown and check the stacktrace for the operator which caused it.
Regards,
Marco
The idea of repositories is clear, Thanks.
I tried to debug the code and I think (based on my understanding) the problem is with calling init() method.
line 98 in my code is: However, I tried to follow this example provided here:https://rapid-i.com/rapidforum/index.php?topic=2976.0
and the same error has shown again. So, what is the problem in this case? how to know exactly what is operator that I miss naming it?
Thanks,
I have never seen such an error when calling RapidMiner.init(). It looks like com.rapidminer.operator.preprocessing.ie.features.tools.RelationPreprocessOperatorImpl is the cause - however I don't know that class, where does it come from? It definetly is not a standard RapidMiner Studio operator.
Regards,
Marco
How to know from where this strange operator class come?
I don't know, you could try finding out the classloader for the class (i.e. if it is an extension classloader) and go from there..
Regards,
Marco