comparison discriminant.xml @ 35:eeaf989f1024 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
author bgruening
date Tue, 13 Apr 2021 18:09:01 +0000
parents 64b771b1471a
children d769d83ec796
comparison
equal deleted inserted replaced
34:2d032cff49eb 35:eeaf989f1024
1 <tool id="sklearn_discriminant_classifier" name="Discriminant Analysis" version="@VERSION@"> 1 <tool id="sklearn_discriminant_classifier" name="Discriminant Analysis" version="@VERSION@" profile="20.05">
2 <description></description> 2 <description></description>
3 <macros> 3 <macros>
4 <import>main_macros.xml</import> 4 <import>main_macros.xml</import>
5 <!--macro name="priors"--> 5 <!--macro name="priors"-->
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 "$discriminant_script" '$inputs' 11 python "$discriminant_script" '$inputs'
12 ]]> 12 ]]>
13 </command> 13 </command>
14 <configfiles> 14 <configfiles>
15 <inputs name="inputs"/> 15 <inputs name="inputs" />
16 <configfile name="discriminant_script"> 16 <configfile name="discriminant_script">
17 <![CDATA[ 17 <![CDATA[
18 import json 18 import json
19 import numpy as np 19 import numpy as np
20 import pandas 20 import pandas
21 import pickle 21 import pickle
22 import sklearn.discriminant_analysis 22 import sklearn.discriminant_analysis
63 <param name="selected_algorithm" type="select" label="Classifier type"> 63 <param name="selected_algorithm" type="select" label="Classifier type">
64 <option value="LinearDiscriminantAnalysis" selected="true">Linear Discriminant Classifier</option> 64 <option value="LinearDiscriminantAnalysis" selected="true">Linear Discriminant Classifier</option>
65 <option value="QuadraticDiscriminantAnalysis">Quadratic Discriminant Classifier</option> 65 <option value="QuadraticDiscriminantAnalysis">Quadratic Discriminant Classifier</option>
66 </param> 66 </param>
67 <when value="LinearDiscriminantAnalysis"> 67 <when value="LinearDiscriminantAnalysis">
68 <expand macro="sl_mixed_input"/> 68 <expand macro="sl_mixed_input" />
69 <section name="options" title="Advanced Options" expanded="False"> 69 <section name="options" title="Advanced Options" expanded="False">
70 <param argument="solver" type="select" optional="true" label="Solver" help=""> 70 <param argument="solver" type="select" optional="true" label="Solver" help="">
71 <option value="svd" selected="true">Singular Value Decomposition</option> 71 <option value="svd" selected="true">Singular Value Decomposition</option>
72 <option value="lsqr">Least Squares Solution</option> 72 <option value="lsqr">Least Squares Solution</option>
73 <option value="eigen">Eigenvalue Decomposition</option> 73 <option value="eigen">Eigenvalue Decomposition</option>
74 </param> 74 </param>
75 <!--param name="shrinkage"--> 75 <!--param name="shrinkage"-->
76 <!--expand macro="priors"/--> 76 <!--expand macro="priors"/-->
77 <param argument="n_components" type="integer" optional="true" value="" label="Number of components" 77 <param argument="n_components" type="integer" optional="true" value="" label="Number of components" help="Number of components for dimensionality reduction. ( always less than n_classes - 1 )" />
78 help="Number of components for dimensionality reduction. ( always less than n_classes - 1 )"/> 78 <expand macro="tol" default_value="0.0001" help_text="Rank estimation threshold used in SVD solver." />
79 <expand macro="tol" default_value="0.0001" help_text="Rank estimation threshold used in SVD solver."/> 79 <param argument="store_covariance" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="false" label="Store covariance" help="Compute class covariance matrix." />
80 <param argument="store_covariance" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="false"
81 label="Store covariance" help="Compute class covariance matrix."/>
82 </section> 80 </section>
83 </when> 81 </when>
84 <when value="QuadraticDiscriminantAnalysis"> 82 <when value="QuadraticDiscriminantAnalysis">
85 <expand macro="sl_mixed_input"/> 83 <expand macro="sl_mixed_input" />
86 <section name="options" title="Advanced Options" expanded="False"> 84 <section name="options" title="Advanced Options" expanded="False">
87 <!--expand macro="priors"/--> 85 <!--expand macro="priors"/-->
88 <param argument="reg_param" type="float" optional="true" value="0.0" label="Regularization coefficient" help="Covariance estimate regularizer."/> 86 <param argument="reg_param" type="float" optional="true" value="0.0" label="Regularization coefficient" help="Covariance estimate regularizer." />
89 <expand macro="tol" default_value="0.00001" help_text="Rank estimation threshold used in SVD solver."/> 87 <expand macro="tol" default_value="0.00001" help_text="Rank estimation threshold used in SVD solver." />
90 <param argument="store_covariance" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="false" 88 <param argument="store_covariance" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="false" label="Store covariances" help="Compute class covariance matrixes." />
91 label="Store covariances" help="Compute class covariance matrixes."/>
92 </section> 89 </section>
93 </when> 90 </when>
94 </expand> 91 </expand>
95 </inputs> 92 </inputs>
96 <expand macro="output"/> 93 <expand macro="output" />
97 <tests> 94 <tests>
98 <test> 95 <test>
99 <param name="infile1" value="train.tabular" ftype="tabular"/> 96 <param name="infile1" value="train.tabular" ftype="tabular" />
100 <param name="infile2" value="train.tabular" ftype="tabular"/> 97 <param name="infile2" value="train.tabular" ftype="tabular" />
101 <param name="header1" value="True"/> 98 <param name="header1" value="True" />
102 <param name="header2" value="True"/> 99 <param name="header2" value="True" />
103 <param name="col1" value="1,2,3,4"/> 100 <param name="col1" value="1,2,3,4" />
104 <param name="col2" value="5"/> 101 <param name="col2" value="5" />
105 <param name="selected_task" value="train"/> 102 <param name="selected_task" value="train" />
106 <param name="selected_algorithm" value="LinearDiscriminantAnalysis"/> 103 <param name="selected_algorithm" value="LinearDiscriminantAnalysis" />
107 <param name="solver" value="svd" /> 104 <param name="solver" value="svd" />
108 <param name="store_covariance" value="True"/> 105 <param name="store_covariance" value="True" />
109 <output name="outfile_fit" file="lda_model01" compare="sim_size" delta="1"/> 106 <output name="outfile_fit" file="lda_model01" compare="sim_size" delta="1" />
110 </test> 107 </test>
111 <test> 108 <test>
112 <param name="infile1" value="train.tabular" ftype="tabular"/> 109 <param name="infile1" value="train.tabular" ftype="tabular" />
113 <param name="infile2" value="train.tabular" ftype="tabular"/> 110 <param name="infile2" value="train.tabular" ftype="tabular" />
114 <param name="header1" value="True"/> 111 <param name="header1" value="True" />
115 <param name="header2" value="True"/> 112 <param name="header2" value="True" />
116 <param name="col1" value="1,2,3,4"/> 113 <param name="col1" value="1,2,3,4" />
117 <param name="col2" value="5"/> 114 <param name="col2" value="5" />
118 <param name="selected_task" value="train"/> 115 <param name="selected_task" value="train" />
119 <param name="selected_algorithm" value="LinearDiscriminantAnalysis"/> 116 <param name="selected_algorithm" value="LinearDiscriminantAnalysis" />
120 <param name="solver" value="lsqr"/> 117 <param name="solver" value="lsqr" />
121 <output name="outfile_fit" file="lda_model02" compare="sim_size" delta="1"/> 118 <output name="outfile_fit" file="lda_model02" compare="sim_size" delta="1" />
122 </test> 119 </test>
123 <test> 120 <test>
124 <param name="infile1" value="train.tabular" ftype="tabular"/> 121 <param name="infile1" value="train.tabular" ftype="tabular" />
125 <param name="infile2" value="train.tabular" ftype="tabular"/> 122 <param name="infile2" value="train.tabular" ftype="tabular" />
126 <param name="header1" value="True"/> 123 <param name="header1" value="True" />
127 <param name="header2" value="True"/> 124 <param name="header2" value="True" />
128 <param name="col1" value="1,2,3,4"/> 125 <param name="col1" value="1,2,3,4" />
129 <param name="col2" value="5"/> 126 <param name="col2" value="5" />
130 <param name="selected_task" value="train"/> 127 <param name="selected_task" value="train" />
131 <param name="selected_algorithm" value="QuadraticDiscriminantAnalysis"/> 128 <param name="selected_algorithm" value="QuadraticDiscriminantAnalysis" />
132 <output name="outfile_fit" file="qda_model01" compare="sim_size" delta="1"/> 129 <output name="outfile_fit" file="qda_model01" compare="sim_size" delta="1" />
133 </test> 130 </test>
134 <test> 131 <test>
135 <param name="infile_model" value="lda_model01" ftype="zip"/> 132 <param name="infile_model" value="lda_model01" ftype="zip" />
136 <param name="infile_data" value="test.tabular" ftype="tabular"/> 133 <param name="infile_data" value="test.tabular" ftype="tabular" />
137 <param name="header" value="True"/> 134 <param name="header" value="True" />
138 <param name="selected_task" value="load"/> 135 <param name="selected_task" value="load" />
139 <output name="outfile_predict" file="lda_prediction_result01.tabular"/> 136 <output name="outfile_predict" file="lda_prediction_result01.tabular" />
140 </test> 137 </test>
141 <test> 138 <test>
142 <param name="infile_model" value="lda_model02" ftype="zip"/> 139 <param name="infile_model" value="lda_model02" ftype="zip" />
143 <param name="infile_data" value="test.tabular" ftype="tabular"/> 140 <param name="infile_data" value="test.tabular" ftype="tabular" />
144 <param name="header" value="True"/> 141 <param name="header" value="True" />
145 <param name="selected_task" value="load"/> 142 <param name="selected_task" value="load" />
146 <output name="outfile_predict" file="lda_prediction_result02.tabular"/> 143 <output name="outfile_predict" file="lda_prediction_result02.tabular" />
147 </test> 144 </test>
148 <test> 145 <test>
149 <param name="infile_model" value="qda_model01" ftype="zip"/> 146 <param name="infile_model" value="qda_model01" ftype="zip" />
150 <param name="infile_data" value="test.tabular" ftype="tabular"/> 147 <param name="infile_data" value="test.tabular" ftype="tabular" />
151 <param name="header" value="True"/> 148 <param name="header" value="True" />
152 <param name="selected_task" value="load"/> 149 <param name="selected_task" value="load" />
153 <output name="outfile_predict" file="qda_prediction_result01.tabular"/> 150 <output name="outfile_predict" file="qda_prediction_result01.tabular" />
154 </test> 151 </test>
155 </tests> 152 </tests>
156 <help><![CDATA[ 153 <help><![CDATA[
157 ***What it does*** 154 ***What it does***
158 Linear and Quadratic Discriminant Analysis are two classic classifiers with a linear and a quadratic decision surface respectively. These classifiers are fast and easy to interprete. 155 Linear and Quadratic Discriminant Analysis are two classic classifiers with a linear and a quadratic decision surface respectively. These classifiers are fast and easy to interprete.
206 Discriminant Analysis is based on sklearn.discriminant_analysis library from Scikit-learn. 203 Discriminant Analysis is based on sklearn.discriminant_analysis library from Scikit-learn.
207 For more information please refer to `Scikit-learn site`_. 204 For more information please refer to `Scikit-learn site`_.
208 205
209 .. _`Scikit-learn site`: http://scikit-learn.org/stable/modules/lda_qda.html 206 .. _`Scikit-learn site`: http://scikit-learn.org/stable/modules/lda_qda.html
210 207
211 ]]></help> 208 ]]> </help>
212 <expand macro="sklearn_citation"/> 209 <expand macro="sklearn_citation" />
213 </tool> 210 </tool>