Mercurial > repos > bgruening > sklearn_generalized_linear
annotate search_model_validation.py @ 24:b628de0d101f draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
author | bgruening |
---|---|
date | Wed, 15 May 2019 07:40:56 -0400 |
parents | e3bc646e63b2 |
children | 9d3a024cf2da |
rev | line source |
---|---|
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
1 import argparse |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
2 import collections |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
3 import imblearn |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
4 import json |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
5 import numpy as np |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
6 import pandas |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
7 import pickle |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
8 import skrebate |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
9 import sklearn |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
10 import sys |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
11 import xgboost |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
12 import warnings |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
13 import iraps_classifier |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
14 import model_validations |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
15 import preprocessors |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
16 import feature_selectors |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
17 from imblearn import under_sampling, over_sampling, combine |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
18 from scipy.io import mmread |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
19 from mlxtend import classifier, regressor |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
20 from sklearn import (cluster, compose, decomposition, ensemble, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
21 feature_extraction, feature_selection, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
22 gaussian_process, kernel_approximation, metrics, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
23 model_selection, naive_bayes, neighbors, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
24 pipeline, preprocessing, svm, linear_model, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
25 tree, discriminant_analysis) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
26 from sklearn.exceptions import FitFailedWarning |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
27 from sklearn.externals import joblib |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
28 from sklearn.model_selection._validation import _score |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
29 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
30 from utils import (SafeEval, get_cv, get_scoring, get_X_y, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
31 load_model, read_columns) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
32 from model_validations import train_test_split |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
33 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
34 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
35 N_JOBS = int(__import__('os').environ.get('GALAXY_SLOTS', 1)) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
36 CACHE_DIR = './cached' |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
37 NON_SEARCHABLE = ('n_jobs', 'pre_dispatch', 'memory', 'steps', |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
38 'nthread', 'verbose') |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
39 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
40 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
41 def _eval_search_params(params_builder): |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
42 search_params = {} |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
43 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
44 for p in params_builder['param_set']: |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
45 search_list = p['sp_list'].strip() |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
46 if search_list == '': |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
47 continue |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
48 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
49 param_name = p['sp_name'] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
50 if param_name.lower().endswith(NON_SEARCHABLE): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
51 print("Warning: `%s` is not eligible for search and was " |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
52 "omitted!" % param_name) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
53 continue |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
54 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
55 if not search_list.startswith(':'): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
56 safe_eval = SafeEval(load_scipy=True, load_numpy=True) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
57 ev = safe_eval(search_list) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
58 search_params[param_name] = ev |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
59 else: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
60 # Have `:` before search list, asks for estimator evaluatio |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
61 safe_eval_es = SafeEval(load_estimators=True) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
62 search_list = search_list[1:].strip() |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
63 # TODO maybe add regular express check |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
64 ev = safe_eval_es(search_list) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
65 preprocessors = ( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
66 preprocessing.StandardScaler(), preprocessing.Binarizer(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
67 preprocessing.Imputer(), preprocessing.MaxAbsScaler(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
68 preprocessing.Normalizer(), preprocessing.MinMaxScaler(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
69 preprocessing.PolynomialFeatures(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
70 preprocessing.RobustScaler(), feature_selection.SelectKBest(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
71 feature_selection.GenericUnivariateSelect(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
72 feature_selection.SelectPercentile(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
73 feature_selection.SelectFpr(), feature_selection.SelectFdr(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
74 feature_selection.SelectFwe(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
75 feature_selection.VarianceThreshold(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
76 decomposition.FactorAnalysis(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
77 decomposition.FastICA(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
78 decomposition.IncrementalPCA(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
79 decomposition.KernelPCA(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
80 decomposition.LatentDirichletAllocation( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
81 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
82 decomposition.MiniBatchDictionaryLearning( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
83 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
84 decomposition.MiniBatchSparsePCA( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
85 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
86 decomposition.NMF(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
87 decomposition.PCA(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
88 decomposition.SparsePCA(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
89 decomposition.TruncatedSVD(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
90 kernel_approximation.Nystroem(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
91 kernel_approximation.RBFSampler(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
92 kernel_approximation.AdditiveChi2Sampler(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
93 kernel_approximation.SkewedChi2Sampler(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
94 cluster.FeatureAgglomeration(), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
95 skrebate.ReliefF(n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
96 skrebate.SURF(n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
97 skrebate.SURFstar(n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
98 skrebate.MultiSURF(n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
99 skrebate.MultiSURFstar(n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
100 imblearn.under_sampling.ClusterCentroids( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
101 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
102 imblearn.under_sampling.CondensedNearestNeighbour( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
103 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
104 imblearn.under_sampling.EditedNearestNeighbours( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
105 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
106 imblearn.under_sampling.RepeatedEditedNearestNeighbours( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
107 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
108 imblearn.under_sampling.AllKNN(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
109 imblearn.under_sampling.InstanceHardnessThreshold( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
110 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
111 imblearn.under_sampling.NearMiss( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
112 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
113 imblearn.under_sampling.NeighbourhoodCleaningRule( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
114 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
115 imblearn.under_sampling.OneSidedSelection( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
116 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
117 imblearn.under_sampling.RandomUnderSampler( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
118 random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
119 imblearn.under_sampling.TomekLinks( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
120 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
121 imblearn.over_sampling.ADASYN(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
122 imblearn.over_sampling.RandomOverSampler(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
123 imblearn.over_sampling.SMOTE(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
124 imblearn.over_sampling.SVMSMOTE(random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
125 imblearn.over_sampling.BorderlineSMOTE( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
126 random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
127 imblearn.over_sampling.SMOTENC( |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
128 categorical_features=[], random_state=0, n_jobs=N_JOBS), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
129 imblearn.combine.SMOTEENN(random_state=0), |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
130 imblearn.combine.SMOTETomek(random_state=0)) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
131 newlist = [] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
132 for obj in ev: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
133 if obj is None: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
134 newlist.append(None) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
135 elif obj == 'all_0': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
136 newlist.extend(preprocessors[0:36]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
137 elif obj == 'sk_prep_all': # no KernalCenter() |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
138 newlist.extend(preprocessors[0:8]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
139 elif obj == 'fs_all': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
140 newlist.extend(preprocessors[8:15]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
141 elif obj == 'decomp_all': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
142 newlist.extend(preprocessors[15:26]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
143 elif obj == 'k_appr_all': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
144 newlist.extend(preprocessors[26:30]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
145 elif obj == 'reb_all': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
146 newlist.extend(preprocessors[31:36]) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
147 elif obj == 'imb_all': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
148 newlist.extend(preprocessors[36:55]) |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
149 elif type(obj) is int and -1 < obj < len(preprocessors): |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
150 newlist.append(preprocessors[obj]) |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
151 elif hasattr(obj, 'get_params'): # user uploaded object |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
152 if 'n_jobs' in obj.get_params(): |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
153 newlist.append(obj.set_params(n_jobs=N_JOBS)) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
154 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
155 newlist.append(obj) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
156 else: |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
157 sys.exit("Unsupported estimator type: %r" % (obj)) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
158 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
159 search_params[param_name] = newlist |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
160 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
161 return search_params |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
162 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
163 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
164 def main(inputs, infile_estimator, infile1, infile2, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
165 outfile_result, outfile_object=None, groups=None): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
166 """ |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
167 Parameter |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
168 --------- |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
169 inputs : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
170 File path to galaxy tool parameter |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
171 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
172 infile_estimator : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
173 File path to estimator |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
174 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
175 infile1 : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
176 File path to dataset containing features |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
177 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
178 infile2 : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
179 File path to dataset containing target values |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
180 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
181 outfile_result : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
182 File path to save the results, either cv_results or test result |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
183 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
184 outfile_object : str, optional |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
185 File path to save searchCV object |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
186 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
187 groups : str |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
188 File path to dataset containing groups labels |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
189 """ |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
190 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
191 warnings.simplefilter('ignore') |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
192 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
193 with open(inputs, 'r') as param_handler: |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
194 params = json.load(param_handler) |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
195 if groups: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
196 (params['search_schemes']['options']['cv_selector'] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
197 ['groups_selector']['infile_g']) = groups |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
198 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
199 params_builder = params['search_schemes']['search_params_builder'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
200 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
201 input_type = params['input_options']['selected_input'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
202 if input_type == 'tabular': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
203 header = 'infer' if params['input_options']['header1'] else None |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
204 column_option = (params['input_options']['column_selector_options_1'] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
205 ['selected_column_selector_option']) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
206 if column_option in ['by_index_number', 'all_but_by_index_number', |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
207 'by_header_name', 'all_but_by_header_name']: |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
208 c = params['input_options']['column_selector_options_1']['col1'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
209 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
210 c = None |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
211 X = read_columns( |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
212 infile1, |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
213 c=c, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
214 c_option=column_option, |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
215 sep='\t', |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
216 header=header, |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
217 parse_dates=True).astype(float) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
218 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
219 X = mmread(open(infile1, 'r')) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
220 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
221 header = 'infer' if params['input_options']['header2'] else None |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
222 column_option = (params['input_options']['column_selector_options_2'] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
223 ['selected_column_selector_option2']) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
224 if column_option in ['by_index_number', 'all_but_by_index_number', |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
225 'by_header_name', 'all_but_by_header_name']: |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
226 c = params['input_options']['column_selector_options_2']['col2'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
227 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
228 c = None |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
229 y = read_columns( |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
230 infile2, |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
231 c=c, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
232 c_option=column_option, |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
233 sep='\t', |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
234 header=header, |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
235 parse_dates=True) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
236 y = y.ravel() |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
237 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
238 optimizer = params['search_schemes']['selected_search_scheme'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
239 optimizer = getattr(model_selection, optimizer) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
240 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
241 options = params['search_schemes']['options'] |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
242 |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
243 splitter, groups = get_cv(options.pop('cv_selector')) |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
244 options['cv'] = splitter |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
245 options['n_jobs'] = N_JOBS |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
246 primary_scoring = options['scoring']['primary_scoring'] |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
247 options['scoring'] = get_scoring(options['scoring']) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
248 if options['error_score']: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
249 options['error_score'] = 'raise' |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
250 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
251 options['error_score'] = np.NaN |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
252 if options['refit'] and isinstance(options['scoring'], dict): |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
253 options['refit'] = primary_scoring |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
254 if 'pre_dispatch' in options and options['pre_dispatch'] == '': |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
255 options['pre_dispatch'] = None |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
256 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
257 with open(infile_estimator, 'rb') as estimator_handler: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
258 estimator = load_model(estimator_handler) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
259 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
260 memory = joblib.Memory(location=CACHE_DIR, verbose=0) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
261 # cache iraps_core fits could increase search speed significantly |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
262 if estimator.__class__.__name__ == 'IRAPSClassifier': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
263 estimator.set_params(memory=memory) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
264 else: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
265 for p, v in estimator.get_params().items(): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
266 if p.endswith('memory'): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
267 if len(p) > 8 and p[:-8].endswith('irapsclassifier'): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
268 # cache iraps_core fits could increase search |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
269 # speed significantly |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
270 new_params = {p: memory} |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
271 estimator.set_params(**new_params) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
272 elif v: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
273 new_params = {p, None} |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
274 estimator.set_params(**new_params) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
275 elif p.endswith('n_jobs'): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
276 new_params = {p: 1} |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
277 estimator.set_params(**new_params) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
278 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
279 param_grid = _eval_search_params(params_builder) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
280 searcher = optimizer(estimator, param_grid, **options) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
281 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
282 # do train_test_split |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
283 do_train_test_split = params['train_test_split'].pop('do_split') |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
284 if do_train_test_split == 'yes': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
285 # make sure refit is choosen |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
286 if not options['refit']: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
287 raise ValueError("Refit must be `True` for shuffle splitting!") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
288 split_options = params['train_test_split'] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
289 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
290 # splits |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
291 if split_options['shuffle'] == 'stratified': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
292 split_options['labels'] = y |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
293 X, X_test, y, y_test = train_test_split(X, y, **split_options) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
294 elif split_options['shuffle'] == 'group': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
295 if not groups: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
296 raise ValueError("No group based CV option was " |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
297 "choosen for group shuffle!") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
298 split_options['labels'] = groups |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
299 X, X_test, y, y_test, groups, _ =\ |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
300 train_test_split(X, y, **split_options) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
301 else: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
302 if split_options['shuffle'] == 'None': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
303 split_options['shuffle'] = None |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
304 X, X_test, y, y_test =\ |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
305 train_test_split(X, y, **split_options) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
306 # end train_test_split |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
307 |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
308 if options['error_score'] == 'raise': |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
309 searcher.fit(X, y, groups=groups) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
310 else: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
311 warnings.simplefilter('always', FitFailedWarning) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
312 with warnings.catch_warnings(record=True) as w: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
313 try: |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
314 searcher.fit(X, y, groups=groups) |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
315 except ValueError: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
316 pass |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
317 for warning in w: |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
318 print(repr(warning.message)) |
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
319 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
320 if do_train_test_split == 'no': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
321 # save results |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
322 cv_results = pandas.DataFrame(searcher.cv_results_) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
323 cv_results = cv_results[sorted(cv_results.columns)] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
324 cv_results.to_csv(path_or_buf=outfile_result, sep='\t', |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
325 header=True, index=False) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
326 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
327 # output test result using best_estimator_ |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
328 else: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
329 best_estimator_ = searcher.best_estimator_ |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
330 if isinstance(options['scoring'], collections.Mapping): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
331 is_multimetric = True |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
332 else: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
333 is_multimetric = False |
23
e3bc646e63b2
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
diff
changeset
|
334 |
24
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
335 test_score = _score(best_estimator_, X_test, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
336 y_test, options['scoring'], |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
337 is_multimetric=is_multimetric) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
338 if not is_multimetric: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
339 test_score = {primary_scoring: test_score} |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
340 for key, value in test_score.items(): |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
341 test_score[key] = [value] |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
342 result_df = pandas.DataFrame(test_score) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
343 result_df.to_csv(path_or_buf=outfile_result, sep='\t', |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
344 header=True, index=False) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
345 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
346 memory.clear(warn=False) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
347 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
348 if outfile_object: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
349 with open(outfile_object, 'wb') as output_handler: |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
350 pickle.dump(searcher, output_handler, pickle.HIGHEST_PROTOCOL) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
351 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
352 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
353 if __name__ == '__main__': |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
354 aparser = argparse.ArgumentParser() |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
355 aparser.add_argument("-i", "--inputs", dest="inputs", required=True) |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
356 aparser.add_argument("-e", "--estimator", dest="infile_estimator") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
357 aparser.add_argument("-X", "--infile1", dest="infile1") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
358 aparser.add_argument("-y", "--infile2", dest="infile2") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
359 aparser.add_argument("-r", "--outfile_result", dest="outfile_result") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
360 aparser.add_argument("-o", "--outfile_object", dest="outfile_object") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
361 aparser.add_argument("-g", "--groups", dest="groups") |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
362 args = aparser.parse_args() |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
363 |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
364 main(args.inputs, args.infile_estimator, args.infile1, args.infile2, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
365 args.outfile_result, outfile_object=args.outfile_object, |
b628de0d101f
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ab963ec9498bd05d2fb2f24f75adb2fccae7958c
bgruening
parents:
23
diff
changeset
|
366 groups=args.groups) |