comparison svm.xml @ 8:1a9d5a8fff12 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c0a3a186966888e5787335a7628bf0a4382637e7
author bgruening
date Tue, 14 May 2019 18:03:50 -0400
parents 1c5989b930e3
children 153f237ddb36
comparison
equal deleted inserted replaced
7:372582a7a34d 8:1a9d5a8fff12
17 <![CDATA[ 17 <![CDATA[
18 import sys 18 import sys
19 import json 19 import json
20 import sklearn.svm 20 import sklearn.svm
21 import pandas 21 import pandas
22 22 import pickle
23 with open("$__tool_directory__/sk_whitelist.json", "r") as f: 23
24 sk_whitelist = json.load(f) 24 sys.path.insert(0, '$__tool_directory__')
25 exec(open("$__tool_directory__/utils.py").read(), globals()) 25 from utils import load_model, get_X_y
26 26
27 input_json_path = sys.argv[1] 27 input_json_path = sys.argv[1]
28 with open(input_json_path, "r") as param_handler: 28 with open(input_json_path, "r") as param_handler:
29 params = json.load(param_handler) 29 params = json.load(param_handler)
30 30
41 res = pandas.concat([data, prediction_df], axis=1) 41 res = pandas.concat([data, prediction_df], axis=1)
42 res.to_csv(path_or_buf = "$outfile_predict", sep="\t", index=False) 42 res.to_csv(path_or_buf = "$outfile_predict", sep="\t", index=False)
43 43
44 #else: 44 #else:
45 45
46 X, y = get_X_y(params, "$selected_tasks.selected_algorithms.input_options.infile1" ,"$selected_tasks.selected_algorithms.input_options.infile2") 46 X, y = get_X_y(params, "$selected_tasks.selected_algorithms.input_options.infile1", "$selected_tasks.selected_algorithms.input_options.infile2")
47 47
48 options = params["selected_tasks"]["selected_algorithms"]["options"] 48 options = params["selected_tasks"]["selected_algorithms"]["options"]
49 selected_algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"] 49 selected_algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"]
50 50
51 if not(selected_algorithm=="LinearSVC"): 51 if not(selected_algorithm=="LinearSVC"):