annotate nn_classifier.xml @ 20:fa36c40c2990 draft

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