# HG changeset patch # User bgruening # Date 1618353369 0 # Node ID 586e68c83df2d2098e500f8b9a693a78ec49d9cc # Parent cb5635e30842f30c089f5587d132d201e0a9e7f6 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 208a8d348e7c7a182cfbe1b6f17868146428a7e2" diff -r cb5635e30842 -r 586e68c83df2 fitted_model_eval.py --- a/fitted_model_eval.py Tue Apr 13 18:41:36 2021 +0000 +++ b/fitted_model_eval.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,13 +1,13 @@ import argparse import json -import pandas as pd import warnings +import pandas as pd +from galaxy_ml.utils import get_scoring, load_model, read_columns from scipy.io import mmread -from sklearn.pipeline import Pipeline from sklearn.metrics.scorer import _check_multimetric_scoring from sklearn.model_selection._validation import _score -from galaxy_ml.utils import get_scoring, load_model, read_columns +from sklearn.pipeline import Pipeline def _get_X_y(params, infile1, infile2): diff -r cb5635e30842 -r 586e68c83df2 keras_deep_learning.py --- a/keras_deep_learning.py Tue Apr 13 18:41:36 2021 +0000 +++ b/keras_deep_learning.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,14 +1,14 @@ import argparse import json +import pickle +import warnings +from ast import literal_eval + import keras import pandas as pd -import pickle import six -import warnings - -from ast import literal_eval -from keras.models import Sequential, Model -from galaxy_ml.utils import try_get_attr, get_search_params, SafeEval +from galaxy_ml.utils import get_search_params, SafeEval, try_get_attr +from keras.models import Model, Sequential safe_eval = SafeEval() diff -r cb5635e30842 -r 586e68c83df2 keras_train_and_eval.py --- a/keras_train_and_eval.py Tue Apr 13 18:41:36 2021 +0000 +++ b/keras_train_and_eval.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,32 +1,32 @@ import argparse -import joblib import json -import numpy as np import os -import pandas as pd import pickle import warnings from itertools import chain -from scipy.io import mmread -from sklearn.pipeline import Pipeline -from sklearn.metrics.scorer import _check_multimetric_scoring -from sklearn.model_selection._validation import _score -from sklearn.model_selection import _search, _validation -from sklearn.utils import indexable, safe_indexing +import joblib +import numpy as np +import pandas as pd from galaxy_ml.externals.selene_sdk.utils import compute_score -from galaxy_ml.model_validations import train_test_split from galaxy_ml.keras_galaxy_models import _predict_generator +from galaxy_ml.model_validations import train_test_split from galaxy_ml.utils import ( - SafeEval, + clean_params, + get_main_estimator, + get_module, get_scoring, load_model, read_columns, + SafeEval, try_get_attr, - get_module, - clean_params, - get_main_estimator, ) +from scipy.io import mmread +from sklearn.metrics.scorer import _check_multimetric_scoring +from sklearn.model_selection import _search, _validation +from sklearn.model_selection._validation import _score +from sklearn.pipeline import Pipeline +from sklearn.utils import indexable, safe_indexing _fit_and_score = try_get_attr("galaxy_ml.model_validations", "_fit_and_score") @@ -104,7 +104,7 @@ rval = train_test_split(*new_arrays, **kwargs) for pos in nones: - rval[pos * 2 : 2] = [None, None] + rval[pos * 2: 2] = [None, None] return rval diff -r cb5635e30842 -r 586e68c83df2 ml_visualization_ex.py --- a/ml_visualization_ex.py Tue Apr 13 18:41:36 2021 +0000 +++ b/ml_visualization_ex.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,21 +1,20 @@ import argparse import json +import os +import warnings + import matplotlib import matplotlib.pyplot as plt import numpy as np -import os import pandas as pd import plotly import plotly.graph_objs as go -import warnings - +from galaxy_ml.utils import load_model, read_columns, SafeEval from keras.models import model_from_json from keras.utils import plot_model from sklearn.feature_selection.base import SelectorMixin -from sklearn.metrics import precision_recall_curve, average_precision_score -from sklearn.metrics import roc_curve, auc, confusion_matrix +from sklearn.metrics import auc, average_precision_score, confusion_matrix, precision_recall_curve, roc_curve from sklearn.pipeline import Pipeline -from galaxy_ml.utils import load_model, read_columns, SafeEval safe_eval = SafeEval() diff -r cb5635e30842 -r 586e68c83df2 model_prediction.py --- a/model_prediction.py Tue Apr 13 18:41:36 2021 +0000 +++ b/model_prediction.py Tue Apr 13 22:36:09 2021 +0000 @@ -4,13 +4,10 @@ import numpy as np import pandas as pd +from galaxy_ml.utils import get_module, load_model, read_columns, try_get_attr from scipy.io import mmread from sklearn.pipeline import Pipeline -from galaxy_ml.utils import (get_module, load_model, - read_columns, try_get_attr) - - N_JOBS = int(__import__("os").environ.get("GALAXY_SLOTS", 1)) diff -r cb5635e30842 -r 586e68c83df2 search_model_validation.py --- a/search_model_validation.py Tue Apr 13 18:41:36 2021 +0000 +++ b/search_model_validation.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,15 +1,27 @@ import argparse import collections +import json +import os +import pickle +import sys +import warnings + import imblearn import joblib -import json import numpy as np -import os import pandas as pd -import pickle import skrebate -import sys -import warnings +from galaxy_ml.utils import ( + clean_params, + get_cv, + get_main_estimator, + get_module, + get_scoring, + load_model, + read_columns, + SafeEval, + try_get_attr +) from scipy.io import mmread from sklearn import ( cluster, @@ -20,21 +32,8 @@ preprocessing, ) from sklearn.exceptions import FitFailedWarning +from sklearn.model_selection import _search, _validation from sklearn.model_selection._validation import _score, cross_validate -from sklearn.model_selection import _search, _validation -from sklearn.pipeline import Pipeline - -from galaxy_ml.utils import ( - SafeEval, - get_cv, - get_scoring, - load_model, - read_columns, - try_get_attr, - get_module, - clean_params, - get_main_estimator, -) _fit_and_score = try_get_attr("galaxy_ml.model_validations", "_fit_and_score") diff -r cb5635e30842 -r 586e68c83df2 simple_model_fit.py --- a/simple_model_fit.py Tue Apr 13 18:41:36 2021 +0000 +++ b/simple_model_fit.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,8 +1,8 @@ import argparse import json -import pandas as pd import pickle +import pandas as pd from galaxy_ml.utils import load_model, read_columns from scipy.io import mmread from sklearn.pipeline import Pipeline diff -r cb5635e30842 -r 586e68c83df2 stacking_ensembles.py --- a/stacking_ensembles.py Tue Apr 13 18:41:36 2021 +0000 +++ b/stacking_ensembles.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,13 +1,14 @@ import argparse import ast import json -import mlxtend.regressor -import mlxtend.classifier -import pandas as pd import pickle import sys import warnings -from galaxy_ml.utils import load_model, get_cv, get_estimator, get_search_params + +import mlxtend.classifier +import mlxtend.regressor +import pandas as pd +from galaxy_ml.utils import get_cv, get_estimator, get_search_params, load_model warnings.filterwarnings("ignore") diff -r cb5635e30842 -r 586e68c83df2 train_test_eval.py --- a/train_test_eval.py Tue Apr 13 18:41:36 2021 +0000 +++ b/train_test_eval.py Tue Apr 13 22:36:09 2021 +0000 @@ -3,7 +3,6 @@ import os import pickle import warnings - from itertools import chain import joblib @@ -21,7 +20,6 @@ from scipy.io import mmread from sklearn import pipeline from sklearn.metrics.scorer import _check_multimetric_scoring -from sklearn.model_selection._validation import _score from sklearn.model_selection import _search, _validation from sklearn.model_selection._validation import _score from sklearn.utils import indexable, safe_indexing diff -r cb5635e30842 -r 586e68c83df2 train_test_split.py --- a/train_test_split.py Tue Apr 13 18:41:36 2021 +0000 +++ b/train_test_split.py Tue Apr 13 22:36:09 2021 +0000 @@ -1,8 +1,8 @@ import argparse import json -import pandas as pd import warnings +import pandas as pd from galaxy_ml.model_validations import train_test_split from galaxy_ml.utils import get_cv, read_columns