comparison search_model_validation.py @ 10:a9e0b963b7bb draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 208a8d348e7c7a182cfbe1b6f17868146428a7e2"
author bgruening
date Tue, 13 Apr 2021 22:04:06 +0000
parents ead7adad8d0e
children caf7d2b71a48
comparison
equal deleted inserted replaced
9:ead7adad8d0e 10:a9e0b963b7bb
1 import argparse 1 import argparse
2 import collections 2 import collections
3 import json
4 import os
5 import pickle
6 import sys
7 import warnings
8
3 import imblearn 9 import imblearn
4 import joblib 10 import joblib
5 import json
6 import numpy as np 11 import numpy as np
7 import os
8 import pandas as pd 12 import pandas as pd
9 import pickle
10 import skrebate 13 import skrebate
11 import sys 14 from galaxy_ml.utils import (
12 import warnings 15 clean_params,
16 get_cv,
17 get_main_estimator,
18 get_module,
19 get_scoring,
20 load_model,
21 read_columns,
22 SafeEval,
23 try_get_attr
24 )
13 from scipy.io import mmread 25 from scipy.io import mmread
14 from sklearn import ( 26 from sklearn import (
15 cluster, 27 cluster,
16 decomposition, 28 decomposition,
17 feature_selection, 29 feature_selection,
18 kernel_approximation, 30 kernel_approximation,
19 model_selection, 31 model_selection,
20 preprocessing, 32 preprocessing,
21 ) 33 )
22 from sklearn.exceptions import FitFailedWarning 34 from sklearn.exceptions import FitFailedWarning
35 from sklearn.model_selection import _search, _validation
23 from sklearn.model_selection._validation import _score, cross_validate 36 from sklearn.model_selection._validation import _score, cross_validate
24 from sklearn.model_selection import _search, _validation
25 from sklearn.pipeline import Pipeline
26
27 from galaxy_ml.utils import (
28 SafeEval,
29 get_cv,
30 get_scoring,
31 load_model,
32 read_columns,
33 try_get_attr,
34 get_module,
35 clean_params,
36 get_main_estimator,
37 )
38 37
39 38
40 _fit_and_score = try_get_attr("galaxy_ml.model_validations", "_fit_and_score") 39 _fit_and_score = try_get_attr("galaxy_ml.model_validations", "_fit_and_score")
41 setattr(_search, "_fit_and_score", _fit_and_score) 40 setattr(_search, "_fit_and_score", _fit_and_score)
42 setattr(_validation, "_fit_and_score", _fit_and_score) 41 setattr(_validation, "_fit_and_score", _fit_and_score)