The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Java application not printing output for RapidMiner Process"
I have created one association rule mining process in RapidMiner and calling it from JAVA application.. But, it's not printing any output..But, it's showing "Process finished successfully after 0 s"...
This is what showing in console:
And my java code looks like this:
Help is highly appreciated....
This is what showing in console:
Apr 27, 2015 11:01:56 PM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Apr 27, 2015 11:01:56 PM com.rapidminer.tools.PlatformUtilities logInfo
INFO: rapidminer.home is 'C:\Program Files\RapidMiner\RapidMiner Studio'.
Apr 27, 2015 11:01:57 PM com.rapidminer.license.ProductConstraintManager initialize
INFO: Initializing license manager.
Apr 27, 2015 11:01:57 PM com.rapidminer.license.ProductConstraintManager initialize
INFO: Using default license location.
Apr 27, 2015 11:01:57 PM com.rapidminer.license.ProductConstraintManager initialize
INFO: Registering default product.
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Cloud Connectivity
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Cloud Execution
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Data Editor
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Operator Recommender
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Process Scheduling
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Social Media
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Text Processing
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.config.ConfigurationManager register
INFO: Registered configurator Salesforce Connection.
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.config.ConfigurationManager register
INFO: Registered configurator Amazon S3 Connection.
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.config.ConfigurationManager register
INFO: Registered configurator Dropbox Connection.
Apr 27, 2015 11:01:58 PM com.rapidminer.tools.config.ConfigurationManager register
INFO: Registered configurator Twitter Connection.
Apr 27, 2015 11:01:59 PM com.rapidminer.tools.expression.parser.ExpressionParserFactory <clinit>
INFO: Default version of expression parser registered successfully
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver com.mysql.jdbc.Driver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver org.postgresql.Driver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver net.sourceforge.jtds.jdbc.Driver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver org.hsqldb.jdbcDriver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver net.sourceforge.jtds.jdbc.Driver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver com.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver oracle.jdbc.driver.OracleDriver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver com.microsoft.sqlserver.jdbc.SQLServerDriver not found. Probably the driver is not installed.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Load configuration for Amazon S3 Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ClientConfigurationManager loadAllParameters
INFO: No configuration file found for Amazon S3 Connection
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Loaded configurations for 0 objects of type Amazon S3 Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Load configuration for Dropbox Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ClientConfigurationManager loadAllParameters
INFO: No configuration file found for Dropbox Connection
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Loaded configurations for 0 objects of type Dropbox Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Load configuration for Salesforce Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ClientConfigurationManager loadAllParameters
INFO: No configuration file found for Salesforce Connection
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Loaded configurations for 0 objects of type Salesforce Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Load configuration for Twitter Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ClientConfigurationManager loadAllParameters
INFO: No configuration file found for Twitter Connection
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.config.ConfigurationManager loadConfiguration
INFO: Loaded configurations for 0 objects of type Twitter Connection.
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Apr 27, 2015 11:02:02 PM com.rapidminer.Process run
INFO: Process C:\Users\anik1\.RapidMiner\repositories\NewLocalRepository\R.rmp starts
Apr 27, 2015 11:02:02 PM com.rapidminer.Process run
INFO: Process C:\Users\anik1\.RapidMiner\repositories\NewLocalRepository\R.rmp finished successfully after 0 s
Apr 27, 2015 11:02:02 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Apr 27, 2015 11:02:02 PM com.rapidminer.Process run
INFO: Process C:\Users\anik1\.RapidMiner\repositories\NewLocalRepository\R.rmp starts
Apr 27, 2015 11:02:02 PM com.rapidminer.Process run
INFO: Process C:\Users\anik1\.RapidMiner\repositories\NewLocalRepository\R.rmp finished successfully after 0 s
And my java code looks like this:
import com.rapidminer.Process;Can anyone please solve this issue? ???
import com.rapidminer.RapidMiner;
import com.rapidminer.RepositoryProcessLocation;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.io.ExcelExampleSource;
import com.rapidminer.repository.RepositoryLocation;
import com.rapidminer.tools.XMLException;
import com.rapidminer.example.Attribute;
import com.rapidminer.RapidMiner;
import com.rapidminer.Process;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.Example;
import com.rapidminer.example.ExampleSet;
import com.rapidminer.operator.IOContainer;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorException;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import com.rapidminer.operator.io.ExcelExampleSource;
import com.rapidminer.tools.XMLException;
import java.io.File;
import java.io.IOException;
import java.lang.Object;
import java.io.File;
import com.rapidminer.RapidMiner.ExecutionMode;
import com.rapidminer.example.Attributes;
import com.rapidminer.example.Example;
import com.rapidminer.example.ExampleSet;
import com.rapidminer.example.set.SimpleExampleSet;
import com.rapidminer.operator.IOContainer;
import com.rapidminer.operator.IOObject;
import com.rapidminer.repository.IOObjectEntry;
import com.rapidminer.operator.ModelApplier;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.io.ModelLoader;
import com.rapidminer.tools.OperatorService;
public class Classification {
public static void main(String[] args) throws Exception {
ExampleSet resultSet1 = null;
//IOContainer ioInput = null;
//IOContainer ioResult = null;
try{
// Init RapidMiner
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
// Path to process-definition
String pr = "C:\\Users\\anik1\\.RapidMiner\\repositories\\NewLocalRepository\\R.rmp";
// Load process
com.rapidminer.Process process = new com.rapidminer.Process(new File(pr));
process.run();
IOContainer ioResult = process.run();
if (ioResult.getElementAt(0) instanceof ExampleSet) {
ExampleSet resultSet = (ExampleSet) ioResult.getElementAt(0);
for (Example example : resultSet) {
Iterator<Attribute> allAtts = example.getAttributes().allAttributes();
while (allAtts.hasNext()) {
Attribute a = allAtts.next();
if (a.isNumerical()) {
double value = example.getValue(a);
System.out.print(value + " ");
} else {
String value = example.getNominalValue(a);
System.out.print(value + " ");
}
}
System.out.println("\n");
}
}
//System.out.println(process.run());
}catch (IOException | XMLException | OperatorException ex){
ex.printStackTrace();
}
}
}
Help is highly appreciated....
0
Answers
1) You are running the process twice, the first time you are ignoring the output ports. Doesn't break anything, just wanted to mention it.
2) You have not posted the process XML, so I can only guess. Either you have not connected the last operator to the process output ports (top right corner of the process) or your output is NOT an ExampleSet.
Regards,
Marco
But, I am getting output in RapidMiner..
Actually I am very new in RapidMiner.. First time I am using this..
As developing all the algorithms in time consuming and tough in JAVA.. That's why I am creating process in RM and calling it in JAVA..
I am attaching the XML code below.. Could you please help me now?
you are returning association rules, not an example set. As you can see in your code, only if the returned result matches an ExampleSet something is done.
Have a look at the package "com.rapidminer.gui.viewer". There are various GUI classes which display different IOObjects in RapidMiner Studio. For example, an AssociationRuleTableVieweris in there. Have a look at where the constructors are called for these GUI objects, then you will find the actual IOObject implementations. Then you can cast your IOObject results of your process to the appropriate classes and work with them. By looking at the GUI classes you can get a first impression of what information you can display.
Regards,
Marco
You can try the below code to print out the association rules
Cheers