view plotly_ml_performance_plots.xml @ 3:1c5dcef5ce0f draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/plotly_ml_performance_plots commit 271a4454eea5902e29da4b8dfa7b9124fefac6bc
author bgruening
date Tue, 07 May 2024 14:11:16 +0000
parents 62e3a4e8c54c
children f234e2e59d76
line wrap: on
line source

<tool id="plotly_ml_performance_plots" name="Plot confusion matrix, precision, recall and ROC and AUC curves" version="0.3" profile="22.05">
    <description>of tabular data</description>
    <requirements>
	<requirement type="package" version="0.10.0">galaxy-ml</requirement>
    </requirements>
    <version_command>echo $version</version_command>
    <command detect_errors="aggressive"><![CDATA[
    python '$__tool_directory__/plot_ml_performance.py'
        -i '$infile_input'
        -j '$infile_output'
        -k '$infile_trained_model'
]]>
    </command>
    <inputs>
        <param name="infile_input" type="data" format="tabular" label="Select input data file :" help="Input data is a matrix (tabular) where each column is a feature and the last column contains the (true or original) class labels."/>
        <param name="infile_output" type="data" format="tabular" label="Select predicted data file :" help="Predicted data is a matrix (tabular) where each column is a feature and the last column contains the predicted class labels."/>
        <param name="infile_trained_model" type="data" format="h5mlm" label="Select trained model :" help="This file is a final model trained on training data."/>
    </inputs>

    <outputs>
        <data name="output_confusion" format="html" from_work_dir="output_confusion.html" label="Confusion matrix of tabular data on ${on_string}"/>
        <data name="output_prf" format="html" from_work_dir="output_prf.html" label="Precision, recall and f-score of tabular data on ${on_string}"/>
        <data name="output_roc" format="html" from_work_dir="output_roc.html" label="ROC and AUC curves of tabular data on ${on_string}"/>
    </outputs>
    
    <tests>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="binary_prediction_sgd.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_sgd.h5mlm" ftype="h5mlm"/>
	    <output name="output_confusion">
                <assert_contents>
		    <has_size value="3486809" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
            </output>
	    <output name="output_prf">
		<assert_contents>
		    <has_size value="3486974" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_linearsvm.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_linearsvm.h5mlm" ftype="h5mlm"/>
	    <output name="output_confusion">
	        <assert_contents>
		    <has_size value="3486810" delta="10000" />
		    <has_text text="html" />
                </assert_contents>
	    </output>
            <output name="output_prf">
		<assert_contents>
		    <has_size value="3486973" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3497518" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_rfc.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_rfc.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="3486806" delta="10000" />
		    <has_text text="html" />
                </assert_contents>
	    </output>
            <output name="output_prf">
	        <assert_contents>
		    <has_size value="3486883" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3488335" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="binary_test_label_knn.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_binary_knn.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_binary_knn.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="3486856" delta="10000" />
		    <has_text text="html" />
                </assert_contents>
	    </output>
            <output name="output_prf">
	        <assert_contents>
		    <has_size value="3486928" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
		<assert_contents>
                    <has_size value="3487215" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
        </test>
        <test>
            <param name="infile_input" value="multi_test_label.tabular" ftype="tabular"/>
            <param name="infile_output" value="prediction_multi_lr.tabular" ftype="tabular"/>
            <param name="infile_trained_model" value="model_multi_lr.h5mlm" ftype="h5mlm"/>
            <output name="output_confusion">
	        <assert_contents>
		    <has_size value="3486832" delta="10000" />
		    <has_text text="html" />
                </assert_contents>
	    </output>
            <output name="output_prf">
		<assert_contents>
		    <has_size value="3487035" delta="10000" />
		    <has_text text="html" />
	        </assert_contents>
	    </output>
	    <output name="output_roc">
	        <assert_contents>
                    <has_size value="3493184" delta="10000" />
		    <has_text text="html" />
		</assert_contents>
	    </output>
	</test>
    </tests>
    <help><![CDATA[
**What it does**


Produce a `heatmap plot (confusion matrix) <https://plot.ly/python/heatmaps/>`_ from tabular files. The input data contains the original/true class labels (last column) and the predicted data contains the predicted class labels (last column). The true and predicted class labels are plotted against each other. The diagonal of this heatmap shows the correctly predicted data. The plot is buried in a html file which
provides rich interactive features. Image can be saved in various format, such as 'png', 'svg', 'jpeg' and so on.


    ]]>
    </help>
    <citations>
        <citation type="doi">10.1371/journal.pcbi.1009014</citation>
    </citations>
</tool>