Mercurial > repos > bgruening > nn_classifier
annotate nn_classifier.xml @ 10:657377594769 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 35fa73d6e9ba8f0789ddfb743d893d950a68af02
author | bgruening |
---|---|
date | Tue, 10 Apr 2018 15:14:41 -0400 |
parents | 25a68adb2ade |
children | c64f57fe1b97 |
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 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
24 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
|
25 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
|
26 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
27 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
28 #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
|
29 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
30 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
|
31 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
32 data = pandas.read_csv("$selected_tasks.infile_data", sep='\t', header=0, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False ) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
33 prediction = classifier_object.predict(data) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
34 prediction_df = pandas.DataFrame(prediction) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
35 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
|
36 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
|
37 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
38 #else: |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
39 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
40 data_train = pandas.read_csv("$selected_tasks.infile_train", sep='\t', header=0, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False ) |
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 data = data_train.ix[:,0:len(data_train.columns)-1] |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
43 labels = np.array(data_train[data_train.columns[len(data_train.columns)-1]]) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
44 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
45 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
|
46 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
47 if selected_algorithm == "nneighbors": |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
48 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
|
49 sys.stdout.write(classifier) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
50 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
|
51 sys.stdout.write(str(options)) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
52 elif selected_algorithm == "ncentroid": |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
53 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
|
54 classifier = "NearestCentroid" |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
55 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
56 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
|
57 classifier_object = my_class(**options) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
58 classifier_object.fit(data,labels) |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
59 |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
60 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
|
61 |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
62 #end if |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
63 |
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 </configfile> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
66 </configfiles> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
67 <inputs> |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
68 <expand macro="train_loadConditional" 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
|
69 <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
|
70 <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
|
71 <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
|
72 </param> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
73 <when value="nneighbors"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
74 <conditional name="sampling_methods"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
75 <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
|
76 <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
|
77 <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
|
78 </param> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
79 <when value="KNeighborsClassifier"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
80 <expand macro="nn_advanced_options"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
81 <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
|
82 </expand> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
83 </when> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
84 <when value="RadiusNeighborsClassifier"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
85 <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
|
86 <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
|
87 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
|
88 </expand> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
89 </when> |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
90 </conditional> |
0
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
91 </when> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
92 <when value="ncentroid"> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
93 <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
|
94 <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
|
95 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
|
96 <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
|
97 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
|
98 </section> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
99 </when> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
100 </expand> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
101 </inputs> |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
102 |
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
103 <expand macro="output"/> |
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
104 |
0
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
105 <tests> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
106 <test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
107 <param name="infile_train" value="train_set.tabular" ftype="tabular"/> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
108 <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
|
109 <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
|
110 <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
|
111 <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
|
112 <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
|
113 </test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
114 <test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
115 <param name="infile_train" value="train_set.tabular" ftype="tabular"/> |
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=""/> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
118 <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
|
119 <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
|
120 <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
|
121 </test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
122 <test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
123 <param name="infile_train" value="train_set.tabular" ftype="tabular"/> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
124 <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
|
125 <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
|
126 <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
|
127 </test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
128 <test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
129 <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
|
130 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
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="load"/> |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
132 <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
|
133 </test> |
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 <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
|
136 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
137 <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
|
138 <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
|
139 </test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
140 <test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
141 <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
|
142 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
143 <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
|
144 <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
|
145 </test> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
146 </tests> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
147 <help><![CDATA[ |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
148 **What it does** |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
149 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
|
150 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
|
151 ]]></help> |
4354c286f7a7
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff
changeset
|
152 <expand macro="sklearn_citation"/> |
5
25a68adb2ade
planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents:
0
diff
changeset
|
153 </tool> |