annotate svm.xml @ 5:86eb3864c899 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
author bgruening
date Fri, 16 Feb 2018 09:12:19 -0500
parents 4f1b0620ea89
children b70724d5445e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
1 <tool id="svm_classifier" name="Support vector machines (SVMs)" version="@VERSION@">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
2 <description>for classification</description>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
3 <macros>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
4 <import>main_macros.xml</import>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
5 <!-- macro name="class_weight" argument="class_weight"-->
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
6 </macros>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
7 <expand macro="python_requirements"/>
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
8 <expand macro="macro_stdio"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
9 <version_command>echo "@VERSION@"</version_command>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
10 <command><![CDATA[
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
11 python "$svc_script" '$inputs'
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
12 ]]>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
13 </command>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
14 <configfiles>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
15 <inputs name="inputs"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
16 <configfile name="svc_script">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
17 <![CDATA[
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
18 import sys
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
19 import json
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
20 import numpy as np
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
21 import sklearn.svm
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
22 import pandas
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
23 import pickle
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
24
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
25 input_json_path = sys.argv[1]
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
26 params = json.load(open(input_json_path, "r"))
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
27
4f1b0620ea89 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":
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
29
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
30 classifier_object = pickle.load(open("$infile_model", 'rb'))
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
31
4f1b0620ea89 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 )
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
33 prediction = classifier_object.predict(data)
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
34 prediction_df = pandas.DataFrame(prediction)
4f1b0620ea89 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
86eb3864c899 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
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
37
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
38 #else:
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
39
4f1b0620ea89 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 )
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
41
4f1b0620ea89 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]
4f1b0620ea89 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]])
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
44
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
45 options = params["selected_tasks"]["selected_algorithms"]["options"]
4f1b0620ea89 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"]
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
47
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
48 if not(selected_algorithm=="LinearSVC"):
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
49 if options["kernel"]:
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
50 options["kernel"] = str(options["kernel"])
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
51
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
52 my_class = getattr(sklearn.svm, selected_algorithm)
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
53 classifier_object = my_class(**options)
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
54 classifier_object.fit(data,labels)
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
55
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
56 pickle.dump(classifier_object,open("$outfile_fit", 'w+'))
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
57
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
58 #end if
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
59
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
60 ]]>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
61 </configfile>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
62 </configfiles>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
63 <inputs>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
64 <expand macro="train_loadConditional" model="zip">
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
65 <param name="selected_algorithm" type="select" label="Classifier type">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
66 <option value="SVC">C-Support Vector Classification</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
67 <option value="NuSVC">Nu-Support Vector Classification</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
68 <option value="LinearSVC">Linear Support Vector Classification</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
69 </param>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
70 <when value="SVC">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
71 <expand macro="svc_advanced_options">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
72 <expand macro="C"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
73 </expand>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
74 </when>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
75 <when value="NuSVC">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
76 <expand macro="svc_advanced_options">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
77 <param argument="nu" type="float" optional="true" value="0.5" label="Nu control parameter" help="Controls the number of support vectors. Should be in the interval (0, 1]. "/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
78 </expand>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
79 </when>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
80 <when value="LinearSVC">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
81 <section name="options" title="Advanced Options" expanded="False">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
82 <expand macro="C"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
83 <expand macro="tol" default_value="0.001" help_text="Tolerance for stopping criterion. "/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
84 <expand macro="random_state" help_text="Integer number. The seed of the pseudo random number generator to use when shuffling the data for probability estimation. A fixed seed allows reproducible results."/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
85 <!--expand macro="class_weight"/-->
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
86 <param argument="max_iter" type="integer" optional="true" value="1000" label="Maximum number of iterations" help="The maximum number of iterations to be run."/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
87 <param argument="loss" type="select" label="Loss function" help="Specifies the loss function. ''squared_hinge'' is the square of the hinge loss.">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
88 <option value="squared_hinge" selected="true">Squared hinge</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
89 <option value="hinge">Hinge</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
90 </param>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
91 <param argument="penalty" type="select" label="Penalization norm" help=" ">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
92 <option value="l1" >l1</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
93 <option value="l2" selected="true">l2</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
94 </param>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
95 <param argument="dual" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Use the shrinking heuristic" help="Select the algorithm to either solve the dual or primal optimization problem. Prefer dual=False when n_samples > n_features."/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
96 <param argument="multi_class" type="select" label="Multi-class strategy" help="Determines the multi-class strategy if y contains more than two classes.">
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
97 <option value="ovr" selected="true">ovr</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
98 <option value="crammer_singer" >crammer_singer</option>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
99 </param>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
100 <param argument="fit_intercept" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolflase" checked="true" label="Calculate the intercept for this model" help="If set to false, data is expected to be already centered."/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
101 <param argument="intercept_scaling" type="float" optional="true" value="1" label="Add synthetic feature to the instance vector" help=" "/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
102 </section>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
103 </when>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
104 </expand>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
105 </inputs>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
106
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
107 <expand macro="output"/>
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
108
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
109 <tests>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
110 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
111 <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
112 <param name="selected_task" value="train"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
113 <param name="selected_algorithm" value="SVC"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
114 <param name="random_state" value="5"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
115 <output name="outfile_fit" file="svc_model01.txt"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
116 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
117 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
118 <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
119 <param name="selected_task" value="train"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
120 <param name="selected_algorithm" value="NuSVC"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
121 <param name="random_state" value="5"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
122 <output name="outfile_fit" file="svc_model02.txt"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
123 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
124 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
125 <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
126 <param name="selected_task" value="train"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
127 <param name="selected_algorithm" value="LinearSVC"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
128 <param name="random_state" value="5"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
129 <output name="outfile_fit" file="svc_model03.txt"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
130 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
131 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
132 <param name="infile_model" value="svc_model01.txt" ftype="txt"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
133 <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
134 <param name="selected_task" value="load"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
135 <output name="outfile_predict" file="svc_prediction_result01.tabular"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
136 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
137 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
138 <param name="infile_model" value="svc_model02.txt" ftype="txt"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
139 <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
140 <param name="selected_task" value="load"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
141 <output name="outfile_predict" file="svc_prediction_result02.tabular"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
142 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
143 <test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
144 <param name="infile_model" value="svc_model03.txt" ftype="txt"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
145 <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
146 <param name="selected_task" value="load"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
147 <output name="outfile_predict" file="svc_prediction_result03.tabular"/>
0
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
148 </test>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
149 </tests>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
150 <help><![CDATA[
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
151 **What it does**
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
152 This module implements the Support Vector Machine (SVM) classification algorithms.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
153 Support vector machines (SVMs) are a set of supervised learning methods used for classification, regression and outliers detection.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
154
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
155 **The advantages of support vector machines are:**
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
156
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
157 1- Effective in high dimensional spaces.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
158
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
159 2- Still effective in cases where number of dimensions is greater than the number of samples.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
160
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
161 3- Uses a subset of training points in the decision function (called support vectors), so it is also memory efficient.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
162
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
163 4- Versatile: different Kernel functions can be specified for the decision function. Common kernels are provided, but it is also possible to specify custom kernels.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
164
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
165 **The disadvantages of support vector machines include:**
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
166
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
167 1- If the number of features is much greater than the number of samples, the method is likely to give poor performances.
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
168
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
169 2- SVMs do not directly provide probability estimates, these are calculated using an expensive five-fold cross-validation
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
170
4f1b0620ea89 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
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
172
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
173 ]]>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
174 </help>
4f1b0620ea89 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a6e80305ed0892c8163d690a2d376d6b454824de-dirty
bgruening
parents:
diff changeset
175 <expand macro="sklearn_citation"/>
5
86eb3864c899 planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
bgruening
parents: 0
diff changeset
176 </tool>