"less than '
Jacksonhi
New Altair Community Member
I have this and want to translate to java (below) but this does not seem to work (bottom.
<operator name="Root" class="Process">
<parameter key="logfile" value="run.log"/>
<description text="Using a simple Naive Bayes classifier."/>
<operator name="Input" class="DatabaseExampleSource">
<parameter key="database_url" value="jdbc:mysql://192.168.0.15:3306/ctl"/>
<parameter key="id_attribute" value="sl3"/>
<parameter key="id_attribute" value="sl5"/>
<parameter key="id_attribute" value="sl8"/>
<parameter key="id_attribute" value="sl13"/>
<parameter key="id_attribute" value="mvv"/>
<parameter key="id_attribute" value="hl"/>
<parameter key="id_attribute" value="mvp"/>
<parameter key="label_attribute" value="RNK"/>
<parameter key="query" value="SELECT * FROM training where inc < 250"/>
<parameter key="username" value="ibt"/>
<parameter key="password" value="88bitz"/>
</operator>
<operator name="NaiveBayes" class="NaiveBayes">
</operator>
<operator name="ModelWriter" class="ModelWriter">
<parameter key="model_file" value="newGoog.mod"/>
</operator>
</operator>
package scratch;
//import java.io.File;
//import com.rapidminer.Process;
//import com.rapidminer.RapidMiner;
//import com.rapidminer.operator.*;
import java.io.File;
import com.rapidminer.Process;
import com.rapidminer.RapidMiner;
import com.rapidminer.operator.*;
//import com.rapidminer.*;
//import com.rapidminer.operator.reducer.PorterStemmer;
//import com.rapidminer.operator.tokenizer.SimpleTokenizer;
//import com.rapidminer.operator.wordfilter.EnglishStopwordFilter;
import com.rapidminer.tools.OperatorService;
/**
*
* @author ats
*/
public class executeXMLModel {
public static void main(String[] argv) throws Exception {
// set properties to point to plugin directory
String pluginDirString = new File("/home/ats/machineLearning/rapidminer-4.6/lib/plugins").getAbsolutePath();
System.setProperty(RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION, pluginDirString);
// set properties - rapid miner home
String path = "/home/ats/machineLearning/rapidminer-4.6/";
System.setProperty("rapidminer.home", path);
RapidMiner.init();
Process root = new Process();
Operator inputOperator;
inputOperator = OperatorService.createOperator("DatabaseExampleSource");
inputOperator.setParameter("database_url", "jdbc:mysql://192.168.0.15:3306/ctl");
inputOperator.setParameter("id_attribute", "sl3");
inputOperator.setParameter("id_attribute", "sl5");
inputOperator.setParameter("id_attribute", "sl8");
inputOperator.setParameter("id_attribute", "sl13");
inputOperator.setParameter("id_attribute", "mvv");
inputOperator.setParameter("id_attribute", "hl");
inputOperator.setParameter("id_attribute", "mvp");
inputOperator.setParameter("label_attribute", "RNK");
inputOperator.setParameter("query", "SELECT * FROM training where inc < 250");
inputOperator.setParameter("username", "ibt");
inputOperator.setParameter("password", "88bitz");
root.getRootOperator().addOperator(inputOperator);
Operator NaiveBayes;
NaiveBayes = OperatorService.createOperator("NaiveBayes");
root.getRootOperator().addOperator(NaiveBayes);
Operator ModelWriter;
ModelWriter = OperatorService.createOperator("ModelWriter");
ModelWriter.setParameter("model_file", "/home/ats/rm_workspace/newGoogZZ.mod");
root.getRootOperator().addOperator(ModelWriter);
}
}
run:
G Oct 14, 2009 12:02:20 PM: rapidminer.home is '/home/ats/machineLearning/rapidminer-4.6/'.
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Initialization Settings
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Default system encoding for IO: UTF-8
G Oct 14, 2009 12:02:20 PM: Load core operators...
G Oct 14, 2009 12:02:20 PM: Load Weka operators: false
G Oct 14, 2009 12:02:20 PM: Load JDBC drivers from lib directory: false
G Oct 14, 2009 12:02:20 PM: Load JDBC drivers from classpath: true
G Oct 14, 2009 12:02:20 PM: Load plugins: false
G Oct 14, 2009 12:02:20 PM: Load plugins from '/home/ats/machineLearning/rapidminer-4.6/lib/plugins'
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Read rcfile '/home/ats/machineLearning/rapidminer-4.6/etc/rapidminerrc'.
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/machineLearning/rapidminer-4.6/etc/rapidminerrc.Linux'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/.rapidminer/4_5_0_rapidminerrc'...skipped
G Oct 14, 2009 12:02:20 PM: Read rcfile '/home/ats/.rapidminer/4_5_0_rapidminerrc.Linux'.
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/Netbeans/scratch/rapidminerrc'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/Netbeans/scratch/rapidminerrc.Linux'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rapidminer.rcfile. Property not specified...skipped
G Oct 14, 2009 12:02:21 PM: Loading operators from 'operators.xml'.
G Oct 14, 2009 12:02:27 PM: Loading JDBC driver information from 'etc:jdbc_properties.xml'.
G Oct 14, 2009 12:02:28 PM: Loading renderers from 'ioobjects.xml'.
G Oct 14, 2009 12:02:28 PM: [Warning] Password in XML file looks like unencrypted plain text.
BUILD SUCCESSFUL (total time: 8 seconds)
<operator name="Root" class="Process">
<parameter key="logfile" value="run.log"/>
<description text="Using a simple Naive Bayes classifier."/>
<operator name="Input" class="DatabaseExampleSource">
<parameter key="database_url" value="jdbc:mysql://192.168.0.15:3306/ctl"/>
<parameter key="id_attribute" value="sl3"/>
<parameter key="id_attribute" value="sl5"/>
<parameter key="id_attribute" value="sl8"/>
<parameter key="id_attribute" value="sl13"/>
<parameter key="id_attribute" value="mvv"/>
<parameter key="id_attribute" value="hl"/>
<parameter key="id_attribute" value="mvp"/>
<parameter key="label_attribute" value="RNK"/>
<parameter key="query" value="SELECT * FROM training where inc < 250"/>
<parameter key="username" value="ibt"/>
<parameter key="password" value="88bitz"/>
</operator>
<operator name="NaiveBayes" class="NaiveBayes">
</operator>
<operator name="ModelWriter" class="ModelWriter">
<parameter key="model_file" value="newGoog.mod"/>
</operator>
</operator>
package scratch;
//import java.io.File;
//import com.rapidminer.Process;
//import com.rapidminer.RapidMiner;
//import com.rapidminer.operator.*;
import java.io.File;
import com.rapidminer.Process;
import com.rapidminer.RapidMiner;
import com.rapidminer.operator.*;
//import com.rapidminer.*;
//import com.rapidminer.operator.reducer.PorterStemmer;
//import com.rapidminer.operator.tokenizer.SimpleTokenizer;
//import com.rapidminer.operator.wordfilter.EnglishStopwordFilter;
import com.rapidminer.tools.OperatorService;
/**
*
* @author ats
*/
public class executeXMLModel {
public static void main(String[] argv) throws Exception {
// set properties to point to plugin directory
String pluginDirString = new File("/home/ats/machineLearning/rapidminer-4.6/lib/plugins").getAbsolutePath();
System.setProperty(RapidMiner.PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION, pluginDirString);
// set properties - rapid miner home
String path = "/home/ats/machineLearning/rapidminer-4.6/";
System.setProperty("rapidminer.home", path);
RapidMiner.init();
Process root = new Process();
Operator inputOperator;
inputOperator = OperatorService.createOperator("DatabaseExampleSource");
inputOperator.setParameter("database_url", "jdbc:mysql://192.168.0.15:3306/ctl");
inputOperator.setParameter("id_attribute", "sl3");
inputOperator.setParameter("id_attribute", "sl5");
inputOperator.setParameter("id_attribute", "sl8");
inputOperator.setParameter("id_attribute", "sl13");
inputOperator.setParameter("id_attribute", "mvv");
inputOperator.setParameter("id_attribute", "hl");
inputOperator.setParameter("id_attribute", "mvp");
inputOperator.setParameter("label_attribute", "RNK");
inputOperator.setParameter("query", "SELECT * FROM training where inc < 250");
inputOperator.setParameter("username", "ibt");
inputOperator.setParameter("password", "88bitz");
root.getRootOperator().addOperator(inputOperator);
Operator NaiveBayes;
NaiveBayes = OperatorService.createOperator("NaiveBayes");
root.getRootOperator().addOperator(NaiveBayes);
Operator ModelWriter;
ModelWriter = OperatorService.createOperator("ModelWriter");
ModelWriter.setParameter("model_file", "/home/ats/rm_workspace/newGoogZZ.mod");
root.getRootOperator().addOperator(ModelWriter);
}
}
run:
G Oct 14, 2009 12:02:20 PM: rapidminer.home is '/home/ats/machineLearning/rapidminer-4.6/'.
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Initialization Settings
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Default system encoding for IO: UTF-8
G Oct 14, 2009 12:02:20 PM: Load core operators...
G Oct 14, 2009 12:02:20 PM: Load Weka operators: false
G Oct 14, 2009 12:02:20 PM: Load JDBC drivers from lib directory: false
G Oct 14, 2009 12:02:20 PM: Load JDBC drivers from classpath: true
G Oct 14, 2009 12:02:20 PM: Load plugins: false
G Oct 14, 2009 12:02:20 PM: Load plugins from '/home/ats/machineLearning/rapidminer-4.6/lib/plugins'
G Oct 14, 2009 12:02:20 PM: ----------------------------------------------------
G Oct 14, 2009 12:02:20 PM: Read rcfile '/home/ats/machineLearning/rapidminer-4.6/etc/rapidminerrc'.
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/machineLearning/rapidminer-4.6/etc/rapidminerrc.Linux'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/.rapidminer/4_5_0_rapidminerrc'...skipped
G Oct 14, 2009 12:02:20 PM: Read rcfile '/home/ats/.rapidminer/4_5_0_rapidminerrc.Linux'.
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/Netbeans/scratch/rapidminerrc'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rcfile '/home/ats/Netbeans/scratch/rapidminerrc.Linux'...skipped
G Oct 14, 2009 12:02:20 PM: Trying rapidminer.rcfile. Property not specified...skipped
G Oct 14, 2009 12:02:21 PM: Loading operators from 'operators.xml'.
G Oct 14, 2009 12:02:27 PM: Loading JDBC driver information from 'etc:jdbc_properties.xml'.
G Oct 14, 2009 12:02:28 PM: Loading renderers from 'ioobjects.xml'.
G Oct 14, 2009 12:02:28 PM: [Warning] Password in XML file looks like unencrypted plain text.
BUILD SUCCESSFUL (total time: 8 seconds)
0
Answers
-
Subject line should read, what's wrong with this...0
-
Hmm...
The following works for me....<operator name="Root" class="Process" expanded="yes">
So your point is what, exactly?
<operator name="DatabaseExampleSource" class="DatabaseExampleSource">
<parameter key="database_system" value="Microsoft SQL Server (Microsoft)"/>
<parameter key="database_url" value="jdbc:sqlserver://localhost:1433;databaseName=Tradestation"/>
<parameter key="username" value="sa"/>
<parameter key="password" value="wL8/6ZO7YrXKa8XgQd4v7g=="/>
<parameter key="query" value="SELECT FROM [Updates] where O <100"/>
</operator>
</operator>
0 -
Thanks, the SQL seems to work but I do not see the output file.0
-
Ah, I see, this has nothing to do with...
less than '<' in SQL querry string is fatal 0 -
Hi,
if I see this correct, you have the problem, that the model file isn't written? Then you should simply start the process. Otherwise non of the operators is executed.
Greetings,
Sebastian0