Update of /cvsroot/jboost/jboost/src/jboost/controller
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2442/controller
Modified Files:
Configuration.java Controller.java
Log Message:
Added python to the code output options.
Index: Controller.java
===================================================================
RCS file: /cvsroot/jboost/jboost/src/jboost/controller/Controller.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Controller.java 30 Sep 2008 03:34:50 -0000 1.12
--- Controller.java 3 Jan 2009 05:13:32 -0000 1.13
***************
*** 267,270 ****
--- 267,276 ----
}
+ // output Matlab code
+ String python = m_config.getPythonOutputFileName();
+ if (python != null) {
+ generateCode(res,"Python", python, m_config.getString("pythonOutputFunction", "predict"));
+ }
+
// output java code
String java= m_config.getJavaOutputFileName();
***************
*** 443,447 ****
}
! System.out.println();
}
--- 449,453 ----
}
! System.out.println("");
}
***************
*** 674,677 ****
--- 680,685 ----
else if (language.equals("MatLab"))
code= predictor.toMatlab(procedureName, m_exampleDescription);
+ else if (language.equals("Python"))
+ code= predictor.toPython(procedureName, m_exampleDescription);
else if (language.equals("java"))
code=
Index: Configuration.java
===================================================================
RCS file: /cvsroot/jboost/jboost/src/jboost/controller/Configuration.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Configuration.java 15 Aug 2008 21:38:13 -0000 1.9
--- Configuration.java 3 Jan 2009 05:13:32 -0000 1.10
***************
*** 117,120 ****
--- 117,121 ----
+ "\t-serialTreeOutput file.tree Java object output of adtree (can be loaded\n"
+ "\t at a later date)\n"
+ + "\t-P filename Output Python code file name (default: stem+\".output.py\"\n"
+ "\t-j filename Output java code file name (default: stem+\".output.java\"\n"
+ "\t-c filename Output C code file name (default: stem+\".output.c\")\n"
***************
*** 623,626 ****
--- 624,628 ----
public static final String JAVA_OUTPUT_FILENAME="javaCodeOutputFileName";
public static final String MATLAB_OUTPUT_FILENAME="matlabCodeOutputFileName";
+ public static final String PYTHON_OUTPUT_FILENAME="pythonCodeOutputFileName";
public static final String SERIALIZED_OUTPUT_FILENAME="serializationOutputFileName";
public static final String SERIALIZED_INPUT="serialTreeInput";
***************
*** 663,666 ****
--- 665,669 ----
addOption(JAVA_OUTPUT_FILENAME, getString("j", null));
addOption(MATLAB_OUTPUT_FILENAME, getString("m", null));
+ addOption(PYTHON_OUTPUT_FILENAME, getString("P", null));
addOption(SERIALIZED_OUTPUT_FILENAME, getString("serialTreeOutput", null));
addOption(SERIALIZED_INPUT, getString("serialTreeInput", null));
***************
*** 783,786 ****
--- 786,796 ----
/**
+ * @return Returns the name of the Python output file
+ */
+ public String getPythonOutputFileName() {
+ return getString(PYTHON_OUTPUT_FILENAME);
+ }
+
+ /**
* @return Returns the name of the serialized output file
*/
|