Mercurial > repos > bgruening > sklearn_stacking_ensemble_models
comparison stacking_ensembles.xml @ 0:fcc5eaaec401 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
| author | bgruening |
|---|---|
| date | Wed, 15 May 2019 07:25:29 -0400 |
| parents | |
| children | 22560cf810b8 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:fcc5eaaec401 |
|---|---|
| 1 <tool id="sklearn_stacking_ensemble_models" name="Stacking Ensemble Models" version="0.1.0"> | |
| 2 <description>builds a strong model by stacking multiple algorithms</description> | |
| 3 <macros> | |
| 4 <import>main_macros.xml</import> | |
| 5 </macros> | |
| 6 <expand macro="python_requirements"/> | |
| 7 <expand macro="macro_stdio"/> | |
| 8 <version_command>echo "$version"</version_command> | |
| 9 <command> | |
| 10 <![CDATA[ | |
| 11 #for $i, $base in enumerate($base_est_builder) | |
| 12 #if $i == 0 | |
| 13 #if $base.estimator_selector.selected_module == 'custom_estimator' | |
| 14 bases='${base.estimator_selector.c_estimator}'; | |
| 15 #else | |
| 16 bases='None'; | |
| 17 #end if | |
| 18 #elif $base.estimator_selector.selected_module == 'custom_estimator' | |
| 19 bases="\$bases,${base.estimator_selector.c_estimator}"; | |
| 20 #else | |
| 21 bases="\$bases,None"; | |
| 22 #end if | |
| 23 #end for | |
| 24 python '$__tool_directory__/stacking_ensembles.py' | |
| 25 --inputs '$inputs' | |
| 26 --outfile '$outfile' | |
| 27 --bases "\$bases" | |
| 28 #if $meta_estimator.estimator_selector.selected_module == 'custom_estimator' | |
| 29 --meta '${meta_estimator.estimator_selector.c_estimator}' | |
| 30 #end if | |
| 31 #if $get_params | |
| 32 --outfile_params '$outfile_params' | |
| 33 #end if | |
| 34 ]]> | |
| 35 </command> | |
| 36 <configfiles> | |
| 37 <inputs name="inputs" /> | |
| 38 </configfiles> | |
| 39 <inputs> | |
| 40 <conditional name="algo_selection"> | |
| 41 <param name="estimator_type" type="select" label="Choose the stacking ensemble type"> | |
| 42 <option value="StackingCVClassifier" selected="true">classification -- StackingCVClassifier</option> | |
| 43 <option value="StackingClassifier">classification -- StackingClassifier</option> | |
| 44 <option value="StackingCVRegressor">regression -- StackingCVRegressor</option> | |
| 45 <option value="StackingRegressor">regression -- StackingRegressor</option> | |
| 46 </param> | |
| 47 <when value="StackingCVClassifier"> | |
| 48 <expand macro="stacking_ensemble_inputs"> | |
| 49 <expand macro="cv_reduced"/> | |
| 50 <expand macro="shuffle" label="shuffle"/> | |
| 51 <expand macro="random_state" default_value="" help_text="Integer number. The seed of the pseudo random number generator to use when shuffling the data."/> | |
| 52 <param argument="use_probas" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false"/> | |
| 53 </expand> | |
| 54 </when> | |
| 55 <when value="StackingClassifier"> | |
| 56 <expand macro="stacking_ensemble_inputs"> | |
| 57 <param argument="use_probas" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false"/> | |
| 58 <param argument="average_probas" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false"/> | |
| 59 </expand> | |
| 60 </when> | |
| 61 <when value="StackingCVRegressor"> | |
| 62 <expand macro="stacking_ensemble_inputs"> | |
| 63 <expand macro="cv_reduced"/> | |
| 64 <!--TODO support group splitters. Hint: `groups` is a fit_param--> | |
| 65 <expand macro="shuffle" label="shuffle"/> | |
| 66 <expand macro="random_state" default_value="" help_text="Integer number. The seed of the pseudo random number generator to use when shuffling the data."/> | |
| 67 <param argument="refit" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true"/> | |
| 68 </expand> | |
| 69 </when> | |
| 70 <when value="StackingRegressor"> | |
| 71 <expand macro="stacking_ensemble_inputs"> | |
| 72 <param argument="refit" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true"/> | |
| 73 </expand> | |
| 74 </when> | |
| 75 </conditional> | |
| 76 <repeat name="base_est_builder" min="1" max="20" title="Base Estimator"> | |
| 77 <expand macro="stacking_base_estimator"/> | |
| 78 <!--param name="base_estimator" type="data" format="zip,json" label="Select the dataset containing base estimator" help="One estimator at a time."/--> | |
| 79 </repeat> | |
| 80 <!--param name="meta_estimator" type="data" format="zip,json" label="Select the dataset containing the Meta estimator"/--> | |
| 81 <section name="meta_estimator" title="Meta Estimator" expanded="true"> | |
| 82 <expand macro="stacking_base_estimator"/> | |
| 83 </section> | |
| 84 <param name="get_params" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="Output parameters for searchCV?" | |
| 85 help="Optional. Tunable parameters could be obtained through `estimator_attributes` tool."/> | |
| 86 </inputs> | |
| 87 <outputs> | |
| 88 <data format="zip" name="outfile" label="${algo_selection.estimator_type} on ${on_string}"/> | |
| 89 <data format="tabular" name="outfile_params" label="get_params for ${algo_selection.estimator_type}"> | |
| 90 <filter>get_params</filter> | |
| 91 </data> | |
| 92 </outputs> | |
| 93 <tests> | |
| 94 <test> | |
| 95 <conditional name="algo_selection"> | |
| 96 <param name="estimator_type" value="StackingCVRegressor"/> | |
| 97 </conditional> | |
| 98 <repeat name="base_est_builder"> | |
| 99 <conditional name="estimator_selector"> | |
| 100 <param name="selected_module" value="custom_estimator"/> | |
| 101 <param name="c_estimator" value="RandomForestRegressor01.zip" ftype="zip"/> | |
| 102 </conditional> | |
| 103 </repeat> | |
| 104 <repeat name="base_est_builder"> | |
| 105 <conditional name="estimator_selector"> | |
| 106 <param name="selected_module" value="custom_estimator"/> | |
| 107 <param name="c_estimator" value="XGBRegressor01.zip" ftype="zip"/> | |
| 108 </conditional> | |
| 109 </repeat> | |
| 110 <section name="meta_estimator"> | |
| 111 <conditional name="estimator_selector"> | |
| 112 <param name="selected_module" value="custom_estimator"/> | |
| 113 <param name="c_estimator" value="LinearRegression01.zip" ftype="zip"/> | |
| 114 </conditional> | |
| 115 </section> | |
| 116 <param name="get_params" value="false"/> | |
| 117 <output name="outfile" file="StackingCVRegressor01.zip" compare="sim_size" delta="5"/> | |
| 118 </test> | |
| 119 <test> | |
| 120 <conditional name="algo_selection"> | |
| 121 <param name="estimator_type" value="StackingCVRegressor"/> | |
| 122 </conditional> | |
| 123 <repeat name="base_est_builder"> | |
| 124 <conditional name="estimator_selector"> | |
| 125 <param name="selected_module" value="custom_estimator"/> | |
| 126 <param name="c_estimator" value="RandomForestRegressor01.zip" ftype="zip"/> | |
| 127 </conditional> | |
| 128 </repeat> | |
| 129 <repeat name="base_est_builder"> | |
| 130 <conditional name="estimator_selector"> | |
| 131 <param name="selected_module" value="xgboost"/> | |
| 132 <param name="selected_estimator" value="XGBRegressor"/> | |
| 133 </conditional> | |
| 134 </repeat> | |
| 135 <section name="meta_estimator"> | |
| 136 <conditional name="estimator_selector"> | |
| 137 <param name="selected_module" value="svm"/> | |
| 138 <param name="selected_estimator" value="SVR"/> | |
| 139 </conditional> | |
| 140 </section> | |
| 141 <param name="get_params" value="false"/> | |
| 142 <output name="outfile" file="StackingCVRegressor02.zip" compare="sim_size" delta="5"/> | |
| 143 </test> | |
| 144 </tests> | |
| 145 <help> | |
| 146 <![CDATA[ | |
| 147 This tool wrapps Stacking Regression, also called Super Learning, in which different base algorithms train | |
| 148 on the original dataset and predict results respectively, a second level of `metalearner` fits on the previous | |
| 149 prediction results to ensemble a strong learner. | |
| 150 Refer to `http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/stacked-ensembles.html#introduction`_. | |
| 151 | |
| 152 .. _`http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/stacked-ensembles.html#introduction`: | |
| 153 http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/stacked-ensembles.html#introduction | |
| 154 | |
| 155 ]]> | |
| 156 </help> | |
| 157 <expand macro="sklearn_citation"> | |
| 158 <expand macro="skrebate_citation"/> | |
| 159 <expand macro="xgboost_citation"/> | |
| 160 <expand macro="imblearn_citation"/> | |
| 161 <citation type="bibtex"> | |
| 162 @article{raschkas_2018_mlxtend, | |
| 163 author = {Sebastian Raschka}, | |
| 164 title = {MLxtend: Providing machine learning and data science | |
| 165 utilities and extensions to Python’s | |
| 166 scientific computing stack}, | |
| 167 journal = {The Journal of Open Source Software}, | |
| 168 volume = {3}, | |
| 169 number = {24}, | |
| 170 month = apr, | |
| 171 year = 2018, | |
| 172 publisher = {The Open Journal}, | |
| 173 doi = {10.21105/joss.00638}, | |
| 174 url = {http://joss.theoj.org/papers/10.21105/joss.00638} | |
| 175 } | |
| 176 </citation> | |
| 177 </expand> | |
| 178 </tool> |
