Mercurial > repos > bgruening > ml_visualization_ex
comparison ml_visualization_ex.xml @ 0:f96efab83b65 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ba6a47bdf76bbf4cb276206ac1a8cbf61332fd16"
author | bgruening |
---|---|
date | Fri, 13 Sep 2019 12:23:39 -0400 |
parents | |
children | 09efff9a5765 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f96efab83b65 |
---|---|
1 <tool id="ml_visualization_ex" name="Machine Learning Visualization Extension" version="@VERSION@"> | |
2 <description>includes several types of plotting for machine learning</description> | |
3 <macros> | |
4 <import>main_macros.xml</import> | |
5 <import>keras_macros.xml</import> | |
6 </macros> | |
7 <expand macro="python_requirements"> | |
8 <requirement type="package" version="3.1.1">plotly</requirement> | |
9 <requirement type="package" version="2.40.1">graphviz</requirement> | |
10 <requirement type="package" version="1.4.1">pydot</requirement> | |
11 </expand> | |
12 <expand macro="macro_stdio"/> | |
13 <version_command>echo "@VERSION@"</version_command> | |
14 <command> | |
15 <![CDATA[ | |
16 python '$__tool_directory__/ml_visualization_ex.py' | |
17 --inputs '$inputs' | |
18 #if $plotting_selection.plot_type in ['learning_curve', 'rfecv_gridscores'] | |
19 --infile1 '$plotting_selection.infile1' | |
20 #elif $plotting_selection.plot_type in ['pr_curve', 'roc_curve'] | |
21 --infile1 '$plotting_selection.infile1' | |
22 --infile2 '$plotting_selection.infile2' | |
23 #elif $plotting_selection.plot_type == 'feature_importances' | |
24 --estimator '$plotting_selection.infile_estimator' | |
25 --infile1 '$plotting_selection.infile1' | |
26 #elif $plotting_selection.plot_type == 'keras_plot_model' | |
27 --model_config '$plotting_selection.infile_model_config' | |
28 #end if | |
29 ]]> | |
30 </command> | |
31 <configfiles> | |
32 <inputs name="inputs" /> | |
33 </configfiles> | |
34 <inputs> | |
35 <conditional name="plotting_selection"> | |
36 <param name="plot_type" type="select" label="Select a plotting type"> | |
37 <option value="learning_curve" selected="true">Learning curve</option> | |
38 <option value="pr_curve">2-class Precison Recall curve</option> | |
39 <option value="roc_curve">2-class Receiver Operating Characteristic (ROC) curve</option> | |
40 <option value="rfecv_gridscores">Number of features vs. Recursive Feature Elimination gridscores with corss-validation</option> | |
41 <option value="feature_importances">Feature Importances plot</option> | |
42 <option value="keras_plot_model">keras plot model - plot configuration of a neural network model</option> | |
43 </param> | |
44 <when value="learning_curve"> | |
45 <param name="infile1" type="data" format="tabular" label="Select the dataset containing values for plotting learning curve." help="This dataset should be the output of tool model_validation->learning_curve."/> | |
46 <param name="plot_std_err" type="boolean" truevalue="booltrue" falsevalue="boolfalse" optional="true" checked="false" label="Whether to plot standard error bar?"/> | |
47 <param name="title" type="text" value="" optional="true" label="Plot title" help="Optional. If change is desired."/> | |
48 </when> | |
49 <when value="pr_curve"> | |
50 <param name="infile1" type="data" format="tabular" label="Select the dataset containing true labels." help="No headers. Each column corresponds to one class."/> | |
51 <param name="infile2" type="data" format="tabular" label="Select the dataset containing predicted probabilities." help="No headers. Each column corresponds to one class."/> | |
52 <param name="pos_label" type="text" value="" optional="true" label="pos_label" help="The label of positive class. If not specified, it will be 1 by default."/> | |
53 <param name="title" type="text" value="" optional="true" label="Plot title" help="Optional. If change is desired."/> | |
54 </when> | |
55 <when value="roc_curve"> | |
56 <param name="infile1" type="data" format="tabular" label="Select the dataset containing true labels." help="No headers. Each column corresponds to one class."/> | |
57 <param name="infile2" type="data" format="tabular" label="Select the dataset containing predicted probabilities." help="No headers. Each column corresponds to one class."/> | |
58 <param name="pos_label" type="text" value="" optional="true" label="pos_label" help="The label of positive class. If not specified, it will be 1 by default."/> | |
59 <param name="drop_intermediate" type="boolean" truevalue="booltrue" falsevalue="boolfalse" optional="true" checked="true" label="drop_intermediate" help="Whether to drop some suboptimal thresholds which would not appear on a plotted ROC curve."/> | |
60 <param name="title" type="text" value="" optional="true" label="Plot title" help="Optional. If change is desired."/> | |
61 </when> | |
62 <when value="rfecv_gridscores"> | |
63 <param name="infile1" type="data" format="tabular" label="Select the dataset containing grid_scores from a fitted RFECV object." help="Headered. Single column. Could be Output from `estimator_attributes->grid_scores_`."/> | |
64 <param name="steps" type="text" value="" optional="true" label="Step IDs" help="List, containing hover labels for each grid_score. For example: `list(range(10)) + [15, 20]`."/> | |
65 <param name="title" type="text" value="" optional="true" label="Plot title" help="Optional. If change is desired."/> | |
66 </when> | |
67 <when value="feature_importances"> | |
68 <param name="infile_estimator" type="data" format="zip" label="Select the dataset containing fitted estimator/pipeline" /> | |
69 <param name="infile1" type="data" format="tabular" label="Select the dataset containing feature names" help="Make sure the headers (first row) are feature names."/> | |
70 <conditional name="column_selector_options"> | |
71 <expand macro="samples_column_selector_options" multiple="true"/> | |
72 </conditional> | |
73 <param name="threshold" type="float" value="" optional="true" min="0." label="Threshold value" help="Features with importance below the threshold value will be ignored."/> | |
74 <param name="title" type="text" value="" optional="true" label="Custom plot title" help="Optional."/> | |
75 </when> | |
76 <when value="keras_plot_model"> | |
77 <param name="infile_model_config" type="data" format="json" label="Select the JSON dataset containing configuration for a neural network model"/> | |
78 <param name="title" type="hidden" value="" optional="true" label="Plot title" help="Optional. If change is desired."/> | |
79 </when> | |
80 </conditional> | |
81 </inputs> | |
82 <outputs> | |
83 <data name="output" format="html" from_work_dir="output" label="${plotting_selection.plot_type} plot on ${on_string}"> | |
84 <change_format> | |
85 <when input="plotting_selection.plot_type" value="keras_plot_model" format="png"/> | |
86 </change_format> | |
87 </data> | |
88 </outputs> | |
89 <tests> | |
90 <test> | |
91 <param name="plot_type" value="roc_curve"/> | |
92 <param name="infile1" value="y_true.tabular" ftype="tabular"/> | |
93 <param name="infile2" value="y_score.tabular" ftype="tabular"/> | |
94 <output name="output" file="ml_vis04.html" compare="sim_size"/> | |
95 </test> | |
96 <test> | |
97 <param name="plot_type" value="feature_importances"/> | |
98 <param name="infile_estimator" value="best_estimator_.zip" ftype="zip"/> | |
99 <param name="infile1" value="regression_X.tabular" ftype="tabular"/> | |
100 <param name="selected_column_selector_option" value="all_columns"/> | |
101 <output name="output" file="ml_vis01.html" compare="sim_size"/> | |
102 </test> | |
103 <test> | |
104 <param name="plot_type" value="learning_curve"/> | |
105 <param name="infile1" value="mv_result03.tabular" ftype="tabular"/> | |
106 <output name="output" file="ml_vis02.html" compare="sim_size"/> | |
107 </test> | |
108 <test> | |
109 <param name="plot_type" value="pr_curve"/> | |
110 <param name="infile1" value="y_true.tabular" ftype="tabular"/> | |
111 <param name="infile2" value="y_score.tabular" ftype="tabular"/> | |
112 <output name="output" file="ml_vis03.html" compare="sim_size"/> | |
113 </test> | |
114 <test> | |
115 <param name="plot_type" value="rfecv_gridscores"/> | |
116 <param name="infile1" value="grid_scores_.tabular" ftype="tabular"/> | |
117 <output name="output" file="ml_vis05.html" compare="sim_size"/> | |
118 </test> | |
119 <test> | |
120 <param name="plot_type" value="keras_plot_model"/> | |
121 <param name="infile_model_config" value="deepsear_1feature.json" ftype="json"/> | |
122 <output name="output" file="ml_vis05.png" compare="sim_size" delta="20000"/> | |
123 </test> | |
124 </tests> | |
125 <help> | |
126 <![CDATA[ | |
127 **What it does** | |
128 This tool ouputs serveral machine learning visualization plots using Plotly, including 'feature_importances', 'learning curve', 'precison recall curve', 'roc_curve', and 'number of featues vs. rfecv gridscores'. This tool also ouputs configuration diagram for a deep learning model using the Keras model JSON file as input. | |
129 | |
130 | |
131 **Feature importances** | |
132 | |
133 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/feature_importances.png | |
134 :width: 400 | |
135 :alt: feature importances | |
136 | |
137 | |
138 **Learning curve** | |
139 | |
140 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/learning_curve.png | |
141 :width: 400 | |
142 :alt: learning curve | |
143 | |
144 | |
145 **Precison recall curve** | |
146 | |
147 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/pr_curve.png | |
148 :width: 400 | |
149 :alt: precison recall curve | |
150 | |
151 | |
152 **Receiver operating characteristic curve** | |
153 | |
154 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/roc_curve.png | |
155 :width: 400 | |
156 :alt: Receiver operating characteristic curve | |
157 | |
158 | |
159 **Number of featues vs. rfecv gridscores** | |
160 | |
161 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/rfecv_gridscore.png | |
162 :width: 400 | |
163 :alt: Number of featues vs. rfecv gridscores | |
164 | |
165 | |
166 **Deep learning model configuration** | |
167 | |
168 .. image:: https://raw.githubusercontent.com/goeckslab/Galaxy-ML/master/galaxy_ml/tools/images/deepsea.png | |
169 :width: 400 | |
170 :alt: deapsea model configuration | |
171 ]]> | |
172 </help> | |
173 <expand macro="sklearn_citation"> | |
174 <citation type="bibtex"> | |
175 @online{plotly, | |
176 author = {Plotly Technologies Inc.}, | |
177 title = {Collaborative data science}, | |
178 publisher = {Plotly Technologies Inc.}, | |
179 address = {Montreal, QC}, | |
180 year = {2015}, | |
181 url = {https://plot.ly}} | |
182 </citation> | |
183 </expand> | |
184 </tool> |