view label_encoder.xml @ 10:6c1c7a89d333 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author bgruening
date Sun, 05 Nov 2023 15:01:29 +0000
parents 108141350edb
children
line wrap: on
line source

<tool id="sklearn_label_encoder" name="Label encoder" version="@VERSION@" profile="@PROFILE@">
    <description>Encode target labels with value between 0 and n_classes-1</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__/label_encoder.py'
            --inputs '$inputs'
            --infile '$infile'
            --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?"/>
    </inputs>
    <outputs>
        <data name="outfile" format="tabular"/>
    </outputs>
    <tests>
        <test>
            <param name="infile" value="le_input_w_header.tabular" ftype="tabular"/>
            <param name="header0" value="true"/>
            <output name="outfile" file="le_output.tabular" ftype="tabular"/>
        </test>
        <test>
            <param name="infile" value="le_input_wo_header.tabular" ftype="tabular"/>
            <param name="header0" value="false"/>
            <output name="outfile" file="le_output.tabular" ftype="tabular"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

class sklearn.preprocessing.LabelEncoder

Encode target labels with value between 0 and n_classes-1.

This transformer should be used to encode target values, i.e. y, and not the input X.

Attributes: classes : ndarray of shape (n_classes,)
Hold the label for each class.
LabelEncoder can be used to normalize labels.

It can also be used to transform non-numerical labels (as long as they are hashable and comparable) to numerical labels.

Methods

fit_transform(y)

Fit label encoder and return encoded labels.

Parameters: y: array-like of shape (n_samples,)

Returns: y: array-like of shape (n_samples,)

    ]]></help>
    <expand macro="sklearn_citation"/>
</tool>