annotate nn_classifier.xml @ 18:c64f57fe1b97 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
author bgruening
date Mon, 09 Jul 2018 14:26:44 -0400 (2018-07-09)
parents 25a68adb2ade
children fa36c40c2990
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]
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
28 params = json.load(open(input_json_path, "r"))
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
29
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
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
33 classifier_object = pickle.load(open("$infile_model", 'r'))
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
34
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
35 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
36 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
37 prediction = classifier_object.predict(data)
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
38 prediction_df = pandas.DataFrame(prediction)
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
39 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
40 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
41
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
42 #else:
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
43
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
44 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
45
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
46 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
47
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
48 if selected_algorithm == "nneighbors":
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
49 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
50 sys.stdout.write(classifier)
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
51 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
52 sys.stdout.write(str(options))
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
53 elif selected_algorithm == "ncentroid":
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
54 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
55 classifier = "NearestCentroid"
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
56
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
57 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
58 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
59 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
60
5
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
61 pickle.dump(classifier_object,open("$outfile_fit", 'w+'))
0
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
62
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
63 #end if
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 ]]>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
66 </configfile>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
67 </configfiles>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
68 <inputs>
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
69 <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
70 <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
71 <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
72 <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
73 </param>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
74 <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
75 <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
76 <conditional name="sampling_methods">
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
77 <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
78 <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
79 <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
80 </param>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
81 <when value="KNeighborsClassifier">
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
82 <expand macro="nn_advanced_options">
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
83 <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
84 </expand>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
85 </when>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
86 <when value="RadiusNeighborsClassifier">
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
87 <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
88 <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
89 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
90 </expand>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
91 </when>
5
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
92 </conditional>
0
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
93 </when>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
94 <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
95 <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
96 <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
97 <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
98 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
99 <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
100 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
101 </section>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
102 </when>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
103 </expand>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
104 </inputs>
5
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
105
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
106 <expand macro="output"/>
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
107
0
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
108 <tests>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
109 <test>
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
110 <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
111 <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
112 <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
113 <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
114 <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
115 <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
116 <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
117 <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
118 <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
119 <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
120 <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
121 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
122 <test>
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
123 <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
124 <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
125 <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
126 <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
127 <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
128 <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
129 <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
130 <param name="selected_algorithm" value=""/>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
131 <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
132 <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
133 <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
134 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
135 <test>
18
c64f57fe1b97 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
bgruening
parents: 5
diff changeset
136 <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
137 <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
138 <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
139 <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
140 <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
141 <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
142 <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
143 <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
144 <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
145 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
146 <test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
147 <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
148 <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
149 <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
150 <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
151 <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
152 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
153 <test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
154 <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
155 <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
156 <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
157 <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
158 <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
159 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
160 <test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
161 <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
162 <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
163 <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
164 <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
165 <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
166 </test>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
167 </tests>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
168 <help><![CDATA[
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
169 **What it does**
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
170 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
171 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
172 ]]></help>
4354c286f7a7 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
173 <expand macro="sklearn_citation"/>
5
25a68adb2ade planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
174 </tool>