comparison keras_train_and_eval.xml @ 4:3866911c93ae draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
author bgruening
date Tue, 13 Apr 2021 18:37:35 +0000
parents ccd6269fad60
children b3093f953091
comparison
equal deleted inserted replaced
3:f1b9a42d6809 4:3866911c93ae
1 <tool id="keras_train_and_eval" name="Deep learning training and evaluation" version="@VERSION@"> 1 <tool id="keras_train_and_eval" name="Deep learning training and evaluation" version="@VERSION@" profile="20.05">
2 <description>conduct deep training and evaluation either implicitly or explicitly</description> 2 <description>conduct deep training and evaluation either implicitly or explicitly</description>
3 <macros> 3 <macros>
4 <import>main_macros.xml</import> 4 <import>main_macros.xml</import>
5 <import>keras_macros.xml</import> 5 <import>keras_macros.xml</import>
6 </macros> 6 </macros>
7 <expand macro="python_requirements"/> 7 <expand macro="python_requirements" />
8 <expand macro="macro_stdio"/> 8 <expand macro="macro_stdio" />
9 <version_command>echo "@VERSION@"</version_command> 9 <version_command>echo "@VERSION@"</version_command>
10 <command> 10 <command>
11 <![CDATA[ 11 <![CDATA[
12 export HDF5_USE_FILE_LOCKING='FALSE'; 12 export HDF5_USE_FILE_LOCKING='FALSE';
13 #if $input_options.selected_input == 'refseq_and_interval' 13 #if $input_options.selected_input == 'refseq_and_interval'
17 #end if 17 #end if
18 python '$__tool_directory__/keras_train_and_eval.py' 18 python '$__tool_directory__/keras_train_and_eval.py'
19 --inputs '$inputs' 19 --inputs '$inputs'
20 --estimator '$experiment_schemes.infile_estimator' 20 --estimator '$experiment_schemes.infile_estimator'
21 #if $input_options.selected_input == 'seq_fasta' 21 #if $input_options.selected_input == 'seq_fasta'
22 --fasta_path '$input_options.fasta_path' 22 --fasta_path '$input_options.fasta_path'
23 #elif $input_options.selected_input == 'refseq_and_interval' 23 #elif $input_options.selected_input == 'refseq_and_interval'
24 --ref_seq "`pwd`/${ref_genome_file.element_identifier}" 24 --ref_seq "`pwd`/${ref_genome_file.element_identifier}"
25 --interval '$input_options.interval_file' 25 --interval '$input_options.interval_file'
26 --targets "`pwd`/${target_file.element_identifier}.gz" 26 --targets "`pwd`/${target_file.element_identifier}.gz"
27 #else 27 #else
28 --infile1 '$input_options.infile1' 28 --infile1 '$input_options.infile1'
29 #end if 29 #end if
30 --infile2 '$input_options.infile2' 30 --infile2 '$input_options.infile2'
31 --outfile_result "`pwd`/tmp_outfile_result" 31 --outfile_result '$outfile_result'
32 #if $save and 'save_estimator' in str($save) 32 #if $save and 'save_estimator' in str($save)
33 --outfile_object '$outfile_object' 33 --outfile_object '$outfile_object'
34 --outfile_weights '$outfile_weights' 34 --outfile_weights '$outfile_weights'
35 #end if 35 #end if
36 #if $save and 'save_prediction' in str($save) 36 #if $save and 'save_prediction' in str($save)
37 --outfile_y_true '$outfile_y_true' 37 --outfile_y_true '$outfile_y_true'
38 --outfile_y_preds '$outfile_y_preds' 38 --outfile_y_preds '$outfile_y_preds'
39 #end if 39 #end if
40 #if $experiment_schemes.test_split.split_algos.shuffle == 'group' 40 #if $experiment_schemes.test_split.split_algos.shuffle == 'group'
41 --groups '$experiment_schemes.test_split.split_algos.groups_selector.infile_g' 41 --groups '$experiment_schemes.test_split.split_algos.groups_selector.infile_g'
42 #end if 42 #end if
43 >'$outfile_result' && cp '$outfile_result' "`pwd`/../tool_stdout"
44 && cp tmp_outfile_result '$outfile_result';
45
46 ]]> 43 ]]>
47 </command> 44 </command>
48 <configfiles> 45 <configfiles>
49 <inputs name="inputs" /> 46 <inputs name="inputs" />
50 </configfiles> 47 </configfiles>
53 <param name="selected_exp_scheme" type="select" label="Select a scheme"> 50 <param name="selected_exp_scheme" type="select" label="Select a scheme">
54 <option value="train_val" selected="true">Train and Validate</option> 51 <option value="train_val" selected="true">Train and Validate</option>
55 <option value="train_val_test">Train, Validate and and Evaluate</option> 52 <option value="train_val_test">Train, Validate and and Evaluate</option>
56 </param> 53 </param>
57 <when value="train_val"> 54 <when value="train_val">
58 <expand macro="estimator_and_hyperparameter"/> 55 <expand macro="estimator_and_hyperparameter" />
59 <section name="test_split" title="Validation holdout" expanded="false"> 56 <section name="test_split" title="Validation holdout" expanded="false">
60 <expand macro="train_test_split_params"> 57 <expand macro="train_test_split_params">
61 <expand macro="cv_groups"/> 58 <expand macro="cv_groups" />
62 </expand> 59 </expand>
63 </section> 60 </section>
64 <section name="metrics" title="Metrics for evaluation" expanded="false"> 61 <section name="metrics" title="Metrics for evaluation" expanded="false">
65 <expand macro="scoring_selection"/> 62 <expand macro="scoring_selection" />
66 </section> 63 </section>
67 </when> 64 </when>
68 <when value="train_val_test"> 65 <when value="train_val_test">
69 <expand macro="estimator_and_hyperparameter"/> 66 <expand macro="estimator_and_hyperparameter" />
70 <section name="test_split" title="Test holdout" expanded="false"> 67 <section name="test_split" title="Test holdout" expanded="false">
71 <expand macro="train_test_split_params"> 68 <expand macro="train_test_split_params">
72 <expand macro="cv_groups"/> 69 <expand macro="cv_groups" />
73 </expand> 70 </expand>
74 </section> 71 </section>
75 <section name="val_split" title="Validation holdout (recommend using the same splitting method as for test holdout)" expanded="false"> 72 <section name="val_split" title="Validation holdout (recommend using the same splitting method as for test holdout)" expanded="false">
76 <expand macro="train_test_split_params"/> 73 <expand macro="train_test_split_params" />
77 </section> 74 </section>
78 <section name="metrics" title="Metrics for evaluation" expanded="false"> 75 <section name="metrics" title="Metrics for evaluation" expanded="false">
79 <expand macro="scoring_selection"/> 76 <expand macro="scoring_selection" />
80 </section> 77 </section>
81 </when> 78 </when>
82 </conditional> 79 </conditional>
83 <expand macro="sl_mixed_input_plus_sequence"/> 80 <expand macro="sl_mixed_input_plus_sequence" />
84 <param name="save" type="select" multiple='true' display="checkboxes" label="Save the fitted model" optional="true" help="Evaluation scores will be output by default."> 81 <param name="save" type="select" multiple='true' display="checkboxes" label="Save the fitted model" optional="true" help="Evaluation scores will be output by default.">
85 <option value="save_estimator" selected="true">Fitted estimator in skeleton and weights, separately</option> 82 <option value="save_estimator" selected="true">Fitted estimator in skeleton and weights, separately</option>
86 <option value="save_prediction">True labels and prediction results from evaluation for downstream analysis</option> 83 <option value="save_prediction">True labels and prediction results from evaluation for downstream analysis</option>
87 </param> 84 </param>
88 </inputs> 85 </inputs>
89 <outputs> 86 <outputs>
90 <data format="tabular" name="outfile_result"/> 87 <data format="tabular" name="outfile_result" />
91 <data format="zip" name="outfile_object" label="Fitted estimator or estimator skeleton on ${on_string}"> 88 <data format="zip" name="outfile_object" label="Fitted estimator or estimator skeleton on ${on_string}">
92 <filter>str(save) and 'save_estimator' in str(save)</filter> 89 <filter>str(save) and 'save_estimator' in str(save)</filter>
93 </data> 90 </data>
94 <data format="h5" name="outfile_weights" label="Weights trained on ${on_string}"> 91 <data format="h5" name="outfile_weights" label="Weights trained on ${on_string}">
95 <filter>str(save) and 'save_estimator' in str(save)</filter> 92 <filter>str(save) and 'save_estimator' in str(save)</filter>
102 </data> 99 </data>
103 </outputs> 100 </outputs>
104 <tests> 101 <tests>
105 <test> 102 <test>
106 <conditional name="experiment_schemes"> 103 <conditional name="experiment_schemes">
107 <param name="selected_exp_scheme" value="train_val_test"/> 104 <param name="selected_exp_scheme" value="train_val_test" />
108 <param name="infile_estimator" value="keras_model04" ftype="zip"/> 105 <param name="infile_estimator" value="keras_model04" ftype="zip" />
109 <section name="hyperparams_swapping"> 106 <section name="hyperparams_swapping">
110 <param name="infile_params" value="keras_params04.tabular" ftype="tabular"/> 107 <param name="infile_params" value="keras_params04.tabular" ftype="tabular" />
111 <repeat name="param_set"> 108 <repeat name="param_set">
112 <param name="sp_value" value="999"/> 109 <param name="sp_value" value="999" />
113 <param name="sp_name" value="layers_0_Dense__config__kernel_initializer__config__seed"/> 110 <param name="sp_name" value="layers_0_Dense__config__kernel_initializer__config__seed" />
114 </repeat> 111 </repeat>
115 <repeat name="param_set"> 112 <repeat name="param_set">
116 <param name="sp_value" value="999"/> 113 <param name="sp_value" value="999" />
117 <param name="sp_name" value="layers_2_Dense__config__kernel_initializer__config__seed"/> 114 <param name="sp_name" value="layers_2_Dense__config__kernel_initializer__config__seed" />
118 </repeat> 115 </repeat>
119 <repeat name="param_set"> 116 <repeat name="param_set">
120 <param name="sp_value" value="0.1"/> 117 <param name="sp_value" value="0.1" />
121 <param name="sp_name" value="lr"/> 118 <param name="sp_name" value="lr" />
122 </repeat> 119 </repeat>
123 <repeat name="param_set"> 120 <repeat name="param_set">
124 <param name="sp_value" value="'adamax'"/> 121 <param name="sp_value" value="'adamax'" />
125 <param name="sp_name" value="optimizer"/> 122 <param name="sp_name" value="optimizer" />
126 </repeat> 123 </repeat>
127 </section> 124 </section>
128 <section name="test_split"> 125 <section name="test_split">
129 <conditional name="split_algos"> 126 <conditional name="split_algos">
130 <param name="shuffle" value="simple"/> 127 <param name="shuffle" value="simple" />
131 <param name="test_size" value="0.2"/> 128 <param name="test_size" value="0.2" />
132 <param name="random_state" value="123"/> 129 <param name="random_state" value="123" />
133 </conditional> 130 </conditional>
134 </section> 131 </section>
135 <section name="val_split"> 132 <section name="val_split">
136 <conditional name="split_algos"> 133 <conditional name="split_algos">
137 <param name="shuffle" value="simple"/> 134 <param name="shuffle" value="simple" />
138 <param name="test_size" value="0.2"/> 135 <param name="test_size" value="0.2" />
139 <param name="random_state" value="456"/> 136 <param name="random_state" value="456" />
140 </conditional> 137 </conditional>
141 </section> 138 </section>
142 <section name="metrics"> 139 <section name="metrics">
143 <conditional name="scoring"> 140 <conditional name="scoring">
144 <param name="primary_scoring" value="r2"/> 141 <param name="primary_scoring" value="r2" />
145 <param name="secondary_scoring" value="neg_mean_absolute_error"/> 142 <param name="secondary_scoring" value="neg_mean_absolute_error" />
146 </conditional> 143 </conditional>
147 </section> 144 </section>
148 </conditional> 145 </conditional>
149 <param name="infile1" value="regression_X.tabular" ftype="tabular"/> 146 <param name="infile1" value="regression_X.tabular" ftype="tabular" />
150 <param name="header1" value="true" /> 147 <param name="header1" value="true" />
151 <param name="selected_column_selector_option" value="all_columns"/> 148 <param name="selected_column_selector_option" value="all_columns" />
152 <param name="infile2" value="regression_y.tabular" ftype="tabular"/> 149 <param name="infile2" value="regression_y.tabular" ftype="tabular" />
153 <param name="header2" value="true" /> 150 <param name="header2" value="true" />
154 <param name="selected_column_selector_option2" value="all_columns"/> 151 <param name="selected_column_selector_option2" value="all_columns" />
155 <param name="save" value="save_estimator"/> 152 <param name="save" value="save_estimator" />
156 <output name="outfile_result"> 153 <output name="outfile_result">
157 <assert_contents> 154 <assert_contents>
158 <has_n_columns n="2"/> 155 <has_n_columns n="2" />
159 <has_text text="0.6626"/> 156 <has_text text="0.638" />
160 <has_text text="5.598"/> 157 <has_text text="-6.072" />
161 </assert_contents> 158 </assert_contents>
162 </output> 159 </output>
163 <output name="outfile_object" file="train_test_eval_model01" compare="sim_size" delta="5"/> 160 <output name="outfile_object" file="train_test_eval_model01" compare="sim_size" delta="50" />
164 <output name="outfile_weights" file="train_test_eval_weights01.h5" compare="sim_size" delta="5"/> 161 <output name="outfile_weights" file="train_test_eval_weights01.h5" compare="sim_size" delta="50" />
165 </test> 162 </test>
166 <test> 163 <test>
167 <conditional name="experiment_schemes"> 164 <conditional name="experiment_schemes">
168 <param name="selected_exp_scheme" value="train_val_test"/> 165 <param name="selected_exp_scheme" value="train_val_test" />
169 <param name="infile_estimator" value="keras_model04" ftype="zip"/> 166 <param name="infile_estimator" value="keras_model04" ftype="zip" />
170 <section name="hyperparams_swapping"> 167 <section name="hyperparams_swapping">
171 <param name="infile_params" value="keras_params04.tabular" ftype="tabular"/> 168 <param name="infile_params" value="keras_params04.tabular" ftype="tabular" />
172 <repeat name="param_set"> 169 <repeat name="param_set">
173 <param name="sp_value" value="999"/> 170 <param name="sp_value" value="999" />
174 <param name="sp_name" value="layers_0_Dense__config__kernel_initializer__config__seed"/> 171 <param name="sp_name" value="layers_0_Dense__config__kernel_initializer__config__seed" />
175 </repeat> 172 </repeat>
176 <repeat name="param_set"> 173 <repeat name="param_set">
177 <param name="sp_value" value="999"/> 174 <param name="sp_value" value="999" />
178 <param name="sp_name" value="layers_2_Dense__config__kernel_initializer__config__seed"/> 175 <param name="sp_name" value="layers_2_Dense__config__kernel_initializer__config__seed" />
179 </repeat> 176 </repeat>
180 <repeat name="param_set"> 177 <repeat name="param_set">
181 <param name="sp_value" value="0.1"/> 178 <param name="sp_value" value="0.1" />
182 <param name="sp_name" value="lr"/> 179 <param name="sp_name" value="lr" />
183 </repeat> 180 </repeat>
184 <repeat name="param_set"> 181 <repeat name="param_set">
185 <param name="sp_value" value="'adamax'"/> 182 <param name="sp_value" value="'adamax'" />
186 <param name="sp_name" value="optimizer"/> 183 <param name="sp_name" value="optimizer" />
187 </repeat> 184 </repeat>
188 </section> 185 </section>
189 <section name="test_split"> 186 <section name="test_split">
190 <conditional name="split_algos"> 187 <conditional name="split_algos">
191 <param name="shuffle" value="group"/> 188 <param name="shuffle" value="group" />
192 <param name="group_names" value="test"/> 189 <param name="group_names" value="test" />
193 <section name="groups_selector"> 190 <section name="groups_selector">
194 <param name="infile_g" value="regression_groups.tabular" ftype="tabular"/> 191 <param name="infile_g" value="regression_groups.tabular" ftype="tabular" />
195 <param name="header_g" value="true"/> 192 <param name="header_g" value="true" />
196 <conditional name="column_selector_options_g"> 193 <conditional name="column_selector_options_g">
197 <param name="selected_column_selector_option_g" value="by_index_number"/> 194 <param name="selected_column_selector_option_g" value="by_index_number" />
198 <param name="col_g" value="1"/> 195 <param name="col_g" value="1" />
199 </conditional> 196 </conditional>
200 </section> 197 </section>
201 </conditional> 198 </conditional>
202 </section> 199 </section>
203 <section name="val_split"> 200 <section name="val_split">
204 <conditional name="split_algos"> 201 <conditional name="split_algos">
205 <param name="shuffle" value="group"/> 202 <param name="shuffle" value="group" />
206 <param name="group_names" value="validation"/> 203 <param name="group_names" value="validation" />
207 </conditional> 204 </conditional>
208 </section> 205 </section>
209 <section name="metrics"> 206 <section name="metrics">
210 <conditional name="scoring"> 207 <conditional name="scoring">
211 <param name="primary_scoring" value="r2"/> 208 <param name="primary_scoring" value="r2" />
212 <param name="secondary_scoring" value="neg_mean_absolute_error"/> 209 <param name="secondary_scoring" value="neg_mean_absolute_error" />
213 </conditional> 210 </conditional>
214 </section> 211 </section>
215 </conditional> 212 </conditional>
216 <param name="infile1" value="regression_X.tabular" ftype="tabular"/> 213 <param name="infile1" value="regression_X.tabular" ftype="tabular" />
217 <param name="header1" value="true" /> 214 <param name="header1" value="true" />
218 <param name="selected_column_selector_option" value="all_columns"/> 215 <param name="selected_column_selector_option" value="all_columns" />
219 <param name="infile2" value="regression_y.tabular" ftype="tabular"/> 216 <param name="infile2" value="regression_y.tabular" ftype="tabular" />
220 <param name="header2" value="true" /> 217 <param name="header2" value="true" />
221 <param name="selected_column_selector_option2" value="all_columns"/> 218 <param name="selected_column_selector_option2" value="all_columns" />
222 <param name="save" value="save_estimator,save_prediction"/> 219 <param name="save" value="save_estimator,save_prediction" />
223 <output name="outfile_result" > 220 <output name="outfile_result">
224 <assert_contents> 221 <assert_contents>
225 <has_n_columns n="2"/> 222 <has_n_columns n="2" />
226 <has_text text="0.667"/> 223 <has_text text="0.627" />
227 <has_text text="5.586"/> 224 <has_text text="-6.012" />
228 </assert_contents> 225 </assert_contents>
229 </output> 226 </output>
230 <output name="outfile_weights" file="train_test_eval_weights02.h5" compare="sim_size" delta="5"/> 227 <output name="outfile_weights" file="train_test_eval_weights02.h5" compare="sim_size" delta="50" />
231 <output name="outfile_y_true" file="keras_train_eval_y_true02.tabular" ftype="tabular"/> 228 <output name="outfile_y_true" file="keras_train_eval_y_true02.tabular" ftype="tabular" />
232 </test> 229 </test>
233 <test> 230 <test>
234 <conditional name="experiment_schemes"> 231 <conditional name="experiment_schemes">
235 <param name="selected_exp_scheme" value="train_val"/> 232 <param name="selected_exp_scheme" value="train_val" />
236 <param name="infile_estimator" value="pipeline10" ftype="zip"/> 233 <param name="infile_estimator" value="pipeline10" ftype="zip" />
237 <section name="hyperparams_swapping"> 234 <section name="hyperparams_swapping">
238 <param name="infile_params" value="get_params10.tabular" ftype="tabular"/> 235 <param name="infile_params" value="get_params10.tabular" ftype="tabular" />
239 <repeat name="param_set"> 236 <repeat name="param_set">
240 <param name="sp_value" value="10"/> 237 <param name="sp_value" value="10" />
241 <param name="sp_name" value="adaboostregressor__random_state"/> 238 <param name="sp_name" value="adaboostregressor__random_state" />
242 </repeat> 239 </repeat>
243 <repeat name="param_set"> 240 <repeat name="param_set">
244 <param name="sp_value" value=": sklearn_tree.ExtraTreeRegressor(random_state=0)"/> 241 <param name="sp_value" value=": sklearn_tree.ExtraTreeRegressor(random_state=0)" />
245 <param name="sp_name" value="adaboostregressor__base_estimator"/> 242 <param name="sp_name" value="adaboostregressor__base_estimator" />
246 </repeat> 243 </repeat>
247 </section> 244 </section>
248 <section name="test_split"> 245 <section name="test_split">
249 <conditional name="split_algos"> 246 <conditional name="split_algos">
250 <param name="shuffle" value="simple"/> 247 <param name="shuffle" value="simple" />
251 <param name="test_size" value="0.2"/> 248 <param name="test_size" value="0.2" />
252 <param name="random_state" value="123"/> 249 <param name="random_state" value="123" />
253 </conditional> 250 </conditional>
254 </section> 251 </section>
255 <section name="val_split"> 252 <section name="val_split">
256 <conditional name="split_algos"> 253 <conditional name="split_algos">
257 <param name="shuffle" value="simple"/> 254 <param name="shuffle" value="simple" />
258 <param name="test_size" value="0.2"/> 255 <param name="test_size" value="0.2" />
259 <param name="random_state" value="456"/> 256 <param name="random_state" value="456" />
260 </conditional> 257 </conditional>
261 </section> 258 </section>
262 <section name="metrics"> 259 <section name="metrics">
263 <conditional name="scoring"> 260 <conditional name="scoring">
264 <param name="primary_scoring" value="r2"/> 261 <param name="primary_scoring" value="r2" />
265 <param name="secondary_scoring" value="neg_mean_absolute_error"/> 262 <param name="secondary_scoring" value="neg_mean_absolute_error" />
266 </conditional> 263 </conditional>
267 </section> 264 </section>
268 </conditional> 265 </conditional>
269 <param name="infile1" value="regression_X.tabular" ftype="tabular"/> 266 <param name="infile1" value="regression_X.tabular" ftype="tabular" />
270 <param name="header1" value="true" /> 267 <param name="header1" value="true" />
271 <param name="selected_column_selector_option" value="all_columns"/> 268 <param name="selected_column_selector_option" value="all_columns" />
272 <param name="infile2" value="regression_y.tabular" ftype="tabular"/> 269 <param name="infile2" value="regression_y.tabular" ftype="tabular" />
273 <param name="header2" value="true" /> 270 <param name="header2" value="true" />
274 <param name="selected_column_selector_option2" value="all_columns"/> 271 <param name="selected_column_selector_option2" value="all_columns" />
275 <param name="save" value=""/> 272 <param name="save" value="" />
276 <output name="outfile_result" file="train_test_eval03.tabular"/> 273 <output name="outfile_result" file="train_test_eval03.tabular" />
277 </test> 274 </test>
278 </tests> 275 </tests>
279 <help> 276 <help>
280 <![CDATA[ 277 <![CDATA[
281 **What it does** 278 **What it does**
305 - true labels or values and predicted values from the evaluation 302 - true labels or values and predicted values from the evaluation
306 303
307 ]]> 304 ]]>
308 </help> 305 </help>
309 <expand macro="sklearn_citation"> 306 <expand macro="sklearn_citation">
310 <expand macro="keras_citation"/> 307 <expand macro="keras_citation" />
311 </expand> 308 </expand>
312 </tool> 309 </tool>