Mercurial > repos > bgruening > sklearn_regression_metrics
comparison regression_metrics.xml @ 17:25b74e5f42f4 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c0a3a186966888e5787335a7628bf0a4382637e7
| author | bgruening |
|---|---|
| date | Tue, 14 May 2019 17:53:59 -0400 |
| parents | d2d36ee2c061 |
| children | 3cc8a461bc5d |
comparison
equal
deleted
inserted
replaced
| 16:939e3666cad5 | 17:25b74e5f42f4 |
|---|---|
| 19 import json | 19 import json |
| 20 import pandas | 20 import pandas |
| 21 import numpy as np | 21 import numpy as np |
| 22 from sklearn import metrics | 22 from sklearn import metrics |
| 23 | 23 |
| 24 exec(open("$__tool_directory__/utils.py").read(), globals()) | 24 sys.path.insert(0, '$__tool_directory__') |
| 25 from utils import read_columns | |
| 25 | 26 |
| 26 input_json_path = sys.argv[1] | 27 input_json_path = sys.argv[1] |
| 27 with open(input_json_path, "r") as param_handler: | 28 with open(input_json_path, "r") as param_handler: |
| 28 params = json.load(param_handler) | 29 params = json.load(param_handler) |
| 29 | 30 |
| 37 "$regression_metrics.infile1", | 38 "$regression_metrics.infile1", |
| 38 c = c, | 39 c = c, |
| 39 c_option = column_option, | 40 c_option = column_option, |
| 40 sep='\t', | 41 sep='\t', |
| 41 header=header, | 42 header=header, |
| 42 parse_dates=True | 43 parse_dates=True) |
| 43 ) | |
| 44 | 44 |
| 45 header='infer' if params["regression_metrics"]["header2"] else None | 45 header='infer' if params["regression_metrics"]["header2"] else None |
| 46 column_option = params["regression_metrics"]["column_selector_options_2"]["selected_column_selector_option2"] | 46 column_option = params["regression_metrics"]["column_selector_options_2"]["selected_column_selector_option2"] |
| 47 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]: | 47 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]: |
| 48 c = params["regression_metrics"]["column_selector_options_2"]["col2"] | 48 c = params["regression_metrics"]["column_selector_options_2"]["col2"] |
| 52 "$regression_metrics.infile2", | 52 "$regression_metrics.infile2", |
| 53 c = c, | 53 c = c, |
| 54 c_option = column_option, | 54 c_option = column_option, |
| 55 sep='\t', | 55 sep='\t', |
| 56 header=header, | 56 header=header, |
| 57 parse_dates=True | 57 parse_dates=True) |
| 58 ) | |
| 59 | 58 |
| 60 options = params["regression_metrics"].get("options", {}) | 59 options = params["regression_metrics"].get("options", {}) |
| 61 if options and options.get('average', '') == 'None': | 60 if options and options.get('average', '') == 'None': |
| 62 options['average'] = None | 61 options['average'] = None |
| 63 metric = params["regression_metrics"]["selected_metric"] | 62 metric = params["regression_metrics"]["selected_metric"] |
