diff generalized_linear.xml @ 21:212e7adfe65f draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2a058459e6daf0486871f93845f00fdb4a4eaca1
author bgruening
date Sat, 29 Sep 2018 07:39:16 -0400
parents 9b7d0655f70f
children e0f8931f6149
line wrap: on
line diff
--- a/generalized_linear.xml	Thu Aug 23 16:20:19 2018 -0400
+++ b/generalized_linear.xml	Sat Sep 29 07:39:16 2018 -0400
@@ -21,8 +21,9 @@
 import pandas
 from scipy.io import mmread
 
-execfile("$__tool_directory__/sk_whitelist.py")
-execfile("$__tool_directory__/utils.py", globals())
+with open("$__tool_directory__/sk_whitelist.json", "r") as f:
+    sk_whitelist = json.load(f)
+exec(open("$__tool_directory__/utils.py").read(), globals())
 
 input_json_path = sys.argv[1]
 with open(input_json_path, "r") as param_handler:
@@ -43,7 +44,7 @@
 
 #else:
 with open("$selected_tasks.infile_model", 'rb') as model_handler:
-    classifier_object = SafePickler.load(model_handler)
+    classifier_object = load_model(model_handler)
 data = pandas.read_csv("$selected_tasks.infile_data", sep='\t', header=None, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False )
 prediction = classifier_object.predict(data)
 prediction_df = pandas.DataFrame(prediction, columns=["predicted"])
@@ -199,14 +200,7 @@
             </when>
         </expand>
     </inputs>
-    <outputs>
-        <data format="tabular" name="outfile_predict">
-            <filter>selected_tasks['selected_task'] == 'load'</filter>
-        </data>
-        <data format="zip" name="outfile_fit">
-            <filter>selected_tasks['selected_task'] == 'train'</filter>
-        </data>
-    </outputs>
+    <expand macro="output"/>
     <tests>
         <test>
             <param name="infile1" value="regression_train.tabular" ftype="tabular"/>
@@ -264,7 +258,6 @@
             <param name="col2" value="6"/>
             <param name="selected_task" value="train"/>
             <param name="selected_algorithm" value="LinearRegression"/>
-            <param name="random_state" value="10"/>
             <output name="outfile_fit" file="glm_model04" compare="sim_size" delta="500"/>
         </test>
         <test>