comparison to_categorical.xml @ 0:59e8b4328c82 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 208a8d348e7c7a182cfbe1b6f17868146428a7e2"
author bgruening
date Tue, 13 Apr 2021 22:40:10 +0000
parents
children ec69cbe34b73
comparison
equal deleted inserted replaced
-1:000000000000 0:59e8b4328c82
1 <tool id="sklearn_to_categorical" name="To categorical" version="@VERSION@" profile="20.05">
2 <description>Converts a class vector (integers) to binary class matrix</description>
3 <macros>
4 <import>main_macros.xml</import>
5 </macros>
6 <expand macro="python_requirements" />
7 <expand macro="macro_stdio" />
8 <version_command>echo "@VERSION@"</version_command>
9 <command detect_errors="exit_code"><![CDATA[
10 python '$__tool_directory__/to_categorical.py'
11 --inputs '$inputs'
12 --infile '$infile'
13 #if $num_classes
14 --num_classes '$num_classes'
15 #end if
16 --outfile '$outfile'
17 ]]>
18 </command>
19 <configfiles>
20 <inputs name="inputs" />
21 </configfiles>
22 <inputs>
23 <param name="infile" type="data" format="tabular" label="Input file" />
24 <param name="header0" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="Does the dataset contain header?" />
25 <param name="num_classes" type="integer" optional="true" label="Total number of classes" />
26 </inputs>
27 <outputs>
28 <data name="outfile" format="tabular" />
29 </outputs>
30 <tests>
31 <test>
32 <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" />
33 <param name="header0" value="true" />
34 <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" />
35 </test>
36 <test>
37 <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" />
38 <param name="header0" value="true" />
39 <param name="num_classes" value="4" />
40 <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" />
41 </test>
42 <test>
43 <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" />
44 <param name="header0" value="true" />
45 <param name="num_classes" value="5" />
46 <output name="outfile" file="ohe_out_5.tabular" ftype="tabular" />
47 </test>
48 <test>
49 <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" />
50 <param name="header0" value="false" />
51 <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" />
52 </test>
53 <test>
54 <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" />
55 <param name="header0" value="false" />
56 <param name="num_classes" value="4" />
57 <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" />
58 </test>
59 <test>
60 <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" />
61 <param name="header0" value="false" />
62 <param name="num_classes" value="5" />
63 <output name="outfile" file="ohe_out_5.tabular" ftype="tabular" />
64 </test>
65 </tests>
66 <help><![CDATA[
67 **What it does**
68
69 Converts a class vector (integers) to binary class matrix.
70
71 tf.keras.utils.to_categorical(
72 y, num_classes=None, dtype='float32'
73 )
74
75 E.g. for use with categorical_crossentropy.
76
77 Arguments
78
79 y: a vector of numbers to be converted into a matrix of one-hot encoded values.
80 num_classes: total number of classes. If None, this would be inferred as the (largest number in y) + 1.
81 dtype: The data type expected by the input. Default: 'float32'.
82
83 Returns
84
85 A binary matrix representation of the input. The classes axis is placed last.
86
87 Raises
88
89 Value Error: If input contains string value
90
91 ]]> </help>
92 <expand macro="sklearn_citation" />
93 </tool>