comparison main_macros.xml @ 19:98b632c407ae draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit d00173591e4a783a4c1cb2664e4bb192ab5414f7
author bgruening
date Fri, 17 Aug 2018 12:29:48 -0400
parents 21fdd6cdb88f
children f051d64eb12e
comparison
equal deleted inserted replaced
18:21fdd6cdb88f 19:98b632c407ae
1 <macros> 1 <macros>
2 <token name="@VERSION@">0.9</token> 2 <token name="@VERSION@">0.9</token>
3
4 <token name="@COLUMNS_FUNCTION@">
5 def read_columns(f, c=None, c_option='by_index_number', return_df=False, **args):
6 data = pandas.read_csv(f, **args)
7 if c_option == 'by_index_number':
8 cols = list(map(lambda x: x - 1, c))
9 data = data.iloc[:,cols]
10 if c_option == 'all_but_by_index_number':
11 cols = list(map(lambda x: x - 1, c))
12 data.drop(data.columns[cols], axis=1, inplace=True)
13 if c_option == 'by_header_name':
14 cols = [e.strip() for e in c.split(',')]
15 data = data[cols]
16 if c_option == 'all_but_by_header_name':
17 cols = [e.strip() for e in c.split(',')]
18 data.drop(cols, axis=1, inplace=True)
19 y = data.values
20 if return_df:
21 return y, data
22 else:
23 return y
24 return y
25 </token>
26
27 ## generate an instance for one of sklearn.feature_selection classes
28 <token name="@FEATURE_SELECTOR_FUNCTION@">
29 def feature_selector(inputs):
30 selector = inputs["selected_algorithm"]
31 selector = getattr(sklearn.feature_selection, selector)
32 options = inputs["options"]
33
34 if inputs['selected_algorithm'] == 'SelectFromModel':
35 if not options['threshold'] or options['threshold'] == 'None':
36 options['threshold'] = None
37 if inputs['model_inputter']['input_mode'] == 'prefitted':
38 model_file = inputs['model_inputter']['fitted_estimator']
39 with open(model_file, 'rb') as model_handler:
40 fitted_estimator = pickle.load(model_handler)
41 new_selector = selector(fitted_estimator, prefit=True, **options)
42 else:
43 estimator_json = inputs['model_inputter']["estimator_selector"]
44 estimator = get_estimator(estimator_json)
45 new_selector = selector(estimator, **options)
46
47 elif inputs['selected_algorithm'] in ['RFE', 'RFECV']:
48 if 'scoring' in options and (not options['scoring'] or options['scoring'] == 'None'):
49 options['scoring'] = None
50 estimator=get_estimator(inputs["estimator_selector"])
51 new_selector = selector(estimator, **options)
52
53 elif inputs['selected_algorithm'] == "VarianceThreshold":
54 new_selector = selector(**options)
55
56 else:
57 score_func = inputs["score_func"]
58 score_func = getattr(sklearn.feature_selection, score_func)
59 new_selector = selector(score_func, **options)
60
61 return new_selector
62 </token>
63
64 <token name="@GET_X_y_FUNCTION@">
65 def get_X_y(params, file1, file2):
66 input_type = params["selected_tasks"]["selected_algorithms"]["input_options"]["selected_input"]
67 if input_type=="tabular":
68 header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header1"] else None
69 column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["selected_column_selector_option"]
70 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
71 c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["col1"]
72 else:
73 c = None
74 X = read_columns(
75 file1,
76 c = c,
77 c_option = column_option,
78 sep='\t',
79 header=header,
80 parse_dates=True
81 )
82 else:
83 X = mmread(file1)
84
85 header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header2"] else None
86 column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["selected_column_selector_option2"]
87 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
88 c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["col2"]
89 else:
90 c = None
91 y = read_columns(
92 file2,
93 c = c,
94 c_option = column_option,
95 sep='\t',
96 header=header,
97 parse_dates=True
98 )
99 y=y.ravel()
100 return X, y
101 </token>
102
103 <token name="@SAFE_EVAL_FUNCTION@">
104 def safe_eval(literal):
105
106 FROM_SCIPY_STATS = [ 'bernoulli', 'binom', 'boltzmann', 'dlaplace', 'geom', 'hypergeom',
107 'logser', 'nbinom', 'planck', 'poisson', 'randint', 'skellam', 'zipf' ]
108
109 FROM_NUMPY_RANDOM = [ 'beta', 'binomial', 'bytes', 'chisquare', 'choice', 'dirichlet', 'division',
110 'exponential', 'f', 'gamma', 'geometric', 'gumbel', 'hypergeometric',
111 'laplace', 'logistic', 'lognormal', 'logseries', 'mtrand', 'multinomial',
112 'multivariate_normal', 'negative_binomial', 'noncentral_chisquare', 'noncentral_f',
113 'normal', 'pareto', 'permutation', 'poisson', 'power', 'rand', 'randint',
114 'randn', 'random', 'random_integers', 'random_sample', 'ranf', 'rayleigh',
115 'sample', 'seed', 'set_state', 'shuffle', 'standard_cauchy', 'standard_exponential',
116 'standard_gamma', 'standard_normal', 'standard_t', 'triangular', 'uniform',
117 'vonmises', 'wald', 'weibull', 'zipf' ]
118
119 # File opening and other unneeded functions could be dropped
120 UNWANTED = ['open', 'type', 'dir', 'id', 'str', 'repr']
121
122 # Allowed symbol table. Add more if needed.
123 new_syms = {
124 'np_arange': getattr(np, 'arange'),
125 'ensemble_ExtraTreesClassifier': getattr(ensemble, 'ExtraTreesClassifier')
126 }
127
128 syms = make_symbol_table(use_numpy=False, **new_syms)
129
130 for method in FROM_SCIPY_STATS:
131 syms['scipy_stats_' + method] = getattr(scipy.stats, method)
132
133 for func in FROM_NUMPY_RANDOM:
134 syms['np_random_' + func] = getattr(np.random, func)
135
136 for key in UNWANTED:
137 syms.pop(key, None)
138
139 aeval = Interpreter(symtable=syms, use_numpy=False, minimal=False,
140 no_if=True, no_for=True, no_while=True, no_try=True,
141 no_functiondef=True, no_ifexp=True, no_listcomp=False,
142 no_augassign=False, no_assert=True, no_delete=True,
143 no_raise=True, no_print=True)
144
145 return aeval(literal)
146 </token>
147
148 <token name="@GET_SEARCH_PARAMS_FUNCTION@">
149 def get_search_params(params_builder):
150 search_params = {}
151
152 for p in params_builder['param_set']:
153 search_p = p['search_param_selector']['search_p']
154 if search_p.strip() == '':
155 continue
156 param_type = p['search_param_selector']['selected_param_type']
157
158 lst = search_p.split(":")
159 assert (len(lst) == 2), "Error, make sure there is one and only one colon in search parameter input."
160 literal = lst[1].strip()
161 ev = safe_eval(literal)
162 if param_type == "final_estimator_p":
163 search_params["estimator__" + lst[0].strip()] = ev
164 else:
165 search_params["preprocessing_" + param_type[5:6] + "__" + lst[0].strip()] = ev
166
167 return search_params
168 </token>
169
170 <token name="@GET_ESTIMATOR_FUNCTION@">
171 def get_estimator(estimator_json):
172 estimator_module = estimator_json['selected_module']
173 estimator_cls = estimator_json['selected_estimator']
174
175 if estimator_module == "xgboost":
176 cls = getattr(xgboost, estimator_cls)
177 else:
178 module = getattr(sklearn, estimator_module)
179 cls = getattr(module, estimator_cls)
180
181 estimator = cls()
182
183 estimator_params = estimator_json['text_params'].strip()
184 if estimator_params != "":
185 try:
186 params = ast.literal_eval('{' + estimator_params + '}')
187 except ValueError:
188 sys.exit("Unsupported parameter input: `%s`" %estimator_params)
189 estimator.set_params(**params)
190
191 return estimator
192 </token>
193
194 <token name="@GET_CV_FUNCTION@">
195 def get_cv(literal):
196 if literal == "":
197 return None
198 if re.match(r'^\d+$', literal):
199 return int(literal)
200 m = re.match(r'^(?P&lt;method&gt;\w+)\((?P&lt;args&gt;.*)\)$', literal)
201 if m:
202 my_class = getattr( model_selection, m.group('method') )
203 args = safe_eval( 'dict('+ m.group('args') + ')' )
204 return my_class( **args )
205 sys.exit("Unsupported CV input: %s" %literal)
206 </token>
207 3
208 <xml name="python_requirements"> 4 <xml name="python_requirements">
209 <requirements> 5 <requirements>
210 <requirement type="package" version="2.7">python</requirement> 6 <requirement type="package" version="2.7">python</requirement>
211 <requirement type="package" version="0.19.1">scikit-learn</requirement> 7 <requirement type="package" version="0.19.1">scikit-learn</requirement>
212 <requirement type="package" version="0.22.0">pandas</requirement> 8 <requirement type="package" version="0.22.0">pandas</requirement>
213 <requirement type="package" version="0.72.1">xgboost</requirement> 9 <requirement type="package" version="0.72.1">xgboost</requirement>
10 <requirement type="package" version="0.9.12">asteval</requirement>
214 <yield /> 11 <yield />
215 </requirements> 12 </requirements>
216 </xml> 13 </xml>
217 14
218 <xml name="macro_stdio"> 15 <xml name="macro_stdio">
437 234
438 <xml name="fit_intercept" token_checked="true"> 235 <xml name="fit_intercept" token_checked="true">
439 <param argument="fit_intercept" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="@CHECKED@" label="Estimate the intercept" help="If false, the data is assumed to be already centered."/> 236 <param argument="fit_intercept" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="@CHECKED@" label="Estimate the intercept" help="If false, the data is assumed to be already centered."/>
440 </xml> 237 </xml>
441 238
442 <xml name="n_jobs" token_default_value="1" token_label="The number of jobs to run in parallel for both fit and predict">
443 <param argument="n_jobs" type="integer" value="@DEFAULT_VALUE@" optional="true" label="@LABEL@" help="If -1, then the number of jobs is set to the number of cores"/>
444 </xml>
445
446 <xml name="n_iter" token_default_value="5" token_help_text="The number of passes over the training data (aka epochs). "> 239 <xml name="n_iter" token_default_value="5" token_help_text="The number of passes over the training data (aka epochs). ">
447 <param argument="n_iter" type="integer" optional="true" value="@DEFAULT_VALUE@" label="Number of iterations" help="@HELP_TEXT@"/> 240 <param argument="n_iter" type="integer" optional="true" value="@DEFAULT_VALUE@" label="Number of iterations" help="@HELP_TEXT@"/>
448 </xml> 241 </xml>
449 242
450 <xml name="shuffle" token_checked="true" token_help_text=" " token_label="Shuffle data after each iteration"> 243 <xml name="shuffle" token_checked="true" token_help_text=" " token_label="Shuffle data after each iteration">
540 <param name="infile1" type="data" format="tabular" label="Training samples dataset:"/> 333 <param name="infile1" type="data" format="tabular" label="Training samples dataset:"/>
541 <param name="header1" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="False" label="Does the dataset contain header:" /> 334 <param name="header1" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="False" label="Does the dataset contain header:" />
542 <conditional name="column_selector_options_1"> 335 <conditional name="column_selector_options_1">
543 <expand macro="samples_column_selector_options" multiple="@MULTIPLE1@"/> 336 <expand macro="samples_column_selector_options" multiple="@MULTIPLE1@"/>
544 </conditional> 337 </conditional>
545 <param name="infile2" type="data" format="tabular" label="Dataset containing class labels:"/> 338 <param name="infile2" type="data" format="tabular" label="Dataset containing class labels or target values:"/>
546 <param name="header2" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="False" label="Does the dataset contain header:" /> 339 <param name="header2" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="False" label="Does the dataset contain header:" />
547 <conditional name="column_selector_options_2"> 340 <conditional name="column_selector_options_2">
548 <expand macro="samples_column_selector_options" column_option="selected_column_selector_option2" col_name="col2" multiple="@MULTIPLE2@" infile="infile2"/> 341 <expand macro="samples_column_selector_options" column_option="selected_column_selector_option2" col_name="col2" multiple="@MULTIPLE2@" infile="infile2"/>
549 </conditional> 342 </conditional>
550 <yield/> 343 <yield/>
1029 <when value="new"> 822 <when value="new">
1030 <expand macro="estimator_selector_all"/> 823 <expand macro="estimator_selector_all"/>
1031 </when> 824 </when>
1032 </xml> 825 </xml>
1033 826
827 <xml name="cv">
828 <param argument="cv" type="text" value="" optional="true" label="cv" help="Optional. Integer or evalable splitter object, e.g., StratifiedKFold(n_splits=3, shuffle=True, random_state=10). Leave blank for default." >
829 <sanitizer>
830 <valid initial="default">
831 <add value="&apos;"/>
832 </valid>
833 </sanitizer>
834 </param>
835 </xml>
836
1034 <xml name="feature_selection_all"> 837 <xml name="feature_selection_all">
1035 <conditional name="fs_algorithm_selector"> 838 <conditional name="fs_algorithm_selector">
1036 <param name="selected_algorithm" type="select" label="Select a feature selection algorithm"> 839 <param name="selected_algorithm" type="select" label="Select a feature selection algorithm">
1037 <option value="SelectKBest" selected="true">SelectKBest - Select features according to the k highest scores</option> 840 <option value="SelectKBest" selected="true">SelectKBest - Select features according to the k highest scores</option>
1038 <option value="SelectFromModel">SelectFromModel - Meta-transformer for selecting features based on importance weights</option> 841 <option value="SelectFromModel">SelectFromModel - Meta-transformer for selecting features based on importance weights</option>
1107 </when> 910 </when>
1108 <when value="RFECV"> 911 <when value="RFECV">
1109 <expand macro="estimator_selector_all"/> 912 <expand macro="estimator_selector_all"/>
1110 <section name="options" title="Advanced Options" expanded="False"> 913 <section name="options" title="Advanced Options" expanded="False">
1111 <param argument="step" type="float" value="1" label="step" optional="true" help="Default = 1. " /> 914 <param argument="step" type="float" value="1" label="step" optional="true" help="Default = 1. " />
1112 <param argument="cv" type="integer" value="" optional="true" label="cv" help="Determines the cross-validation splitting strategy" /> 915 <expand macro="cv"/>
1113 <param argument="scoring" type="text" value="" optional="true" label="scoring" help="A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y)."/> 916 <expand macro="scoring_selection"/>
1114 <param argument="verbose" type="integer" value="0" label="verbose" help="Controls verbosity of output." /> 917 <param argument="verbose" type="integer" value="0" label="verbose" help="Controls verbosity of output." />
1115 <param argument="n_jobs" type="integer" value="1" label="n_jobs" help="Number of cores to run in parallel while fitting across folds. Defaults to 1 core."/>
1116 </section> 918 </section>
1117 </when> 919 </when>
1118 <when value="VarianceThreshold"> 920 <when value="VarianceThreshold">
1119 <section name="options" title="Options" expanded="False"> 921 <section name="options" title="Options" expanded="False">
1120 <param argument="threshold" type="float" value="" optional="True" label="Threshold" help="Features with a training-set variance lower than this threshold will be removed."/> 922 <param argument="threshold" type="float" value="" optional="True" label="Threshold" help="Features with a training-set variance lower than this threshold will be removed."/>
1157 </when> 959 </when>
1158 </conditional> 960 </conditional>
1159 </xml> 961 </xml>
1160 962
1161 <xml name="model_validation_common_options"> 963 <xml name="model_validation_common_options">
1162 <param argument="cv" type="text" value="" size="50" optional="true" label="cv" help="Optional. Integer or evalable splitter object, e.g., StratifiedKFold(n_splits=3, shuffle=True, random_state=10). Leave blank for default." /> 964 <expand macro="cv"/>
1163 <expand macro="n_jobs"/>
1164 <expand macro="verbose"/> 965 <expand macro="verbose"/>
1165 <yield/> 966 <yield/>
1166 </xml> 967 </xml>
1167 968
1168 <xml name="scoring"> 969 <xml name="scoring_selection">
1169 <param argument="scoring" type="text" value="" optional="true" label="scoring" help="A metric used to evaluate the estimator"/> 970 <conditional name="scoring">
971 <param name="primary_scoring" type="select" multiple="false" label="Select the primary metric (scoring):" help="Metric to refit the best estimator.">
972 <option value="default" selected="true">default with estimator</option>
973 <option value="accuracy">Classification -- 'accuracy'</option>
974 <option value="balanced_accuracy">Classification -- 'balanced_accuracy'</option>
975 <option value="average_precision">Classification -- 'average_precision'</option>
976 <option value="f1">Classification -- 'f1'</option>
977 <option value="f1_micro">Classification -- 'f1_micro'</option>
978 <option value="f1_macro">Classification -- 'f1_macro'</option>
979 <option value="f1_weighted">Classification -- 'f1_weighted'</option>
980 <option value="f1_samples">Classification -- 'f1_samples'</option>
981 <option value="neg_log_loss">Classification -- 'neg_log_loss'</option>
982 <option value="precision">Classification -- 'precision'</option>
983 <option value="precision_micro">Classification -- 'precision_micro'</option>
984 <option value="precision_macro">Classification -- 'precision_macro'</option>
985 <option value="precision_wighted">Classification -- 'precision_wighted'</option>
986 <option value="precision_samples">Classification -- 'precision_samples'</option>
987 <option value="recall">Classification -- 'recall'</option>
988 <option value="recall_micro">Classification -- 'recall_micro'</option>
989 <option value="recall_macro">Classification -- 'recall_macro'</option>
990 <option value="recall_wighted">Classification -- 'recall_wighted'</option>
991 <option value="recall_samples">Classification -- 'recall_samples'</option>
992 <option value="roc_auc">Classification -- 'roc_auc'</option>
993 <option value="explained_variance">Regression -- 'explained_variance'</option>
994 <option value="neg_mean_absolute_error">Regression -- 'neg_mean_absolute_error'</option>
995 <option value="neg_mean_squared_error">Regression -- 'neg_mean_squared_error'</option>
996 <option value="neg_mean_squared_log_error">Regression -- 'neg_mean_squared_log_error'</option>
997 <option value="neg_median_absolute_error">Regression -- 'neg_median_absolute_error'</option>
998 <option value="r2">Regression -- 'r2'</option>
999 </param>
1000 <when value="default"/>
1001 <when value="accuracy"><expand macro="secondary_scoring_selection_classification"/></when>
1002 <when value="balanced_accuracy"><expand macro="secondary_scoring_selection_classification"/></when>
1003 <when value="average_precision"><expand macro="secondary_scoring_selection_classification"/></when>
1004 <when value="f1"><expand macro="secondary_scoring_selection_classification"/></when>
1005 <when value="f1_micro"><expand macro="secondary_scoring_selection_classification"/></when>
1006 <when value="f1_macro"><expand macro="secondary_scoring_selection_classification"/></when>
1007 <when value="f1_weighted"><expand macro="secondary_scoring_selection_classification"/></when>
1008 <when value="f1_samples"><expand macro="secondary_scoring_selection_classification"/></when>
1009 <when value="neg_log_loss"><expand macro="secondary_scoring_selection_classification"/></when>
1010 <when value="precision"><expand macro="secondary_scoring_selection_classification"/></when>
1011 <when value="precision_micro"><expand macro="secondary_scoring_selection_classification"/></when>
1012 <when value="precision_macro"><expand macro="secondary_scoring_selection_classification"/></when>
1013 <when value="precision_wighted"><expand macro="secondary_scoring_selection_classification"/></when>
1014 <when value="precision_samples"><expand macro="secondary_scoring_selection_classification"/></when>
1015 <when value="recall"><expand macro="secondary_scoring_selection_classification"/></when>
1016 <when value="recall_micro"><expand macro="secondary_scoring_selection_classification"/></when>
1017 <when value="recall_macro"><expand macro="secondary_scoring_selection_classification"/></when>
1018 <when value="recall_wighted"><expand macro="secondary_scoring_selection_classification"/></when>
1019 <when value="recall_samples"><expand macro="secondary_scoring_selection_classification"/></when>
1020 <when value="roc_auc"><expand macro="secondary_scoring_selection_classification"/></when>
1021 <when value="explained_variance"><expand macro="secondary_scoring_selection_regression"/></when>
1022 <when value="neg_mean_absolute_error"><expand macro="secondary_scoring_selection_regression"/></when>
1023 <when value="neg_mean_squared_error"><expand macro="secondary_scoring_selection_regression"/></when>
1024 <when value="neg_mean_squared_log_error"><expand macro="secondary_scoring_selection_regression"/></when>
1025 <when value="neg_median_absolute_error"><expand macro="secondary_scoring_selection_regression"/></when>
1026 <when value="r2"><expand macro="secondary_scoring_selection_regression"/></when>
1027 </conditional>
1028 </xml>
1029
1030 <xml name="secondary_scoring_selection_classification">
1031 <param name="secondary_scoring" type="select" multiple="true" label="Additional scoring used in multi-metric mode:" help="If the same metric with the primary is chosen, the metric will be ignored.">
1032 <option value="accuracy">Classification -- 'accuracy'</option>
1033 <option value="balanced_accuracy">Classification -- 'balanced_accuracy'</option>
1034 <option value="average_precision">Classification -- 'average_precision'</option>
1035 <option value="f1">Classification -- 'f1'</option>
1036 <option value="f1_micro">Classification -- 'f1_micro'</option>
1037 <option value="f1_macro">Classification -- 'f1_macro'</option>
1038 <option value="f1_weighted">Classification -- 'f1_weighted'</option>
1039 <option value="f1_samples">Classification -- 'f1_samples'</option>
1040 <option value="neg_log_loss">Classification -- 'neg_log_loss'</option>
1041 <option value="precision">Classification -- 'precision'</option>
1042 <option value="precision_micro">Classification -- 'precision_micro'</option>
1043 <option value="precision_macro">Classification -- 'precision_macro'</option>
1044 <option value="precision_wighted">Classification -- 'precision_wighted'</option>
1045 <option value="precision_samples">Classification -- 'precision_samples'</option>
1046 <option value="recall">Classification -- 'recall'</option>
1047 <option value="recall_micro">Classification -- 'recall_micro'</option>
1048 <option value="recall_macro">Classification -- 'recall_macro'</option>
1049 <option value="recall_wighted">Classification -- 'recall_wighted'</option>
1050 <option value="recall_samples">Classification -- 'recall_samples'</option>
1051 <option value="roc_auc">Classification -- 'roc_auc'</option>
1052 </param>
1053 </xml>
1054
1055 <xml name="secondary_scoring_selection_regression">
1056 <param name="secondary_scoring" type="select" multiple="true" label="Additional scoring used in multi-metric mode:" help="If the same metric with the primary is chosen, the metric will be ignored.">
1057 <option value="explained_variance">Regression -- 'explained_variance'</option>
1058 <option value="neg_mean_absolute_error">Regression -- 'neg_mean_absolute_error'</option>
1059 <option value="neg_mean_squared_error">Regression -- 'neg_mean_squared_error'</option>
1060 <option value="neg_mean_squared_log_error">Regression -- 'neg_mean_squared_log_error'</option>
1061 <option value="neg_median_absolute_error">Regression -- 'neg_median_absolute_error'</option>
1062 <option value="r2">Regression -- 'r2'</option>
1063 </param>
1170 </xml> 1064 </xml>
1171 1065
1172 <xml name="pre_dispatch" token_type="hidden" token_default_value="all" token_help="Number of predispatched jobs for parallel execution"> 1066 <xml name="pre_dispatch" token_type="hidden" token_default_value="all" token_help="Number of predispatched jobs for parallel execution">
1173 <param argument="pre_dispatch" type="@TYPE@" value="@DEFAULT_VALUE@" optional="true" label="pre_dispatch" help="@HELP@"/> 1067 <param argument="pre_dispatch" type="@TYPE@" value="@DEFAULT_VALUE@" optional="true" label="pre_dispatch" help="@HELP@"/>
1174 </xml> 1068 </xml>
1208 </repeat> 1102 </repeat>
1209 </section> 1103 </section>
1210 </xml> 1104 </xml>
1211 1105
1212 <xml name="search_param_input" token_label="Estimator parameter:" token_help="One parameter per box. For example: C: [1, 10, 100, 1000]. See bottom for more examples"> 1106 <xml name="search_param_input" token_label="Estimator parameter:" token_help="One parameter per box. For example: C: [1, 10, 100, 1000]. See bottom for more examples">
1213 <param name="search_p" type="text" value="" size="100" optional="true" label="@LABEL@" help="@HELP@"> 1107 <param name="search_p" type="text" value="" optional="true" label="@LABEL@" help="@HELP@">
1214 <sanitizer> 1108 <sanitizer>
1215 <valid initial="default"> 1109 <valid initial="default">
1216 <add value="&apos;"/> 1110 <add value="&apos;"/>
1217 <add value="&quot;"/> 1111 <add value="&quot;"/>
1218 <add value="["/> 1112 <add value="["/>
1221 </sanitizer> 1115 </sanitizer>
1222 </param> 1116 </param>
1223 </xml> 1117 </xml>
1224 1118
1225 <xml name="search_cv_options"> 1119 <xml name="search_cv_options">
1226 <expand macro="scoring"/> 1120 <expand macro="scoring_selection"/>
1227 <expand macro="model_validation_common_options"/> 1121 <expand macro="model_validation_common_options"/>
1228 <expand macro="pre_dispatch" value="2*n_jobs" help="Controls the number of jobs that get dispatched during parallel execution"/> 1122 <expand macro="pre_dispatch" value="2*n_jobs" help="Controls the number of jobs that get dispatched during parallel execution"/>
1229 <param argument="iid" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="iid" help="If True, data is identically distributed across the folds"/> 1123 <param argument="iid" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="iid" help="If True, data is identically distributed across the folds"/>
1230 <param argument="refit" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="refit" help="Refit an estimator using the best found parameters on the whole dataset."/> 1124 <param argument="refit" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="refit" help="Refit an estimator using the best found parameters on the whole dataset."/>
1231 <!--error_score--> 1125 <param argument="error_score" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="Raise fit error:" help="If false, the metric score is assigned to 0 if an error occurs in estimator fitting and FitFailedWarning is raised."/>
1232 <param argument="return_train_score" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false" label="return_train_score" help=""/> 1126 <param argument="return_train_score" type="boolean" truevalue="booltrue" falsevalue="boolfalse" checked="false" label="return_train_score" help=""/>
1233 </xml> 1127 </xml>
1234 1128
1235 <xml name="estimator_selector_all"> 1129 <xml name="estimator_selector_all">
1236 <conditional name="estimator_selector"> 1130 <conditional name="estimator_selector">
1305 <option value="GradientBoostingRegressor">GradientBoostingRegressor</option> 1199 <option value="GradientBoostingRegressor">GradientBoostingRegressor</option>
1306 <option value="IsolationForest">IsolationForest</option> 1200 <option value="IsolationForest">IsolationForest</option>
1307 <option value="RandomForestClassifier">RandomForestClassifier</option> 1201 <option value="RandomForestClassifier">RandomForestClassifier</option>
1308 <option value="RandomForestRegressor">RandomForestRegressor</option> 1202 <option value="RandomForestRegressor">RandomForestRegressor</option>
1309 <option value="RandomTreesEmbedding">RandomTreesEmbedding</option> 1203 <option value="RandomTreesEmbedding">RandomTreesEmbedding</option>
1310 <option value="VotingClassifier">VotingClassifier</option> 1204 <!--option value="VotingClassifier">VotingClassifier</option-->
1311 </param> 1205 </param>
1312 <expand macro="estimator_params_text"/> 1206 <expand macro="estimator_params_text"/>
1313 </when> 1207 </when>
1314 <when value="naive_bayes"> 1208 <when value="naive_bayes">
1315 <param name="selected_estimator" type="select" label="Choose estimator class:"> 1209 <param name="selected_estimator" type="select" label="Choose estimator class:">
1328 </param> 1222 </param>
1329 <expand macro="estimator_params_text"/> 1223 <expand macro="estimator_params_text"/>
1330 </when> 1224 </when>
1331 <when value="neighbors"> 1225 <when value="neighbors">
1332 <param name="selected_estimator" type="select" label="Choose estimator class:"> 1226 <param name="selected_estimator" type="select" label="Choose estimator class:">
1333 <option value="BallTree" selected="true">BallTree</option> 1227 <option value="KNeighborsClassifier" selected="true">KNeighborsClassifier</option>
1334 <option value="DistanceMetric">DistanceMetric</option> 1228 <option value="KNeighborsRegressor">KNeighborsRegressor</option>
1335 <option value="KDTree">KDTree</option> 1229 <!--option value="BallTree">BallTree</option-->
1230 <!--option value="KDTree">KDTree</option-->
1336 <option value="KernelDensity">KernelDensity</option> 1231 <option value="KernelDensity">KernelDensity</option>
1337 <option value="KNeighborsClassifier">KNeighborsClassifier</option>
1338 <option value="KNeighborsRegressor">KNeighborsRegressor</option>
1339 <option value="LocalOutlierFactor">LocalOutlierFactor</option> 1232 <option value="LocalOutlierFactor">LocalOutlierFactor</option>
1340 <option value="RadiusNeighborsClassifier">RadiusNeighborsClassifier</option> 1233 <option value="RadiusNeighborsClassifier">RadiusNeighborsClassifier</option>
1341 <option value="RadiusNeighborsRegressor">RadiusNeighborsRegressor</option> 1234 <option value="RadiusNeighborsRegressor">RadiusNeighborsRegressor</option>
1342 <option value="NearestCentroid">NearestCentroid</option> 1235 <option value="NearestCentroid">NearestCentroid</option>
1343 <option value="NearestNeighbors">NearestNeighbors</option> 1236 <option value="NearestNeighbors">NearestNeighbors</option>
1352 <expand macro="estimator_params_text"/> 1245 <expand macro="estimator_params_text"/>
1353 </when> 1246 </when>
1354 </conditional> 1247 </conditional>
1355 </xml> 1248 </xml>
1356 1249
1357 <xml name="estimator_params_text" token_label="Type in estimator parameters:" 1250 <xml name="estimator_params_text" token_label="Type in parameter settings if different from default:" token_default_value=''
1358 token_help="Parameters in dictionary without braces ('{}'), e.g., 'C': 1, 'kernel': 'linear'. No double quotes. Leave this box blank for default estimator."> 1251 token_help="Dictionary-capable, e.g., C=1, kernel='linear'. No double quotes. Leave this box blank for default estimator.">
1359 <param name="text_params" type="text" value="" size="50" optional="true" label="@LABEL@" help="@HELP@"> 1252 <param name="text_params" type="text" value="@DEFAULT_VALUE@" optional="true" label="@LABEL@" help="@HELP@">
1360 <sanitizer> 1253 <sanitizer>
1361 <valid initial="default"> 1254 <valid initial="default">
1362 <add value="&apos;"/> 1255 <add value="&apos;"/>
1363 </valid> 1256 </valid>
1364 </sanitizer> 1257 </sanitizer>
1372 <option value="RBFSampler">RBFSampler</option> 1265 <option value="RBFSampler">RBFSampler</option>
1373 <option value="AdditiveChi2Sampler">AdditiveChi2Sampler</option> 1266 <option value="AdditiveChi2Sampler">AdditiveChi2Sampler</option>
1374 <option value="SkewedChi2Sampler">SkewedChi2Sampler</option> 1267 <option value="SkewedChi2Sampler">SkewedChi2Sampler</option>
1375 </param> 1268 </param>
1376 <when value="Nystroem"> 1269 <when value="Nystroem">
1377 <expand macro="estimator_params_text" label="Type in kernel approximater parameters:" 1270 <expand macro="estimator_params_text"
1378 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'kernel': 'rbf'. No double quotes. Leave this box blank for class default."/> 1271 help="Default(=blank): coef0=None, degree=None, gamma=None, kernel='rbf', kernel_params=None, n_components=100, random_state=None. No double quotes"/>
1379 </when> 1272 </when>
1380 <when value="RBFSampler"> 1273 <when value="RBFSampler">
1381 <expand macro="estimator_params_text" label="Type in kernel approximater parameters:" 1274 <expand macro="estimator_params_text"
1382 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'gamma': 1.0. No double quotes. Leave this box blank for class default."/> 1275 help="Default(=blank): gamma=1.0, n_components=100, random_state=None."/>
1383 </when> 1276 </when>
1384 <when value="AdditiveChi2Sampler"> 1277 <when value="AdditiveChi2Sampler">
1385 <expand macro="estimator_params_text" label="Type in kernel approximater parameters:" 1278 <expand macro="estimator_params_text"
1386 help="Parameters in dictionary without braces ('{}'), e.g., 'sample_steps': 2, 'sample_interval': None. No double quotes. Leave this box blank for class default."/> 1279 help="Default(=blank): sample_interval=None, sample_steps=2."/>
1387 </when> 1280 </when>
1388 <when value="SkewedChi2Sampler"> 1281 <when value="SkewedChi2Sampler">
1389 <expand macro="estimator_params_text" label="Type in kernel approximater parameters:" 1282 <expand macro="estimator_params_text"
1390 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'skewedness': 1.0. No double quotes. Leave this box blank for class default."/> 1283 help="Default(=blank): n_components=100, random_state=None, skewedness=1.0."/>
1391 </when> 1284 </when>
1392 </conditional> 1285 </conditional>
1393 </xml> 1286 </xml>
1394 1287
1395 <xml name="matrix_decomposition_all"> 1288 <xml name="matrix_decomposition_all">
1404 <option value="MiniBatchDictionaryLearning">MiniBatchDictionaryLearning</option> 1297 <option value="MiniBatchDictionaryLearning">MiniBatchDictionaryLearning</option>
1405 <option value="MiniBatchSparsePCA">MiniBatchSparsePCA</option> 1298 <option value="MiniBatchSparsePCA">MiniBatchSparsePCA</option>
1406 <option value="NMF">NMF</option> 1299 <option value="NMF">NMF</option>
1407 <option value="PCA">PCA</option> 1300 <option value="PCA">PCA</option>
1408 <option value="SparsePCA">SparsePCA</option> 1301 <option value="SparsePCA">SparsePCA</option>
1409 <option value="SparseCoder">SparseCoder</option> 1302 <!--option value="SparseCoder">SparseCoder</option-->
1410 <option value="TruncatedSVD">TruncatedSVD</option> 1303 <option value="TruncatedSVD">TruncatedSVD</option>
1411 </param> 1304 </param>
1412 <when value="DictionaryLearning"> 1305 <when value="DictionaryLearning">
1413 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1306 <expand macro="estimator_params_text"
1414 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': None, 'alpha': 1.0. No double quotes. Leave this box blank for class default."/> 1307 help="Default(=blank): alpha=1, code_init=None, dict_init=None, fit_algorithm='lars', max_iter=1000, n_components=None, random_state=None, split_sign=False, tol=1e-08, transform_algorithm='omp', transform_alpha=None, transform_n_nonzero_coefs=None, verbose=False."/>
1415 </when> 1308 </when>
1416 <when value="FactorAnalysis"> 1309 <when value="FactorAnalysis">
1417 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1310 <expand macro="estimator_params_text"
1418 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1311 help="Default(=blank): copy=True, iterated_power=3, max_iter=1000, n_components=None, noise_variance_init=None, random_state=0, svd_method='randomized', tol=0.01."/>
1419 </when> 1312 </when>
1420 <when value="FastICA"> 1313 <when value="FastICA">
1421 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1314 <expand macro="estimator_params_text"
1422 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1315 help="Default(=blank): algorithm='parallel', fun='logcosh', fun_args=None, max_iter=200, n_components=None, random_state=None, tol=0.0001, w_init=None, whiten=True. No double quotes."/>
1423 </when> 1316 </when>
1424 <when value="IncrementalPCA"> 1317 <when value="IncrementalPCA">
1425 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1318 <expand macro="estimator_params_text"
1426 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'whiten': False. No double quotes. Leave this box blank for class default."/> 1319 help="Default(=blank): batch_size=None, copy=True, n_components=None, whiten=False."/>
1427 </when> 1320 </when>
1428 <when value="KernelPCA"> 1321 <when value="KernelPCA">
1429 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1322 <expand macro="estimator_params_text"
1430 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1323 help="Default(=blank): alpha=1.0, coef0=1, copy_X=True, degree=3, eigen_solver='auto', fit_inverse_transform=False, gamma=None, kernel='linear', kernel_params=None, max_iter=None, n_components=None, random_state=None, remove_zero_eig=False, tol=0. No double quotes."/>
1431 </when> 1324 </when>
1432 <when value="LatentDirichletAllocation"> 1325 <when value="LatentDirichletAllocation">
1433 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1326 <expand macro="estimator_params_text"
1434 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1327 help="Default(=blank): batch_size=128, doc_topic_prior=None, evaluate_every=-1, learning_decay=0.7, learning_method=None, learning_offset=10.0, max_doc_update_iter=100, max_iter=10, mean_change_tol=0.001, n_components=10, n_topics=None, perp_tol=0.1, random_state=None, topic_word_prior=None, total_samples=1000000.0, verbose=0."/>
1435 </when> 1328 </when>
1436 <when value="MiniBatchDictionaryLearning"> 1329 <when value="MiniBatchDictionaryLearning">
1437 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1330 <expand macro="estimator_params_text"
1438 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1331 help="Default(=blank): alpha=1, batch_size=3, dict_init=None, fit_algorithm='lars', n_components=None, n_iter=1000, random_state=None, shuffle=True, split_sign=False, transform_algorithm='omp', transform_alpha=None, transform_n_nonzero_coefs=None, verbose=False."/>
1439 </when> 1332 </when>
1440 <when value="MiniBatchSparsePCA"> 1333 <when value="MiniBatchSparsePCA">
1441 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1334 <expand macro="estimator_params_text"
1442 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1335 help="Default(=blank): alpha=1, batch_size=3, callback=None, method='lars', n_components=None, n_iter=100, random_state=None, ridge_alpha=0.01, shuffle=True, verbose=False."/>
1443 </when> 1336 </when>
1444 <when value="NMF"> 1337 <when value="NMF">
1445 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1338 <expand macro="estimator_params_text"
1446 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'init': 'random'. No double quotes. Leave this box blank for class default."/> 1339 help="Default(=blank): alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200, n_components=None, random_state=None, shuffle=False, solver='cd', tol=0.0001, verbose=0."/>
1447 </when> 1340 </when>
1448 <when value="PCA"> 1341 <when value="PCA">
1449 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1342 <expand macro="estimator_params_text"
1450 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1343 help="Default(=blank): copy=True, iterated_power='auto', n_components=None, random_state=None, svd_solver='auto', tol=0.0, whiten=False."/>
1451 </when> 1344 </when>
1452 <when value="SparsePCA"> 1345 <when value="SparsePCA">
1453 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1346 <expand macro="estimator_params_text"
1454 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 100, 'random_state': 42. No double quotes. Leave this box blank for class default."/> 1347 help="Default(=blank): U_init=None, V_init=None, alpha=1, max_iter=1000, method='lars', n_components=None, random_state=None, ridge_alpha=0.01, tol=1e-08, verbose=False."/>
1455 </when>
1456 <when value="SparseCoder">
1457 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:"
1458 help="Parameters in dictionary without braces ('{}'), e.g., 'transform_algorithm': 'omp', 'transform_alpha': 1.0. No double quotes. Leave this box blank for class default."/>
1459 </when> 1348 </when>
1460 <when value="TruncatedSVD"> 1349 <when value="TruncatedSVD">
1461 <expand macro="estimator_params_text" label="Type in maxtrix decomposition parameters:" 1350 <expand macro="estimator_params_text"
1462 help="Parameters in dictionary without braces ('{}'), e.g., 'n_components': 2, 'algorithm': 'randomized'. No double quotes. Leave this box blank for default estimator."/> 1351 help="Default(=blank): algorithm='randomized', n_components=2, n_iter=5, random_state=None, tol=0.0."/>
1463 </when> 1352 </when>
1464 </conditional> 1353 </conditional>
1465 </xml> 1354 </xml>
1466 1355
1467 <xml name="FeatureAgglomeration"> 1356 <xml name="FeatureAgglomeration">
1468 <conditional name="FeatureAgglomeration_selector"> 1357 <conditional name="FeatureAgglomeration_selector">
1469 <param name="select_algorithm" type="select" label="Choose the algorithm:"> 1358 <param name="select_algorithm" type="select" label="Choose the algorithm:">
1470 <option value="FeatureAgglomeration" selected="true">FeatureAgglomeration</option> 1359 <option value="FeatureAgglomeration" selected="true">FeatureAgglomeration</option>
1471 </param> 1360 </param>
1472 <when value="FeatureAgglomeration"> 1361 <when value="FeatureAgglomeration">
1473 <expand macro="estimator_params_text" label="Type in parameters:" 1362 <expand macro="estimator_params_text"
1474 help="Parameters in dictionary without braces ('{}'), e.g., 'n_clusters': 2, 'affinity': 'euclidean'. No double quotes. Leave this box blank for class default."/> 1363 help="Default(=blank): affinity='euclidean', compute_full_tree='auto', connectivity=None, linkage='ward', memory=None, n_clusters=2, pooling_func=np.mean."/>
1364 </when>
1365 </conditional>
1366 </xml>
1367
1368 <xml name="skrebate">
1369 <conditional name="skrebate_selector">
1370 <param name="select_algorithm" type="select" label="Choose the algorithm:">
1371 <option value="ReliefF">ReliefF</option>
1372 <option value="SURF">SURF</option>
1373 <option value="SURFstar">SURFstar</option>
1374 <option value="MultiSURF">MultiSURF</option>
1375 <option value="MultiSURFstar">MultiSURFstar</option>
1376 <option value="TuRF">TuRF</option>
1377 </param>
1378 <when value="ReliefF">
1379 <expand macro="estimator_params_text"
1380 help="Default(=blank): discrete_threshold=10, n_features_to_select=10, n_neighbors=100, verbose=False."/>
1381 </when>
1382 <when value="SURF">
1383 <expand macro="estimator_params_text"
1384 help="Default(=blank): discrete_threshold=10, n_features_to_select=10, verbose=False."/>
1385 </when>
1386 <when value="SURFstar">
1387 <expand macro="estimator_params_text"
1388 help="Default(=blank): discrete_threshold=10, n_features_to_select=10, verbose=False."/>
1389 </when>
1390 <when value="MultiSURF">
1391 <expand macro="estimator_params_text"
1392 help="Default(=blank): discrete_threshold=10, n_features_to_select=10, verbose=False."/>
1393 </when>
1394 <when value="MultiSURFstar">
1395 <expand macro="estimator_params_text"
1396 help="Default(=blank): discrete_threshold=10, n_features_to_select=10, verbose=False."/>
1397 </when>
1398 <when value="TuRF">
1399 <expand macro="estimator_params_text"
1400 help="Default(=blank): core_algorithm='ReliefF', discrete_threshold=10, n_features_to_select=10, n_neighbors=100, pct=0.5, verbose=False."/>
1475 </when> 1401 </when>
1476 </conditional> 1402 </conditional>
1477 </xml> 1403 </xml>
1478 <!-- Outputs --> 1404 <!-- Outputs -->
1479 1405