0
|
1 <?xml version="1.0" ?>
|
14
|
2 <tool id="qiime_sample-classifier_fit-regressor" name="qiime sample-classifier fit-regressor"
|
|
3 version="2020.8">
|
|
4 <description>Fit a supervised learning regressor.</description>
|
|
5 <requirements>
|
|
6 <requirement type="package" version="2020.8">qiime2</requirement>
|
|
7 </requirements>
|
|
8 <command><![CDATA[
|
0
|
9 qiime sample-classifier fit-regressor
|
|
10
|
|
11 --i-table=$itable
|
14
|
12 # if $input_files_mmetadatafile:
|
|
13 # def list_dict_to_string(list_dict):
|
|
14 # set $file_list = list_dict[0]['additional_input'].__getattr__('file_name')
|
|
15 # for d in list_dict[1:]:
|
|
16 # set $file_list = $file_list + ' --m-metadata-file=' + d['additional_input'].__getattr__('file_name')
|
|
17 # end for
|
|
18 # return $file_list
|
|
19 # end def
|
|
20 --m-metadata-file=$list_dict_to_string($input_files_mmetadatafile)
|
|
21 # end if
|
0
|
22
|
14
|
23 #if '__ob__' in str($mmetadatacolumn):
|
|
24 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__ob__', '[')
|
|
25 #set $mmetadatacolumn = $mmetadatacolumn_temp
|
|
26 #end if
|
|
27 #if '__cb__' in str($mmetadatacolumn):
|
|
28 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__cb__', ']')
|
|
29 #set $mmetadatacolumn = $mmetadatacolumn_temp
|
|
30 #end if
|
|
31 #if 'X' in str($mmetadatacolumn):
|
|
32 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('X', '\\')
|
|
33 #set $mmetadatacolumn = $mmetadatacolumn_temp
|
|
34 #end if
|
|
35 #if '__sq__' in str($mmetadatacolumn):
|
|
36 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__sq__', "'")
|
|
37 #set $mmetadatacolumn = $mmetadatacolumn_temp
|
|
38 #end if
|
|
39 #if '__db__' in str($mmetadatacolumn):
|
|
40 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__db__', '"')
|
|
41 #set $mmetadatacolumn = $mmetadatacolumn_temp
|
0
|
42 #end if
|
|
43
|
14
|
44 --m-metadata-column=$mmetadatacolumn
|
|
45
|
|
46
|
|
47 --p-step=$pstep
|
|
48
|
|
49 --p-cv=$pcv
|
0
|
50
|
|
51 #if str($prandomstate):
|
14
|
52 --p-random-state=$prandomstate
|
0
|
53 #end if
|
14
|
54 --p-n-jobs=$pnjobs
|
0
|
55
|
14
|
56 --p-n-estimators=$pnestimators
|
0
|
57
|
|
58 #if str($pestimator) != 'None':
|
14
|
59 --p-estimator=$pestimator
|
0
|
60 #end if
|
|
61
|
|
62 #if $poptimizefeatureselection:
|
|
63 --p-optimize-feature-selection
|
|
64 #end if
|
|
65
|
|
66 #if $pparametertuning:
|
|
67 --p-parameter-tuning
|
|
68 #end if
|
|
69
|
|
70 #if str($pmissingsamples) != 'None':
|
14
|
71 --p-missing-samples=$pmissingsamples
|
0
|
72 #end if
|
|
73
|
|
74 --o-sample-estimator=osampleestimator
|
14
|
75
|
0
|
76 --o-feature-importance=ofeatureimportance
|
14
|
77
|
|
78 #if str($examples) != 'None':
|
|
79 --examples=$examples
|
|
80 #end if
|
|
81
|
0
|
82 ;
|
|
83 cp ofeatureimportance.qza $ofeatureimportance
|
|
84
|
14
|
85 ]]></command>
|
|
86 <inputs>
|
|
87 <param format="qza,no_unzip.zip" label="--i-table: ARTIFACT FeatureTable[Frequency] Feature table containing all features that should be used for target prediction. [required]" name="itable" optional="False" type="data" />
|
|
88 <repeat name="input_files_mmetadatafile" optional="True" title="--m-metadata-file">
|
|
89 <param format="tabular,qza,no_unzip.zip" label="--m-metadata-file: METADATA" name="additional_input" optional="True" type="data" />
|
|
90 </repeat>
|
|
91 <param label="--m-metadata-column: COLUMN MetadataColumn[Numeric] Numeric metadata column to use as prediction target. [required]" name="mmetadatacolumn" optional="False" type="text" />
|
|
92 <param exclude_min="True" label="--p-step: PROPORTION Range(0.0, 1.0, inclusive_start=False) If optimize-feature-selection is True, step is the percentage of features to remove at each iteration. [default: 0.05]" max="1.0" min="0.0" name="pstep" optional="True" type="float" value="0.05" />
|
|
93 <param label="--p-cv: INTEGER Number of k-fold cross-validations to perform. Range(1, None) [default: 5]" min="1" name="pcv" optional="True" type="integer" value="5" />
|
|
94 <param label="--p-random-state: INTEGER Seed used by random number generator. [optional]" name="prandomstate" optional="False" type="text" />
|
|
95 <param label="--p-n-estimators: INTEGER Range(1, None) Number of trees to grow for estimation. More trees will improve predictive accuracy up to a threshold level, but will also increase time and memory requirements. This parameter only affects ensemble estimators, such as Random Forest, AdaBoost, ExtraTrees, and GradientBoosting. [default: 100]" min="1" name="pnestimators" optional="True" type="integer" value="100" />
|
|
96 <param label="--p-estimator: " name="pestimator" optional="True" type="select">
|
|
97 <option selected="True" value="None">Selection is Optional</option>
|
|
98 <option value="RandomForestRegressor">RandomForestRegressor</option>
|
|
99 <option value="ExtraTreesRegressor">ExtraTreesRegressor</option>
|
|
100 <option value="GradientBoostingRegressor">GradientBoostingRegressor</option>
|
|
101 <option value="AdaBoostRegressor">AdaBoostRegressor</option>
|
|
102 <option value="ElasticNet">ElasticNet</option>
|
|
103 <option value="Ridge">Ridge</option>
|
|
104 <option value="Lasso">Lasso</option>
|
|
105 <option value="KNeighborsRegressor">KNeighborsRegressor</option>
|
|
106 <option value="LinearSVR">LinearSVR</option>
|
|
107 <option value="SVR">SVR</option>
|
|
108 </param>
|
|
109 <param label="--p-optimize-feature-selection: --p-optimize-feature-selection: / --p-no-optimize-feature-selection Automatically optimize input feature selection using recursive feature elimination. [default: False]" name="poptimizefeatureselection" selected="False" type="boolean" />
|
|
110 <param label="--p-parameter-tuning: --p-parameter-tuning: / --p-no-parameter-tuning Automatically tune hyperparameters using random grid search. [default: False]" name="pparametertuning" selected="False" type="boolean" />
|
|
111 <param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
|
|
112 <option selected="True" value="None">Selection is Optional</option>
|
|
113 <option value="error">error</option>
|
|
114 <option value="ignore">ignore</option>
|
|
115 </param>
|
|
116 <param label="--examples: Show usage examples and exit." name="examples" optional="False" type="data" />
|
|
117
|
|
118 </inputs>
|
0
|
119
|
14
|
120 <outputs>
|
|
121 <data format="qza" label="${tool.name} on ${on_string}: sampleestimator.qza" name="osampleestimator" />
|
|
122 <data format="qza" label="${tool.name} on ${on_string}: featureimportance.qza" name="ofeatureimportance" />
|
|
123
|
|
124 </outputs>
|
|
125
|
|
126 <help><![CDATA[
|
0
|
127 Fit a supervised learning regressor.
|
14
|
128 ###############################################################
|
0
|
129
|
|
130 Fit a supervised learning regressor. Outputs the fit estimator (for
|
|
131 prediction of test samples and/or unknown samples) and the relative
|
|
132 importance of each feature for model accuracy. Optionally use k-fold cross-
|
|
133 validation for automatic recursive feature elimination and hyperparameter
|
|
134 tuning.
|
|
135
|
|
136 Parameters
|
|
137 ----------
|
|
138 table : FeatureTable[Frequency]
|
|
139 Feature table containing all features that should be used for target
|
|
140 prediction.
|
|
141 metadata : MetadataColumn[Numeric]
|
|
142 Numeric metadata column to use as prediction target.
|
|
143 step : Float % Range(0.0, 1.0, inclusive_start=False), optional
|
|
144 If optimize_feature_selection is True, step is the percentage of
|
|
145 features to remove at each iteration.
|
|
146 cv : Int % Range(1, None), optional
|
|
147 Number of k-fold cross-validations to perform.
|
|
148 random_state : Int, optional
|
|
149 Seed used by random number generator.
|
14
|
150 n_jobs : Int, optional
|
|
151 Number of jobs to run in parallel.
|
0
|
152 n_estimators : Int % Range(1, None), optional
|
|
153 Number of trees to grow for estimation. More trees will improve
|
|
154 predictive accuracy up to a threshold level, but will also increase
|
|
155 time and memory requirements. This parameter only affects ensemble
|
|
156 estimators, such as Random Forest, AdaBoost, ExtraTrees, and
|
|
157 GradientBoosting.
|
|
158 estimator : Str % Choices('RandomForestRegressor', 'ExtraTreesRegressor', 'GradientBoostingRegressor', 'AdaBoostRegressor', 'ElasticNet', 'Ridge', 'Lasso', 'KNeighborsRegressor', 'LinearSVR', 'SVR'), optional
|
|
159 Estimator method to use for sample prediction.
|
|
160 optimize_feature_selection : Bool, optional
|
|
161 Automatically optimize input feature selection using recursive feature
|
|
162 elimination.
|
|
163 parameter_tuning : Bool, optional
|
|
164 Automatically tune hyperparameters using random grid search.
|
|
165 missing_samples : Str % Choices('error', 'ignore'), optional
|
|
166 How to handle missing samples in metadata. "error" will fail if missing
|
|
167 samples are detected. "ignore" will cause the feature table and
|
|
168 metadata to be filtered, so that only samples found in both files are
|
|
169 retained.
|
|
170
|
|
171 Returns
|
|
172 -------
|
|
173 sample_estimator : SampleEstimator[Regressor]
|
|
174 feature_importance : FeatureData[Importance]
|
|
175 Importance of each input feature to model accuracy.
|
14
|
176 ]]></help>
|
|
177 <macros>
|
0
|
178 <import>qiime_citation.xml</import>
|
14
|
179 </macros>
|
|
180 <expand macro="qiime_citation"/>
|
|
181 </tool> |