Mercurial > repos > bgruening > sklearn_train_test_split
diff keras_deep_learning.py @ 6:13b9ac5d277c draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 208a8d348e7c7a182cfbe1b6f17868146428a7e2"
author | bgruening |
---|---|
date | Tue, 13 Apr 2021 22:24:07 +0000 |
parents | 5a092779412e |
children | 3312fb686ffb |
line wrap: on
line diff
--- a/keras_deep_learning.py Fri Oct 02 08:59:31 2020 +0000 +++ b/keras_deep_learning.py Tue Apr 13 22:24:07 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() @@ -177,11 +177,11 @@ # merge layers if 'merging_layers' in options: idxs = literal_eval(options.pop('merging_layers')) - merging_layers = [all_layers[i-1] for i in idxs] + merging_layers = [all_layers[i - 1] for i in idxs] new_layer = klass(**options)(merging_layers) # non-input layers elif inbound_nodes is not None: - new_layer = klass(**options)(all_layers[inbound_nodes-1]) + new_layer = klass(**options)(all_layers[inbound_nodes - 1]) # input layers else: new_layer = klass(**options) @@ -189,10 +189,10 @@ all_layers.append(new_layer) input_indexes = _handle_shape(config['input_layers']) - input_layers = [all_layers[i-1] for i in input_indexes] + input_layers = [all_layers[i - 1] for i in input_indexes] output_indexes = _handle_shape(config['output_layers']) - output_layers = [all_layers[i-1] for i in output_indexes] + output_layers = [all_layers[i - 1] for i in output_indexes] return Model(inputs=input_layers, outputs=output_layers) @@ -300,8 +300,7 @@ options.update((inputs['mode_selection']['compile_params'] ['optimizer_selection']['optimizer_options'])) - train_metrics = (inputs['mode_selection']['compile_params'] - ['metrics']).split(',') + train_metrics = inputs['mode_selection']['compile_params']['metrics'] if train_metrics[-1] == 'none': train_metrics = train_metrics[:-1] options['metrics'] = train_metrics