Mercurial > repos > bgruening > sklearn_to_categorical
view to_categorical.xml @ 7:3f088677e4ff draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 80417bf0158a9b596e485dd66408f738f405145a
author | bgruening |
---|---|
date | Mon, 02 Oct 2023 07:56:37 +0000 |
parents | aa77f760a04e |
children |
line wrap: on
line source
<tool id="sklearn_to_categorical" name="To categorical" version="@VERSION@" profile="@PROFILE@"> <description>Converts a class vector (integers) to binary class matrix</description> <macros> <import>main_macros.xml</import> </macros> <expand macro="python_requirements" /> <expand macro="macro_stdio" /> <version_command>echo "@VERSION@"</version_command> <command detect_errors="exit_code"><![CDATA[ python '$__tool_directory__/to_categorical.py' --inputs '$inputs' --infile '$infile' #if $num_classes --num_classes '$num_classes' #end if --outfile '$outfile' ]]> </command> <configfiles> <inputs name="inputs" /> </configfiles> <inputs> <param name="infile" type="data" format="tabular" label="Input file" /> <param name="header0" type="boolean" optional="true" truevalue="booltrue" falsevalue="boolfalse" checked="true" label="Does the dataset contain header?" /> <param name="num_classes" type="integer" optional="true" label="Total number of classes" /> </inputs> <outputs> <data name="outfile" format="tabular" /> </outputs> <tests> <test> <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" /> <param name="header0" value="true" /> <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" /> </test> <test> <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" /> <param name="header0" value="true" /> <param name="num_classes" value="4" /> <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" /> </test> <test> <param name="infile" value="ohe_in_w_header.tabular" ftype="tabular" /> <param name="header0" value="true" /> <param name="num_classes" value="5" /> <output name="outfile" file="ohe_out_5.tabular" ftype="tabular" /> </test> <test> <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" /> <param name="header0" value="false" /> <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" /> </test> <test> <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" /> <param name="header0" value="false" /> <param name="num_classes" value="4" /> <output name="outfile" file="ohe_out_4.tabular" ftype="tabular" /> </test> <test> <param name="infile" value="ohe_in_wo_header.tabular" ftype="tabular" /> <param name="header0" value="false" /> <param name="num_classes" value="5" /> <output name="outfile" file="ohe_out_5.tabular" ftype="tabular" /> </test> </tests> <help><![CDATA[ **What it does** Converts a class vector (integers) to binary class matrix. tf.keras.utils.to_categorical( y, num_classes=None, dtype='float32' ) E.g. for use with categorical_crossentropy. Arguments y: a vector of numbers to be converted into a matrix of one-hot encoded values. num_classes: total number of classes. If None, this would be inferred as the (largest number in y) + 1. dtype: The data type expected by the input. Default: 'float32'. Returns A binary matrix representation of the input. The classes axis is placed last. Raises Value Error: If input contains string value ]]> </help> <expand macro="sklearn_citation" /> </tool>