Mercurial > repos > bgruening > sklearn_nn_classifier
comparison nn_classifier.xml @ 19:a4e183b0b0a4 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 208a8d348e7c7a182cfbe1b6f17868146428a7e2"
| author | bgruening |
|---|---|
| date | Tue, 13 Apr 2021 20:57:54 +0000 |
| parents | 6cbf023ea0b9 |
| children | 11f52f966186 |
comparison
equal
deleted
inserted
replaced
| 18:6bdfb232d489 | 19:a4e183b0b0a4 |
|---|---|
| 1 <tool id="sklearn_nn_classifier" name="Nearest Neighbors Classification" version="@VERSION@"> | 1 <tool id="sklearn_nn_classifier" name="Nearest Neighbors Classification" version="@VERSION@" profile="20.05"> |
| 2 <description></description> | 2 <description></description> |
| 3 <macros> | 3 <macros> |
| 4 <import>main_macros.xml</import> | 4 <import>main_macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="python_requirements"/> | 6 <expand macro="python_requirements" /> |
| 7 <expand macro="macro_stdio"/> | 7 <expand macro="macro_stdio" /> |
| 8 <version_command>echo "@VERSION@"</version_command> | 8 <version_command>echo "@VERSION@"</version_command> |
| 9 <command><![CDATA[ | 9 <command><![CDATA[ |
| 10 python '$nnc_script' '$inputs' | 10 python '$nnc_script' '$inputs' |
| 11 ]]> | 11 ]]> |
| 12 </command> | 12 </command> |
| 13 <configfiles> | 13 <configfiles> |
| 14 <inputs name="inputs"/> | 14 <inputs name="inputs" /> |
| 15 <configfile name="nnc_script"> | 15 <configfile name="nnc_script"> |
| 16 <![CDATA[ | 16 <![CDATA[ |
| 17 import sys | 17 import sys |
| 18 import json | 18 import json |
| 19 import numpy as np | 19 import numpy as np |
| 20 import sklearn.neighbors | 20 import sklearn.neighbors |
| 21 import pandas | 21 import pandas |
| 66 | 66 |
| 67 ]]> | 67 ]]> |
| 68 </configfile> | 68 </configfile> |
| 69 </configfiles> | 69 </configfiles> |
| 70 <inputs> | 70 <inputs> |
| 71 <expand macro="sl_Conditional" model="zip"><!--Todo: add sparse to targets--> | 71 <expand macro="sl_Conditional" model="zip"> <!--Todo: add sparse to targets--> |
| 72 <param name="selected_algorithm" type="select" label="Classifier type"> | 72 <param name="selected_algorithm" type="select" label="Classifier type"> |
| 73 <option value="nneighbors">Nearest Neighbors</option> | 73 <option value="nneighbors">Nearest Neighbors</option> |
| 74 <option value="ncentroid">Nearest Centroid</option> | 74 <option value="ncentroid">Nearest Centroid</option> |
| 75 </param> | 75 </param> |
| 76 <when value="nneighbors"> | 76 <when value="nneighbors"> |
| 77 <expand macro="sl_mixed_input"/> | 77 <expand macro="sl_mixed_input" /> |
| 78 <conditional name="sampling_methods"> | 78 <conditional name="sampling_methods"> |
| 79 <param name="sampling_method" type="select" label="Neighbor selection method"> | 79 <param name="sampling_method" type="select" label="Neighbor selection method"> |
| 80 <option value="KNeighborsClassifier" selected="true">K-nearest neighbors</option> | 80 <option value="KNeighborsClassifier" selected="true">K-nearest neighbors</option> |
| 81 <option value="RadiusNeighborsClassifier">Radius-based</option> | 81 <option value="RadiusNeighborsClassifier">Radius-based</option> |
| 82 </param> | 82 </param> |
| 83 <when value="KNeighborsClassifier"> | 83 <when value="KNeighborsClassifier"> |
| 84 <expand macro="nn_advanced_options"> | 84 <expand macro="nn_advanced_options"> |
| 85 <param argument="n_neighbors" type="integer" optional="true" value="5" label="Number of neighbors" help=" "/> | 85 <param argument="n_neighbors" type="integer" optional="true" value="5" label="Number of neighbors" help=" " /> |
| 86 </expand> | 86 </expand> |
| 87 </when> | 87 </when> |
| 88 <when value="RadiusNeighborsClassifier"> | 88 <when value="RadiusNeighborsClassifier"> |
| 89 <expand macro="nn_advanced_options"> | 89 <expand macro="nn_advanced_options"> |
| 90 <param argument="radius" type="float" optional="true" value="1.0" label="Radius" | 90 <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." /> |
| 91 help="Range of parameter space to use by default for :meth ''radius_neighbors'' queries."/> | |
| 92 </expand> | 91 </expand> |
| 93 </when> | 92 </when> |
| 94 </conditional> | 93 </conditional> |
| 95 </when> | 94 </when> |
| 96 <when value="ncentroid"> | 95 <when value="ncentroid"> |
| 97 <expand macro="sl_mixed_input"/> | 96 <expand macro="sl_mixed_input" /> |
| 98 <section name="options" title="Advanced Options" expanded="False"> | 97 <section name="options" title="Advanced Options" expanded="False"> |
| 99 <param argument="metric" type="text" optional="true" value="euclidean" label="Metric" | 98 <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." /> |
| 100 help="The metric to use when calculating distance between instances in a feature array."/> | 99 <param argument="shrink_threshold" type="float" optional="true" value="" label="Shrink threshold" help="Floating point number for shrinking centroids to remove features." /> |
| 101 <param argument="shrink_threshold" type="float" optional="true" value="" label="Shrink threshold" | |
| 102 help="Floating point number for shrinking centroids to remove features."/> | |
| 103 </section> | 100 </section> |
| 104 </when> | 101 </when> |
| 105 </expand> | 102 </expand> |
| 106 </inputs> | 103 </inputs> |
| 107 | 104 |
| 108 <expand macro="output"/> | 105 <expand macro="output" /> |
| 109 | 106 |
| 110 <tests> | 107 <tests> |
| 111 <test> | 108 <test> |
| 112 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 109 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
| 113 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 110 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
| 114 <param name="header1" value="True"/> | 111 <param name="header1" value="True" /> |
| 115 <param name="header2" value="True"/> | 112 <param name="header2" value="True" /> |
| 116 <param name="col1" value="1,2,3,4"/> | 113 <param name="col1" value="1,2,3,4" /> |
| 117 <param name="col2" value="5"/> | 114 <param name="col2" value="5" /> |
| 118 <param name="selected_task" value="train"/> | 115 <param name="selected_task" value="train" /> |
| 119 <param name="selected_algorithm" value="nneighbors"/> | 116 <param name="selected_algorithm" value="nneighbors" /> |
| 120 <param name="sampling_method" value="KNeighborsClassifier" /> | 117 <param name="sampling_method" value="KNeighborsClassifier" /> |
| 121 <param name="algorithm" value="brute" /> | 118 <param name="algorithm" value="brute" /> |
| 122 <output name="outfile_fit" file="nn_model01" compare="sim_size" delta="5"/> | 119 <output name="outfile_fit" file="nn_model01" compare="sim_size" delta="5" /> |
| 123 </test> | 120 </test> |
| 124 <test> | 121 <test> |
| 125 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 122 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
| 126 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 123 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
| 127 <param name="header1" value="True"/> | 124 <param name="header1" value="True" /> |
| 128 <param name="header2" value="True"/> | 125 <param name="header2" value="True" /> |
| 129 <param name="col1" value="1,2,3,4"/> | 126 <param name="col1" value="1,2,3,4" /> |
| 130 <param name="col2" value="5"/> | 127 <param name="col2" value="5" /> |
| 131 <param name="selected_task" value="train"/> | 128 <param name="selected_task" value="train" /> |
| 132 <param name="selected_algorithm" value="nneighbors"/> | 129 <param name="selected_algorithm" value="nneighbors" /> |
| 133 <param name="sampling_method" value="RadiusNeighborsClassifier" /> | 130 <param name="sampling_method" value="RadiusNeighborsClassifier" /> |
| 134 <output name="outfile_fit" file="nn_model02" compare="sim_size" delta="5"/> | 131 <output name="outfile_fit" file="nn_model02" compare="sim_size" delta="5" /> |
| 135 </test> | 132 </test> |
| 136 <test> | 133 <test> |
| 137 <param name="infile1" value="train_set.tabular" ftype="tabular"/> | 134 <param name="infile1" value="train_set.tabular" ftype="tabular" /> |
| 138 <param name="infile2" value="train_set.tabular" ftype="tabular"/> | 135 <param name="infile2" value="train_set.tabular" ftype="tabular" /> |
| 139 <param name="header1" value="True"/> | 136 <param name="header1" value="True" /> |
| 140 <param name="header2" value="True"/> | 137 <param name="header2" value="True" /> |
| 141 <param name="col1" value="1,2,3,4"/> | 138 <param name="col1" value="1,2,3,4" /> |
| 142 <param name="col2" value="5"/> | 139 <param name="col2" value="5" /> |
| 143 <param name="selected_task" value="train"/> | 140 <param name="selected_task" value="train" /> |
| 144 <param name="selected_algorithm" value="ncentroid"/> | 141 <param name="selected_algorithm" value="ncentroid" /> |
| 145 <output name="outfile_fit" file="nn_model03" compare="sim_size" delta="5"/> | 142 <output name="outfile_fit" file="nn_model03" compare="sim_size" delta="5" /> |
| 146 </test> | 143 </test> |
| 147 <test> | 144 <test> |
| 148 <param name="infile_model" value="nn_model01" ftype="zip"/> | 145 <param name="infile_model" value="nn_model01" ftype="zip" /> |
| 149 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 146 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
| 150 <param name="header" value="True"/> | 147 <param name="header" value="True" /> |
| 151 <param name="selected_task" value="load"/> | 148 <param name="selected_task" value="load" /> |
| 152 <output name="outfile_predict" file="nn_prediction_result01.tabular"/> | 149 <output name="outfile_predict" file="nn_prediction_result01.tabular" /> |
| 153 </test> | 150 </test> |
| 154 <test> | 151 <test> |
| 155 <param name="infile_model" value="nn_model02" ftype="zip"/> | 152 <param name="infile_model" value="nn_model02" ftype="zip" /> |
| 156 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 153 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
| 157 <param name="header" value="True"/> | 154 <param name="header" value="True" /> |
| 158 <param name="selected_task" value="load"/> | 155 <param name="selected_task" value="load" /> |
| 159 <output name="outfile_predict" file="nn_prediction_result02.tabular"/> | 156 <output name="outfile_predict" file="nn_prediction_result02.tabular" /> |
| 160 </test> | 157 </test> |
| 161 <test> | 158 <test> |
| 162 <param name="infile_model" value="nn_model03" ftype="zip"/> | 159 <param name="infile_model" value="nn_model03" ftype="zip" /> |
| 163 <param name="infile_data" value="test_set.tabular" ftype="tabular"/> | 160 <param name="infile_data" value="test_set.tabular" ftype="tabular" /> |
| 164 <param name="header" value="True"/> | 161 <param name="header" value="True" /> |
| 165 <param name="selected_task" value="load"/> | 162 <param name="selected_task" value="load" /> |
| 166 <output name="outfile_predict" file="nn_prediction_result03.tabular"/> | 163 <output name="outfile_predict" file="nn_prediction_result03.tabular" /> |
| 167 </test> | 164 </test> |
| 168 </tests> | 165 </tests> |
| 169 <help><![CDATA[ | 166 <help><![CDATA[ |
| 170 **What it does** | 167 **What it does** |
| 171 This module implements the k-nearest neighbors classification algorithms. | 168 This module implements the k-nearest neighbors classification algorithms. |
| 172 For more information check http://scikit-learn.org/stable/modules/neighbors.html | 169 For more information check http://scikit-learn.org/stable/modules/neighbors.html |
| 173 ]]></help> | 170 ]]> </help> |
| 174 <expand macro="sklearn_citation"/> | 171 <expand macro="sklearn_citation" /> |
| 175 </tool> | 172 </tool> |
