Mercurial > repos > bgruening > sklearn_nn_classifier
annotate nn_classifier.xml @ 17:699024d5c451 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5b2ac730ec6d3b762faa9034eddd19ad1b347476"
author | bgruening |
---|---|
date | Mon, 16 Dec 2019 05:31:46 -0500 |
parents | d0efc68a3ddb |
children | 1d3447c2203c |
rev | line source |
---|---|
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
1 <tool id="sklearn_nn_classifier" name="Nearest Neighbors Classification" version="@VERSION@"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
2 <description></description> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
3 <macros> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
4 <import>main_macros.xml</import> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
5 </macros> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
6 <expand macro="python_requirements"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
7 <expand macro="macro_stdio"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
8 <version_command>echo "@VERSION@"</version_command> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
9 <command><![CDATA[ |
2
c4ed38067415
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2afd4f6be8b2870c2b3701189b28111bfa3ca0ad
bgruening
parents:
1
diff
changeset
|
10 python '$nnc_script' '$inputs' |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
11 ]]> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
12 </command> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
13 <configfiles> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
14 <inputs name="inputs"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
15 <configfile name="nnc_script"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
16 <![CDATA[ |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
17 import sys |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
18 import json |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
19 import numpy as np |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
20 import sklearn.neighbors |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
21 import pandas |
10
e9ba818e7877
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c0a3a186966888e5787335a7628bf0a4382637e7
bgruening
parents:
9
diff
changeset
|
22 import pickle |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
23 |
12
d0efc68a3ddb
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 60f0fbc0eafd7c11bc60fb6c77f2937782efd8a9-dirty
bgruening
parents:
10
diff
changeset
|
24 from galaxy_ml.utils import load_model, get_X_y |
d0efc68a3ddb
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 60f0fbc0eafd7c11bc60fb6c77f2937782efd8a9-dirty
bgruening
parents:
10
diff
changeset
|
25 |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
26 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
27 input_json_path = sys.argv[1] |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
28 with open(input_json_path, "r") as param_handler: |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
29 params = json.load(param_handler) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
30 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
31 #if $selected_tasks.selected_task == "load": |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
32 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
33 with open("$infile_model", 'rb') as model_handler: |
7
5072ac474cd5
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2a058459e6daf0486871f93845f00fdb4a4eaca1
bgruening
parents:
6
diff
changeset
|
34 classifier_object = load_model(model_handler) |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
35 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
36 header = 'infer' if params["selected_tasks"]["header"] else None |
17
699024d5c451
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5b2ac730ec6d3b762faa9034eddd19ad1b347476"
bgruening
parents:
12
diff
changeset
|
37 data = pandas.read_csv("$selected_tasks.infile_data", sep='\t', header=header, index_col=None, parse_dates=True, encoding=None) |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
38 prediction = classifier_object.predict(data) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
39 prediction_df = pandas.DataFrame(prediction) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
40 res = pandas.concat([data, prediction_df], axis=1) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
41 res.to_csv(path_or_buf = "$outfile_predict", sep="\t", index=False) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
42 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
43 #else: |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
44 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
45 X, y = get_X_y(params, "$selected_tasks.selected_algorithms.input_options.infile1" ,"$selected_tasks.selected_algorithms.input_options.infile2") |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
46 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
47 selected_algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"] |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
48 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
49 if selected_algorithm == "nneighbors": |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
50 classifier = params["selected_tasks"]["selected_algorithms"]["sampling_methods"]["sampling_method"] |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
51 sys.stdout.write(classifier) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
52 options = params["selected_tasks"]["selected_algorithms"]["sampling_methods"]["options"] |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
53 sys.stdout.write(str(options)) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
54 elif selected_algorithm == "ncentroid": |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
55 options = params["selected_tasks"]["selected_algorithms"]["options"] |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
56 classifier = "NearestCentroid" |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
57 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
58 my_class = getattr(sklearn.neighbors, classifier) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
59 classifier_object = my_class(**options) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
60 classifier_object.fit(X, y) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
61 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
62 with open("$outfile_fit", 'wb') as out_handler: |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
63 pickle.dump(classifier_object, out_handler) |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
64 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
65 #end if |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
66 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
67 ]]> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
68 </configfile> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
69 </configfiles> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
70 <inputs> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
71 <expand macro="sl_Conditional" model="zip"><!--Todo: add sparse to targets--> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
72 <param name="selected_algorithm" type="select" label="Classifier type"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
73 <option value="nneighbors">Nearest Neighbors</option> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
74 <option value="ncentroid">Nearest Centroid</option> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
75 </param> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
76 <when value="nneighbors"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
77 <expand macro="sl_mixed_input"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
78 <conditional name="sampling_methods"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
79 <param name="sampling_method" type="select" label="Neighbor selection method"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
80 <option value="KNeighborsClassifier" selected="true">K-nearest neighbors</option> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
81 <option value="RadiusNeighborsClassifier">Radius-based</option> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
82 </param> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
83 <when value="KNeighborsClassifier"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
84 <expand macro="nn_advanced_options"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
85 <param argument="n_neighbors" type="integer" optional="true" value="5" label="Number of neighbors" help=" "/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
86 </expand> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
87 </when> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
88 <when value="RadiusNeighborsClassifier"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
89 <expand macro="nn_advanced_options"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
90 <param argument="radius" type="float" optional="true" value="1.0" label="Radius" |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
91 help="Range of parameter space to use by default for :meth ''radius_neighbors'' queries."/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
92 </expand> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
93 </when> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
94 </conditional> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
95 </when> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
96 <when value="ncentroid"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
97 <expand macro="sl_mixed_input"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
98 <section name="options" title="Advanced Options" expanded="False"> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
99 <param argument="metric" type="text" optional="true" value="euclidean" label="Metric" |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
100 help="The metric to use when calculating distance between instances in a feature array."/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
101 <param argument="shrink_threshold" type="float" optional="true" value="" label="Shrink threshold" |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
102 help="Floating point number for shrinking centroids to remove features."/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
103 </section> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
104 </when> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
105 </expand> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
106 </inputs> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
107 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
108 <expand macro="output"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
109 |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
110 <tests> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
111 <test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
112 <param name="infile1" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
113 <param name="infile2" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
114 <param name="header1" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
115 <param name="header2" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
116 <param name="col1" value="1,2,3,4"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
117 <param name="col2" value="5"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
118 <param name="selected_task" value="train"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
119 <param name="selected_algorithm" value="nneighbors"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
120 <param name="sampling_method" value="KNeighborsClassifier" /> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
121 <param name="algorithm" value="brute" /> |
9
ed7b1654e841
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
7
diff
changeset
|
122 <output name="outfile_fit" file="nn_model01" compare="sim_size" delta="5"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
123 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
124 <test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
125 <param name="infile1" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
126 <param name="infile2" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
127 <param name="header1" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
128 <param name="header2" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
129 <param name="col1" value="1,2,3,4"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
130 <param name="col2" value="5"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
131 <param name="selected_task" value="train"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
132 <param name="selected_algorithm" value="nneighbors"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
133 <param name="sampling_method" value="RadiusNeighborsClassifier" /> |
9
ed7b1654e841
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
7
diff
changeset
|
134 <output name="outfile_fit" file="nn_model02" compare="sim_size" delta="5"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
135 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
136 <test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
137 <param name="infile1" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
138 <param name="infile2" value="train_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
139 <param name="header1" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
140 <param name="header2" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
141 <param name="col1" value="1,2,3,4"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
142 <param name="col2" value="5"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
143 <param name="selected_task" value="train"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
144 <param name="selected_algorithm" value="ncentroid"/> |
9
ed7b1654e841
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57f4407e278a615f47a377a3328782b1d8e0b54d
bgruening
parents:
7
diff
changeset
|
145 <output name="outfile_fit" file="nn_model03" compare="sim_size" delta="5"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
146 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
147 <test> |
7
5072ac474cd5
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2a058459e6daf0486871f93845f00fdb4a4eaca1
bgruening
parents:
6
diff
changeset
|
148 <param name="infile_model" value="nn_model01" ftype="zip"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
149 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
150 <param name="header" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
151 <param name="selected_task" value="load"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
152 <output name="outfile_predict" file="nn_prediction_result01.tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
153 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
154 <test> |
7
5072ac474cd5
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2a058459e6daf0486871f93845f00fdb4a4eaca1
bgruening
parents:
6
diff
changeset
|
155 <param name="infile_model" value="nn_model02" ftype="zip"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
156 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
157 <param name="header" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
158 <param name="selected_task" value="load"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
159 <output name="outfile_predict" file="nn_prediction_result02.tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
160 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
161 <test> |
7
5072ac474cd5
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 2a058459e6daf0486871f93845f00fdb4a4eaca1
bgruening
parents:
6
diff
changeset
|
162 <param name="infile_model" value="nn_model03" ftype="zip"/> |
0
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
163 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
164 <param name="header" value="True"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
165 <param name="selected_task" value="load"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
166 <output name="outfile_predict" file="nn_prediction_result03.tabular"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
167 </test> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
168 </tests> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
169 <help><![CDATA[ |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
170 **What it does** |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
171 This module implements the k-nearest neighbors classification algorithms. |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
172 For more information check http://scikit-learn.org/stable/modules/neighbors.html |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
173 ]]></help> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
174 <expand macro="sklearn_citation"/> |
b7d0fc23bfe4
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cbb681224f23fa95783514f949c97d6c2c60966
bgruening
parents:
diff
changeset
|
175 </tool> |