Mercurial > repos > bgruening > sklearn_svm_classifier
comparison svm.xml @ 19:d67dcd63f6cb draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
author | bgruening |
---|---|
date | Tue, 13 Apr 2021 17:32:55 +0000 |
parents | 2df8f5c30edc |
children | b878e4cdd63a |
comparison
equal
deleted
inserted
replaced
18:02d2be90dedb | 19:d67dcd63f6cb |
---|---|
1 <tool id="sklearn_svm_classifier" name="Support vector machines (SVMs)" version="@VERSION@"> | 1 <tool id="sklearn_svm_classifier" name="Support vector machines (SVMs)" version="@VERSION@" profile="20.05"> |
2 <description>for classification</description> | 2 <description>for classification</description> |
3 <macros> | 3 <macros> |
4 <import>main_macros.xml</import> | 4 <import>main_macros.xml</import> |
5 <!-- macro name="class_weight" argument="class_weight"--> | 5 <!-- macro name="class_weight" argument="class_weight"--> |
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><![CDATA[ | 10 <command><![CDATA[ |
11 python '$svc_script' '$inputs' | 11 python '$svc_script' '$inputs' |
12 ]]> | 12 ]]> |
13 </command> | 13 </command> |
14 <configfiles> | 14 <configfiles> |
15 <inputs name="inputs"/> | 15 <inputs name="inputs" /> |
16 <configfile name="svc_script"> | 16 <configfile name="svc_script"> |
17 <![CDATA[ | 17 <![CDATA[ |
18 import sys | 18 import sys |
19 import json | 19 import json |
20 import sklearn.svm | 20 import sklearn.svm |
21 import pandas | 21 import pandas |
22 import pickle | 22 import pickle |
70 <option value="SVC">C-Support Vector Classification</option> | 70 <option value="SVC">C-Support Vector Classification</option> |
71 <option value="NuSVC">Nu-Support Vector Classification</option> | 71 <option value="NuSVC">Nu-Support Vector Classification</option> |
72 <option value="LinearSVC">Linear Support Vector Classification</option> | 72 <option value="LinearSVC">Linear Support Vector Classification</option> |
73 </param> | 73 </param> |
74 <when value="SVC"> | 74 <when value="SVC"> |
75 <expand macro="sl_mixed_input"/> | 75 <expand macro="sl_mixed_input" /> |
76 <expand macro="svc_advanced_options"> | 76 <expand macro="svc_advanced_options"> |
77 <expand macro="C"/> | 77 <expand macro="C" /> |
78 </expand> | 78 </expand> |
79 </when> | 79 </when> |
80 <when value="NuSVC"> | 80 <when value="NuSVC"> |
81 <expand macro="sl_mixed_input"/> | 81 <expand macro="sl_mixed_input" /> |
82 <expand macro="svc_advanced_options"> | 82 <expand macro="svc_advanced_options"> |
83 <param argument="nu" type="float" optional="true" value="0.5" label="Nu control parameter" help="Controls the number of support vectors. Should be in the interval (0, 1]. "/> | 83 <param argument="nu" type="float" optional="true" value="0.5" label="Nu control parameter" help="Controls the number of support vectors. Should be in the interval (0, 1]. " /> |
84 </expand> | 84 </expand> |
85 </when> | 85 </when> |
86 <when value="LinearSVC"> | 86 <when value="LinearSVC"> |
87 <expand macro="sl_mixed_input"/> | 87 <expand macro="sl_mixed_input" /> |
88 <section name="options" title="Advanced Options" expanded="False"> | 88 <section name="options" title="Advanced Options" expanded="False"> |
89 <expand macro="C"/> | 89 <expand macro="C" /> |
90 <expand macro="tol" default_value="0.001" help_text="Tolerance for stopping criterion. "/> | 90 <expand macro="tol" default_value="0.001" help_text="Tolerance for stopping criterion. " /> |
91 <expand macro="random_state" help_text="Integer number. The seed of the pseudo random number generator to use when shuffling the data for probability estimation. A fixed seed allows reproducible results."/> | 91 <expand macro="random_state" help_text="Integer number. The seed of the pseudo random number generator to use when shuffling the data for probability estimation. A fixed seed allows reproducible results." /> |
92 <!--expand macro="class_weight"/--> | 92 <!--expand macro="class_weight"/--> |
93 <param argument="max_iter" type="integer" optional="true" value="1000" label="Maximum number of iterations" help="The maximum number of iterations to be run."/> | 93 <param argument="max_iter" type="integer" optional="true" value="1000" label="Maximum number of iterations" help="The maximum number of iterations to be run." /> |
94 <param argument="loss" type="select" label="Loss function" help="Specifies the loss function. ''squared_hinge'' is the square of the hinge loss."> | 94 <param argument="loss" type="select" label="Loss function" help="Specifies the loss function. ''squared_hinge'' is the square of the hinge loss."> |
95 <option value="squared_hinge" selected="true">Squared hinge</option> | 95 <option value="squared_hinge" selected="true">Squared hinge</option> |
96 <option value="hinge">Hinge</option> | 96 <option value="hinge">Hinge</option> |
97 </param> | 97 </param> |
98 <param argument="penalty" type="select" label="Penalization norm" help=" "> | 98 <param argument="penalty" type="select" label="Penalization norm" help=" "> |
99 <option value="l1" >l1</option> | 99 <option value="l1">l1</option> |
100 <option value="l2" selected="true">l2</option> | 100 <option value="l2" selected="true">l2</option> |
101 </param> | 101 </param> |
102 <param argument="dual" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Use the shrinking heuristic" help="Select the algorithm to either solve the dual or primal optimization problem. Prefer dual=False when n_samples > n_features."/> | 102 <param argument="dual" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Use the shrinking heuristic" help="Select the algorithm to either solve the dual or primal optimization problem. Prefer dual=False when n_samples > n_features." /> |
103 <param argument="multi_class" type="select" label="Multi-class strategy" help="Determines the multi-class strategy if y contains more than two classes."> | 103 <param argument="multi_class" type="select" label="Multi-class strategy" help="Determines the multi-class strategy if y contains more than two classes."> |
104 <option value="ovr" selected="true">ovr</option> | 104 <option value="ovr" selected="true">ovr</option> |
105 <option value="crammer_singer" >crammer_singer</option> | 105 <option value="crammer_singer">crammer_singer</option> |
106 </param> | 106 </param> |
107 <param argument="fit_intercept" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Calculate the intercept for this model" help="If set to false, data is expected to be already centered."/> | 107 <param argument="fit_intercept" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Calculate the intercept for this model" help="If set to false, data is expected to be already centered." /> |
108 <param argument="intercept_scaling" type="float" optional="true" value="1" label="Add synthetic feature to the instance vector" help=" "/> | 108 <param argument="intercept_scaling" type="float" optional="true" value="1" label="Add synthetic feature to the instance vector" help=" " /> |
109 </section> | 109 </section> |
110 </when> | 110 </when> |
111 </expand> | 111 </expand> |
112 </inputs> | 112 </inputs> |
113 <expand macro="output"/> | 113 <expand macro="output" /> |
114 <tests> | 114 <tests> |
115 <test> | 115 <test> |
116 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 116 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
117 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 117 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
118 <param name="header1" value="True"/> | 118 <param name="header1" value="True" /> |
119 <param name="header2" value="True"/> | 119 <param name="header2" value="True" /> |
120 <param name="col1" value="1,2,3,4"/> | 120 <param name="col1" value="1,2,3,4" /> |
121 <param name="col2" value="5"/> | 121 <param name="col2" value="5" /> |
122 <param name="selected_task" value="train"/> | 122 <param name="selected_task" value="train" /> |
123 <param name="selected_algorithm" value="SVC"/> | 123 <param name="selected_algorithm" value="SVC" /> |
124 <param name="random_state" value="5"/> | 124 <param name="random_state" value="5" /> |
125 <output name="outfile_fit" file="svc_model01" compare="sim_size"/> | 125 <output name="outfile_fit" file="svc_model01" compare="sim_size" /> |
126 </test> | 126 </test> |
127 <test> | 127 <test> |
128 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 128 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
129 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 129 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
130 <param name="header1" value="True"/> | 130 <param name="header1" value="True" /> |
131 <param name="header2" value="True"/> | 131 <param name="header2" value="True" /> |
132 <param name="col1" value="1,2,3,4"/> | 132 <param name="col1" value="1,2,3,4" /> |
133 <param name="col2" value="5"/> | 133 <param name="col2" value="5" /> |
134 <param name="selected_task" value="train"/> | 134 <param name="selected_task" value="train" /> |
135 <param name="selected_algorithm" value="NuSVC"/> | 135 <param name="selected_algorithm" value="NuSVC" /> |
136 <param name="random_state" value="5"/> | 136 <param name="random_state" value="5" /> |
137 <output name="outfile_fit" file="svc_model02" compare="sim_size"/> | 137 <output name="outfile_fit" file="svc_model02" compare="sim_size" /> |
138 </test> | 138 </test> |
139 <test> | 139 <test> |
140 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 140 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
141 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 141 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
142 <param name="header1" value="True"/> | 142 <param name="header1" value="True" /> |
143 <param name="header2" value="True"/> | 143 <param name="header2" value="True" /> |
144 <param name="col1" value="1,2,3,4"/> | 144 <param name="col1" value="1,2,3,4" /> |
145 <param name="col2" value="5"/> | 145 <param name="col2" value="5" /> |
146 <param name="selected_task" value="train"/> | 146 <param name="selected_task" value="train" /> |
147 <param name="selected_algorithm" value="LinearSVC"/> | 147 <param name="selected_algorithm" value="LinearSVC" /> |
148 <param name="random_state" value="5"/> | 148 <param name="random_state" value="5" /> |
149 <output name="outfile_fit" file="svc_model03" compare="sim_size"/> | 149 <output name="outfile_fit" file="svc_model03" compare="sim_size" /> |
150 </test> | 150 </test> |
151 <test> | 151 <test> |
152 <param name="infile_model" value="svc_model01" ftype="zip"/> | 152 <param name="infile_model" value="svc_model01" ftype="zip" /> |
153 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 153 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
154 <param name="header" value="True"/> | 154 <param name="header" value="True" /> |
155 <param name="selected_task" value="load"/> | 155 <param name="selected_task" value="load" /> |
156 <output name="outfile_predict" file="svc_prediction_result01.tabular"/> | 156 <output name="outfile_predict" file="svc_prediction_result01.tabular" /> |
157 </test> | 157 </test> |
158 <test> | 158 <test> |
159 <param name="infile_model" value="svc_model02" ftype="zip"/> | 159 <param name="infile_model" value="svc_model02" ftype="zip" /> |
160 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 160 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
161 <param name="header" value="True"/> | 161 <param name="header" value="True" /> |
162 <param name="selected_task" value="load"/> | 162 <param name="selected_task" value="load" /> |
163 <output name="outfile_predict" file="svc_prediction_result02.tabular"/> | 163 <output name="outfile_predict" file="svc_prediction_result02.tabular" /> |
164 </test> | 164 </test> |
165 <test> | 165 <test> |
166 <param name="infile_model" value="svc_model03" ftype="zip"/> | 166 <param name="infile_model" value="svc_model03" ftype="zip" /> |
167 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 167 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
168 <param name="header" value="True"/> | 168 <param name="header" value="True" /> |
169 <param name="selected_task" value="load"/> | 169 <param name="selected_task" value="load" /> |
170 <output name="outfile_predict" file="svc_prediction_result03.tabular"/> | 170 <output name="outfile_predict" file="svc_prediction_result03.tabular" /> |
171 </test> | 171 </test> |
172 <!-- The following test is expected to fail, it is testing the whitelist/blacklist filtering. | 172 <!-- The following test is expected to fail, it is testing the whitelist/blacklist filtering. |
173 It loads a pickle with malicious content that we do not accept. --> | 173 It loads a pickle with malicious content that we do not accept. --> |
174 <test expect_failure="true"> | 174 <test expect_failure="true"> |
175 <param name="infile_model" value="pickle_blacklist" ftype="zip"/> | 175 <param name="infile_model" value="pickle_blacklist" ftype="zip" /> |
176 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 176 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
177 <param name="header" value="True"/> | 177 <param name="header" value="True" /> |
178 <param name="selected_task" value="load"/> | 178 <param name="selected_task" value="load" /> |
179 </test> | 179 </test> |
180 </tests> | 180 </tests> |
181 <help><![CDATA[ | 181 <help><![CDATA[ |
182 **What it does** | 182 **What it does** |
183 This module implements the Support Vector Machine (SVM) classification algorithms. | 183 This module implements the Support Vector Machine (SVM) classification algorithms. |
201 | 201 |
202 For more information check http://scikit-learn.org/stable/modules/neighbors.html | 202 For more information check http://scikit-learn.org/stable/modules/neighbors.html |
203 | 203 |
204 ]]> | 204 ]]> |
205 </help> | 205 </help> |
206 <expand macro="sklearn_citation"/> | 206 <expand macro="sklearn_citation" /> |
207 </tool> | 207 </tool> |