RapidMiner

How to use a trained classification model of RapidMIner in my Java application?

Regular Contributor

Re: How to use a trained classification model of RapidMIner in my Java application?

Ooops, my fault! Smiley Happy
I just tried to give the path from the code, but again NPE. As I understood, I have to remove the file name from ReadExcel operator in RapidMiner and give the path as a parameter in my code, am I right? So, this part looks like this:


operator.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "HaendlerRatings_neu.xls");


Thanks for your support!

Best regards
Armen
Regular Contributor

Re: How to use a trained classification model of RapidMIner in my Java application?

Hi,

I'm giving the parameters for the ReadExcel operator, but stil getting an error:

A value for the parameter 'excel_file' must be specified! 


This is the corresponding part of the code:

		
                operator.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "C:\\Users\\MP-TEST\\Desktop\\Rapid_Test\\HaendlerRatings_neu.xls");
operator.setParameter(ExcelExampleSource.PARAMETER_IMPORTED_CELL_RANGE, "A1:A2000");
operator.setParameter(ExcelExampleSource.PARAMETER_ID_COLUMN, "0");
operator.setParameter(ExcelExampleSource.PARAMETER_SHEET_NUMBER, "1");
operator.setParameter(ExcelExampleSource.PARAMETER_DATAMANAGEMENT, "double_array");
operator.setParameter(ExcelExampleSource.PARAMETER_TIME_ZONE, "SYSTEM");
 

Best regards
Armen
RMStaff

Re: How to use a trained classification model of RapidMIner in my Java application?

Hi,

works fine for me. Make sure you are
a) using the import "com.rapidminer.operator.nio.ExcelExampleSource" and not the other ExcelExampleSource from the deprecated operator.io package and
b) setting the parameter on the correct operator

// replace "Read Excel" with the name the Read Excel operator has in your process
process.getOperator("Read Excel").setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "C:\\Users\\username\\Desktop\\2.xls");


Regards,
Marco
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH
Regular Contributor

Re: How to use a trained classification model of RapidMIner in my Java application?

Thanks!
Works fine, the name of my operator was "Read Excel (2)", because I had another one, but deactivated. Smiley Happy
Regular Contributor

Re: How to use a trained classification model of RapidMIner in my Java application?

How to use this approach with a collection text files instead of Excel files?
If we have a trained model and we need to classify a new unseen text document,
What is the operator to be used in Rapid-miner GUI?
RMStaff

Re: How to use a trained classification model of RapidMIner in my Java application?

Hi,

the "Process Documents from Files" operator should help you with that. It can read all text files from a foalder and create documents out of them.

Regards,
Marco
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH
Regular Contributor

Re: How to use a trained classification model of RapidMIner in my Java application?

Thank, i managed this process in Rapid-miner GUI know (Y)!
Contributor II

Re: How to use a trained classification model of RapidMIner in my Java application?

Hi,

Unfortunately, the link is broken, and I could not open the page you referred to.

 

Thanks,

 

Highlighted
Community Manager

Re: How to use a trained classification model of RapidMIner in my Java application?

hi @Pirehelokan - this is an old thread.  Which link are you referring to?

 

Scott

Scott Genzer
Senior Community Manager
RapidMiner, Inc.