comparison ensemble.xml @ 19:4570575d060c draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit d00173591e4a783a4c1cb2664e4bb192ab5414f7
author bgruening
date Fri, 17 Aug 2018 12:28:21 -0400
parents f02eeabab5d1
children 038cecaa9e7c
comparison
equal deleted inserted replaced
18:0b3144c0b4ee 19:4570575d060c
13 <configfiles> 13 <configfiles>
14 <inputs name="inputs"/> 14 <inputs name="inputs"/>
15 <configfile name="ensemble_script"> 15 <configfile name="ensemble_script">
16 <![CDATA[ 16 <![CDATA[
17 import sys 17 import sys
18 import os
18 import json 19 import json
19 import numpy as np 20 import numpy as np
20 import sklearn.ensemble 21 import sklearn.ensemble
21 import pandas 22 import pandas
22 import pickle 23 import pickle
23 from scipy.io import mmread 24 from scipy.io import mmread
24 25
25 @COLUMNS_FUNCTION@ 26 execfile("$__tool_directory__/utils.py")
26 @GET_X_y_FUNCTION@
27 27
28 # Get inputs, outputs. 28 # Get inputs, outputs.
29 input_json_path = sys.argv[1] 29 input_json_path = sys.argv[1]
30 with open(input_json_path, "r") as param_handler: 30 with open(input_json_path, "r") as param_handler:
31 params = json.load(param_handler) 31 params = json.load(param_handler)
45 # All Python from here on out: 45 # All Python from here on out:
46 46
47 if params["selected_tasks"]["selected_task"] == "train": 47 if params["selected_tasks"]["selected_task"] == "train":
48 algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"] 48 algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"]
49 options = params["selected_tasks"]["selected_algorithms"]["options"] 49 options = params["selected_tasks"]["selected_algorithms"]["options"]
50 if algorithm in ['RandomForestClassifier', 'RandomForestRegressor']:
51 options['n_jobs'] = N_JOBS
50 if "select_max_features" in options: 52 if "select_max_features" in options:
51 if options["select_max_features"]["max_features"] == "number_input": 53 if options["select_max_features"]["max_features"] == "number_input":
52 options["select_max_features"]["max_features"] = options["select_max_features"]["num_max_features"] 54 options["select_max_features"]["max_features"] = options["select_max_features"]["num_max_features"]
53 options["select_max_features"].pop("num_max_features") 55 options["select_max_features"].pop("num_max_features")
54 options["max_features"] = options["select_max_features"]["max_features"] 56 options["max_features"] = options["select_max_features"]["max_features"]
105 <expand macro="min_samples_leaf"/> 107 <expand macro="min_samples_leaf"/>
106 <expand macro="min_weight_fraction_leaf"/> 108 <expand macro="min_weight_fraction_leaf"/>
107 <expand macro="max_leaf_nodes"/> 109 <expand macro="max_leaf_nodes"/>
108 <expand macro="bootstrap"/> 110 <expand macro="bootstrap"/>
109 <expand macro="warm_start" checked="false"/> 111 <expand macro="warm_start" checked="false"/>
110 <expand macro="n_jobs"/>
111 <expand macro="random_state"/> 112 <expand macro="random_state"/>
112 <expand macro="oob_score"/> 113 <expand macro="oob_score"/>
113 <!--class_weight=None--> 114 <!--class_weight=None-->
114 </section> 115 </section>
115 </when> 116 </when>
165 <expand macro="min_weight_fraction_leaf"/> 166 <expand macro="min_weight_fraction_leaf"/>
166 <expand macro="max_leaf_nodes"/> 167 <expand macro="max_leaf_nodes"/>
167 <expand macro="min_impurity_decrease"/> 168 <expand macro="min_impurity_decrease"/>
168 <expand macro="bootstrap"/> 169 <expand macro="bootstrap"/>
169 <expand macro="oob_score"/> 170 <expand macro="oob_score"/>
170 <expand macro="n_jobs"/>
171 <expand macro="random_state"/> 171 <expand macro="random_state"/>
172 <expand macro="verbose"/> 172 <expand macro="verbose"/>
173 <expand macro="warm_start" checked="false"/> 173 <expand macro="warm_start" checked="false"/>
174 </section> 174 </section>
175 </when> 175 </when>