comparison ludwig_evaluate.xml @ 0:70a4d910f09a draft default tip

planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
author goeckslab
date Tue, 07 Jan 2025 22:46:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:70a4d910f09a
1 <tool id="ludwig_evaluate" name="Ludwig Evaluate" version="@VERSION@" profile="@PROFILE@">
2 <description>loads a pretrained model and evaluates its performance by comparing its predictions with ground truth</description>
3 <macros>
4 <import>ludwig_macros.xml</import>
5 </macros>
6 <expand macro="python_requirements_gpu" />
7 <expand macro="macro_stdio" />
8 <version_command>echo "@VERSION@"</version_command>
9 <command>
10 <![CDATA[
11 #import re
12 mkdir -p outputs &&
13 #if $dataset
14 #set $sanitized_dataset = re.sub('[^\w\-_\.]', '_', $dataset.element_identifier.strip())
15 ln -sf '$dataset' "./${sanitized_dataset}";
16 #end if
17 #if $raw_data
18 unzip -o -q '$raw_data' -d ./;
19 #end if
20 python '$__tool_directory__/ludwig_evaluate.py'
21 #if $model_path
22 --model_path '$model_path.extra_files_path'
23 #end if
24 #if $dataset
25 --dataset "./${sanitized_dataset}"
26 #end if
27 #if $disable_parallel_threads
28 --disable_parallel_threads
29 #end if
30
31 --output_directory "./outputs"
32 --data_format '$data_format'
33 --split '$split'
34 --backend local
35 --skip_save_unprocessed_output &&
36
37 mkdir -p '$output_report.extra_files_path' &&
38 cp outputs/*.json outputs/*.parquet '$output_report.extra_files_path' &&
39
40 echo "Evaluation is Done!"
41 ]]>
42 </command>
43 <configfiles>
44 <inputs name="inputs" />
45 </configfiles>
46 <inputs>
47 <param name="model_path" type="data" format="ludwig_model" label="Load the pretrained model" />
48 <param name="dataset" type="data" format="tabular,csv,h5,json,txt" label="Input dataset" />
49 <param name="data_format" type="select" label="Data format">
50 <option value="auto" selected="true">auto</option>
51 <option value="tsv">tsv</option>
52 <option value="csv">csv</option>
53 <option value="h5">h5</option>
54 <option value="json">json</option>
55 </param>
56 <param name="split" type="select" label="Select the split portion to test the model on">
57 <option value="training">training</option>
58 <option value="validation">validation</option>
59 <option value="test">test</option>
60 <option value="full" selected="true">full</option>
61 </param>
62 <param name="batch_size" type="integer" value="128" optional="true" label="Batch size" min="1" max="4096"/>
63 <param name="disable_parallel_threads" type="boolean" checked="false" label="Whether to disable parallel threads for reproducibility?" />
64 <param name="raw_data" type="data" format="zip" optional="true" label="Raw data" help="Optional. Needed for images."/>
65 </inputs>
66 <outputs>
67 <collection type="list" name="output_pred_csv" label="${tool.name} predictions CSV/json on ${on_string}" >
68 <discover_datasets pattern="(?P&lt;designation&gt;predictions_parquet\.csv)" format="csv" directory="outputs" />
69 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.json" format="json" directory="outputs" />
70 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" format="png" directory="outputs" />
71 </collection>
72 <data format="html" name="output_report" from_work_dir="outputs/ludwig_evaluate_report.html" label="${tool.name} report on ${on_string}" />
73 </outputs>
74 <tests>
75 <test expect_num_outputs="2">
76 <param name="model_path" value="" ftype="ludwig_model">
77 <composite_data value="temp_model01/model_hyperparameters.json" />
78 <composite_data value="temp_model01/model_weights" />
79 <composite_data value="temp_model01/training_set_metadata.json" />
80 <composite_data value="temp_model01/training_progress.json" />
81 </param>
82 <param name="dataset" value="temperature_la.csv" ftype="csv" />
83 <param name="split" value="test" />
84 <output name="output_report" ftype="html">
85 <assert_contents>
86 <has_text text="Evaluate" />
87 </assert_contents>
88 </output>
89
90 <output_collection name="output_pred_csv">
91 <element name="predictions_parquet.csv">
92 <assert_contents>
93 <has_n_columns n="1" />
94 </assert_contents>
95 </element>
96 </output_collection>
97 </test>
98 </tests>
99 <help>
100 <![CDATA[
101 **What it does**
102 This tool conducts `ludwig evaluate`.
103
104
105 **Input**
106 - a trained ludwig model.
107 - dataset to be evaluate.
108
109
110 **Output**
111 - report in html.
112 - a collection of prediction results.
113
114
115 ]]>
116 </help>
117 <expand macro="macro_citations" />
118 </tool>