Mercurial > repos > bgruening > sklearn_model_validation
comparison model_validation.xml @ 11:61844bce4115 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit b1e5fa3170484d2cc3396f2abe99bb8cfcfa9c65
| author | bgruening |
|---|---|
| date | Tue, 07 Aug 2018 05:44:02 -0400 |
| parents | 2593ba492276 |
| children | 86b57b062f96 |
comparison
equal
deleted
inserted
replaced
| 10:7a32e580f45d | 11:61844bce4115 |
|---|---|
| 16 <configfile name="sklearn_model_validation_script"> | 16 <configfile name="sklearn_model_validation_script"> |
| 17 <![CDATA[ | 17 <![CDATA[ |
| 18 import sys | 18 import sys |
| 19 import json | 19 import json |
| 20 import pandas | 20 import pandas |
| 21 import re | |
| 21 import ast | 22 import ast |
| 22 import pickle | 23 import pickle |
| 23 import numpy as np | 24 import numpy as np |
| 24 import sklearn.feature_selection | 25 import sklearn.feature_selection |
| 25 from sklearn import preprocessing, model_selection, svm, linear_model, ensemble, naive_bayes, tree, neighbors | 26 from sklearn import preprocessing, model_selection, svm, linear_model, ensemble, naive_bayes, tree, neighbors |
| 26 from sklearn.pipeline import Pipeline | 27 from sklearn.pipeline import Pipeline |
| 27 | 28 |
| 28 @COLUMNS_FUNCTION@ | 29 @COLUMNS_FUNCTION@ |
| 29 @GET_ESTIMATOR_FUNCTION@ | 30 @GET_ESTIMATOR_FUNCTION@ |
| 30 @FEATURE_SELECTOR_FUNCTION@ | 31 @FEATURE_SELECTOR_FUNCTION@ |
| 32 @SAFE_EVAL_FUNCTION@ | |
| 33 @GET_CV_FUNCTION@ | |
| 31 | 34 |
| 32 | 35 |
| 33 input_json_path = sys.argv[1] | 36 input_json_path = sys.argv[1] |
| 34 with open(input_json_path, "r") as param_handler: | 37 with open(input_json_path, "r") as param_handler: |
| 35 params = json.load(param_handler) | 38 params = json.load(param_handler) |
| 68 parse_dates=True | 71 parse_dates=True |
| 69 ) | 72 ) |
| 70 y=y.ravel() | 73 y=y.ravel() |
| 71 | 74 |
| 72 options = params["model_validation_functions"]["options"] | 75 options = params["model_validation_functions"]["options"] |
| 76 options['cv'] = get_cv( options['cv'] ) | |
| 73 if 'scoring' in options and options['scoring'] == '': | 77 if 'scoring' in options and options['scoring'] == '': |
| 74 options['scoring'] = None | 78 options['scoring'] = None |
| 75 if 'pre_dispatch' in options and options['pre_dispatch'] == '': | 79 if 'pre_dispatch' in options and options['pre_dispatch'] == '': |
| 76 options['pre_dispatch'] = None | 80 options['pre_dispatch'] = None |
| 77 | 81 |
