diff nn_classifier.xml @ 5:25a68adb2ade draft

planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit 0e582cf1f3134c777cce3aa57d71b80ed95e6ba9
author bgruening
date Fri, 16 Feb 2018 09:13:21 -0500
parents 4354c286f7a7
children c64f57fe1b97
line wrap: on
line diff
--- a/nn_classifier.xml	Thu Jun 23 15:26:05 2016 -0400
+++ b/nn_classifier.xml	Fri Feb 16 09:13:21 2018 -0500
@@ -33,7 +33,7 @@
 prediction = classifier_object.predict(data)
 prediction_df = pandas.DataFrame(prediction)
 res = pandas.concat([data, prediction_df], axis=1)
-res.to_csv(path_or_buf = "$outfile", sep="\t", index=False)
+res.to_csv(path_or_buf = "$outfile_predict", sep="\t", index=False)
 
 #else:
 
@@ -57,7 +57,7 @@
 classifier_object = my_class(**options)
 classifier_object.fit(data,labels)
 
-pickle.dump(classifier_object,open("$outfile", 'w+'))
+pickle.dump(classifier_object,open("$outfile_fit", 'w+'))
 
 #end if
 
@@ -65,7 +65,7 @@
         </configfile>
     </configfiles>
     <inputs>
-        <expand macro="train_loadConditional"><!--Todo: add sparse to targets-->
+        <expand macro="train_loadConditional" model="zip"><!--Todo: add sparse to targets-->
             <param name="selected_algorithm" type="select" label="Classifier type">
                 <option value="nneighbors">Nearest Neighbors</option>
                 <option value="ncentroid">Nearest Centroid</option>
@@ -83,22 +83,25 @@
                     </when>
                     <when value="RadiusNeighborsClassifier">
                         <expand macro="nn_advanced_options">
-                            <param argument="radius" type="float" optional="true" value="1.0" label="Radius" help="Range of parameter space to use by default for :meth ''radius_neighbors'' queries."/>
+                            <param argument="radius" type="float" optional="true" value="1.0" label="Radius"
+                                help="Range of parameter space to use by default for :meth ''radius_neighbors'' queries."/>
                         </expand>
                     </when>
-                </conditional>  
+                </conditional>
             </when>
             <when value="ncentroid">
                 <section name="options" title="Advanced Options" expanded="False">
-                    <param argument="metric" type="text" optional="true" value="euclidean" label="Metric" help="The metric to use when calculating distance between instances in a feature array."/>
-                    <param argument="shrink_threshold" type="float" optional="true" value="" label="Shrink threshold" help="Floating point number for shrinking centroids to remove features."/>
+                    <param argument="metric" type="text" optional="true" value="euclidean" label="Metric"
+                        help="The metric to use when calculating distance between instances in a feature array."/>
+                    <param argument="shrink_threshold" type="float" optional="true" value="" label="Shrink threshold"
+                        help="Floating point number for shrinking centroids to remove features."/>
                 </section>
             </when>
         </expand>
     </inputs>
-    <outputs>
-        <data format="txt" name="outfile"/>
-    </outputs>
+
+    <expand macro="output"/>
+
     <tests>
         <test>
             <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
@@ -106,7 +109,7 @@
             <param name="selected_algorithm" value="nneighbors"/>
             <param name="sampling_method" value="KNeighborsClassifier" />
             <param name="algorithm" value="brute" />
-            <output name="outfile" file="nn_model01.txt"/>
+            <output name="outfile_fit" file="nn_model01.txt"/>
         </test>
         <test>
             <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
@@ -114,31 +117,31 @@
             <param name="selected_algorithm" value=""/>
             <param name="selected_algorithm" value="nneighbors"/>
             <param name="sampling_method" value="RadiusNeighborsClassifier" />
-            <output name="outfile" file="nn_model02.txt"/>
+            <output name="outfile_fit" file="nn_model02.txt"/>
         </test>
         <test>
             <param name="infile_train" value="train_set.tabular" ftype="tabular"/>
             <param name="selected_task" value="train"/>
             <param name="selected_algorithm" value="ncentroid"/>
-            <output name="outfile" file="nn_model03.txt"/>
+            <output name="outfile_fit" file="nn_model03.txt"/>
         </test>
         <test>
             <param name="infile_model" value="nn_model01.txt" ftype="txt"/>
             <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
             <param name="selected_task" value="load"/>
-            <output name="outfile" file="nn_prediction_result01.tabular"/>
+            <output name="outfile_predict" file="nn_prediction_result01.tabular"/>
         </test>
         <test>
             <param name="infile_model" value="nn_model02.txt" ftype="txt"/>
             <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
             <param name="selected_task" value="load"/>
-            <output name="outfile" file="nn_prediction_result02.tabular"/>
+            <output name="outfile_predict" file="nn_prediction_result02.tabular"/>
         </test>
         <test>
             <param name="infile_model" value="nn_model03.txt" ftype="txt"/>
             <param name="infile_data" value="test_set.tabular" ftype="tabular"/>
             <param name="selected_task" value="load"/>
-            <output name="outfile" file="nn_prediction_result03.tabular"/>
+            <output name="outfile_predict" file="nn_prediction_result03.tabular"/>
         </test>
     </tests>
     <help><![CDATA[
@@ -147,4 +150,4 @@
 For more information check http://scikit-learn.org/stable/modules/neighbors.html
     ]]></help>
     <expand macro="sklearn_citation"/>
-</tool>
\ No newline at end of file
+</tool>