diff lightgbm.xml @ 3:c3bafda50176 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit e2a5eade6d0e5ddf3a47630381a0ad90d80e8a04"
author bgruening
date Tue, 13 Apr 2021 18:33:38 +0000
parents 13226b2ddfb4
children 364234f65507
line wrap: on
line diff
--- a/lightgbm.xml	Thu Oct 01 21:08:39 2020 +0000
+++ b/lightgbm.xml	Tue Apr 13 18:33:38 2021 +0000
@@ -1,21 +1,21 @@
-<tool id="sklearn_lightgbm" name="LightGBM" version="@VERSION@">
+<tool id="sklearn_lightgbm" name="LightGBM" version="@VERSION@" profile="20.05">
     <description>- train and apply LightGBM models</description>
     <macros>
         <import>main_macros.xml</import>
     </macros>
     <expand macro="python_requirements">
-          <requirement type="package" version="2.3.0">lightgbm</requirement>
+        <requirement type="package" version="2.3.0">lightgbm</requirement>
     </expand>
-    <expand macro="macro_stdio"/>
+    <expand macro="macro_stdio" />
     <version_command>echo "@VERSION@"</version_command>
     <command><![CDATA[
     python '$lightgbm_script' '$inputs'
 ]]>
     </command>
     <configfiles>
-        <inputs name="inputs"/>
+        <inputs name="inputs" />
         <configfile name="lightgbm_script">
-<![CDATA[
+            <![CDATA[
 import json
 import lightgbm as lgb
 import pandas
@@ -77,32 +77,32 @@
                 <option value="LightGBMClassifier">Classification</option>
                 <option value="LightGBMRegressor">Regression</option>
             </param>
-            <when value="LightGBMClassifier" >
-                <expand macro="sl_mixed_input"/>
+            <when value="LightGBMClassifier">
+                <expand macro="sl_mixed_input" />
                 <section name="options" title="Advanced Options" expanded="False">
                     <param argument="objective" type="select" label="Loss function">
                         <option value="binary">Binary log loss classification</option>
                         <option value="multiclass">Multiclass - softmax objective function</option>
                         <option value="multiclassova">Multiclass - one-vs-all binary objective function</option>
                     </param>
-                    <param name="num_class" label="Number of classes" type="integer" value="1"/>
-                    <expand macro="n_estimators" default_value="100" help="The number of boosting stages to perform"/>
-                    <expand macro="max_depth" default_value="3" help="maximum depth of the individual regression estimators"/>
-                    <expand macro="learning_rate" default_value='0.1'/>
-                    <expand macro="max_leaf_nodes"/>
-                    <expand macro="subsample"/>
-                    <expand macro="verbose"/>
-                    <expand macro="feature_fraction"/>
-                    <expand macro="lambda_l1"/>
-                    <expand macro="lambda_l2"/>
-                    <expand macro="min_gain_to_split"/>
-                    <expand macro="min_child_weight"/>
-                    <expand macro="random_state"/>
+                    <param name="num_class" label="Number of classes" type="integer" value="1" />
+                    <expand macro="n_estimators" default_value="100" help="The number of boosting stages to perform" />
+                    <expand macro="max_depth" default_value="3" help="maximum depth of the individual regression estimators" />
+                    <expand macro="learning_rate" default_value='0.1' />
+                    <expand macro="max_leaf_nodes" />
+                    <expand macro="subsample" />
+                    <expand macro="verbose" />
+                    <expand macro="feature_fraction" />
+                    <expand macro="lambda_l1" />
+                    <expand macro="lambda_l2" />
+                    <expand macro="min_gain_to_split" />
+                    <expand macro="min_child_weight" />
+                    <expand macro="random_state" />
                 </section>
             </when>
 
             <when value="LightGBMRegressor">
-                <expand macro="sl_mixed_input"/>
+                <expand macro="sl_mixed_input" />
                 <section name="options" title="Advanced Options" expanded="False">
                     <param argument="objective" type="select" label="Loss function">
                         <option value="l1">Absolute loss</option>
@@ -111,85 +111,87 @@
                         <option value="huber">Huber loss - combination of least squares regression and least absolute deviation</option>
                         <option value="quantile">Quantile - use alpha to specify the quantile</option>
                     </param>
-                    <expand macro="n_estimators" default_value="100" help="The number of boosting stages to perform"/>
-                    <expand macro="max_depth" default_value="3" help="maximum depth of the individual regression estimators"/>
-                    <expand macro="learning_rate" default_value='0.1'/>
-                    <expand macro="max_leaf_nodes"/>
-                    <expand macro="subsample"/>
-                    <expand macro="verbose"/>
-                    <expand macro="feature_fraction"/>
-                    <expand macro="lambda_l1"/>
-                    <expand macro="lambda_l2"/>
-                    <expand macro="min_gain_to_split"/>
-                    <expand macro="min_child_weight"/>
-                    <expand macro="random_state"/>
+                    <expand macro="n_estimators" default_value="100" help="The number of boosting stages to perform" />
+                    <expand macro="max_depth" default_value="3" help="maximum depth of the individual regression estimators" />
+                    <expand macro="learning_rate" default_value='0.1' />
+                    <expand macro="max_leaf_nodes" />
+                    <expand macro="subsample" />
+                    <expand macro="verbose" />
+                    <expand macro="feature_fraction" />
+                    <expand macro="lambda_l1" />
+                    <expand macro="lambda_l2" />
+                    <expand macro="min_gain_to_split" />
+                    <expand macro="min_child_weight" />
+                    <expand macro="random_state" />
                 </section>
             </when>
         </expand>
     </inputs>
 
     <outputs>
-      <data format="tabular" name="outfile_predict">
-          <filter>selected_tasks['selected_task'] == 'load'</filter>
-      </data>
-      <data format="txt" name="outfile_fit" label="${tool.name}.${selected_tasks.selected_algorithms.selected_algorithm}">
-          <filter>selected_tasks['selected_task'] == 'train'</filter>
-      </data>
+        <data format="tabular" name="outfile_predict">
+            <filter>selected_tasks['selected_task'] == 'load'</filter>
+        </data>
+        <data format="txt" name="outfile_fit" label="${tool.name}.${selected_tasks.selected_algorithms.selected_algorithm}">
+            <filter>selected_tasks['selected_task'] == 'train'</filter>
+        </data>
     </outputs>
 
     <tests>
         <test>
-            <param name="infile1" value="regression_X.tabular" ftype="tabular"/>
-            <param name="infile2" value="regression_y.tabular" ftype="tabular"/>
-            <param name="header1" value="True"/>
-            <param name="selected_column_selector_option" value="all_columns"/>
-            <param name="header2" value="True"/>
-            <param name="col2" value="1"/>
-            <param name="selected_task" value="train"/>
-            <param name="selected_algorithm" value="LightGBMRegressor"/>
-            <param name="objective" value="l2"/>
-            <param name="n_estimators" value="10000"/>
-            <param name="learning_rate" value="0.02"/>
-            <param name="max_leaf_nodes" value="32"/>
-            <param name="feature_fraction" value="0.9"/>
-            <param name="subsample" value="0.9"/>
-            <param name="max_depth" value="8"/>
-            <param name="lambda_l1" value="0.04"/>
-            <param name="lambda_l2" value="0.07"/>
-            <param name="min_gain_to_split" value="0.02"/>
-            <param name="min_child_weight" value="39.0"/>
-            <param name="verbose" value="-1"/>
-            <param name="random_state" value="1"/>
-            <output name="outfile_fit" file="lgb_regr_model.txt" compare="sim_size" delta="5"/>
+            <param name="infile1" value="regression_X.tabular" ftype="tabular" />
+            <param name="infile2" value="regression_y.tabular" ftype="tabular" />
+            <param name="header1" value="True" />
+            <param name="selected_column_selector_option" value="all_columns" />
+            <param name="header2" value="True" />
+            <param name="col2" value="1" />
+            <param name="selected_task" value="train" />
+            <param name="selected_algorithm" value="LightGBMRegressor" />
+            <param name="objective" value="l2" />
+            <param name="n_estimators" value="10000" />
+            <param name="learning_rate" value="0.02" />
+            <param name="max_leaf_nodes" value="32" />
+            <param name="feature_fraction" value="0.9" />
+            <param name="subsample" value="0.9" />
+            <param name="max_depth" value="8" />
+            <param name="lambda_l1" value="0.04" />
+            <param name="lambda_l2" value="0.07" />
+            <param name="min_gain_to_split" value="0.02" />
+            <param name="min_child_weight" value="39.0" />
+            <param name="verbose" value="-1" />
+            <param name="random_state" value="1" />
+            <output name="outfile_fit" file="lgb_regr_model.txt" compare="sim_size" delta="5" />
         </test>
+        <!-- See 'Fix get_scoring method #1103'
         <test>
-            <param name="infile_model" value="lgb_regr_model.txt" ftype="txt"/>
-            <param name="infile_data" value="regression_X.tabular" ftype="tabular"/>
-            <param name="selected_task" value="load"/>
-            <param name="header" value="True"/>
-            <output name="outfile_predict" file="lgb_prediction_result01.tabular"/>
+            <param name="infile_model" value="lgb_regr_model.txt" ftype="txt" />
+            <param name="infile_data" value="regression_X.tabular" ftype="tabular" />
+            <param name="selected_task" value="load" />
+            <param name="header" value="True" />
+            <output name="outfile_predict" file="lgb_prediction_result01.tabular" />
         </test>
+        -->
         <test>
-            <param name="infile1" value="train.tabular" ftype="tabular"/>
-            <param name="infile2" value="train.tabular" ftype="tabular"/>
-            <param name="col1" value="1,2,3,4"/>
-            <param name="col2" value="5"/>
-            <param name="selected_task" value="train"/>
-            <param name="selected_algorithm" value="LightGBMClassifier"/>
-            <param name="objective" value="binary"/>
-            <param name="n_estimators" value="10000"/>
-            <param name="learning_rate" value="0.02"/>
-            <param name="max_leaf_nodes" value="32"/>
-            <param name="feature_fraction" value="0.9"/>
-            <param name="subsample" value="0.9"/>
-            <param name="max_depth" value="8"/>
-            <param name="lambda_l1" value="0.04"/>
-            <param name="lambda_l2" value="0.07"/>
-            <param name="min_gain_to_split" value="0.02"/>
-            <param name="min_child_weight" value="39.0"/>
-            <param name="verbose" value="-1"/>
-            <param name="random_state" value="1"/>
-            <output name="outfile_fit" file="lgb_class_model.txt" compare="sim_size" delta="5"/>
+            <param name="infile1" value="train.tabular" ftype="tabular" />
+            <param name="infile2" value="train.tabular" ftype="tabular" />
+            <param name="col1" value="1,2,3,4" />
+            <param name="col2" value="5" />
+            <param name="selected_task" value="train" />
+            <param name="selected_algorithm" value="LightGBMClassifier" />
+            <param name="objective" value="binary" />
+            <param name="n_estimators" value="10000" />
+            <param name="learning_rate" value="0.02" />
+            <param name="max_leaf_nodes" value="32" />
+            <param name="feature_fraction" value="0.9" />
+            <param name="subsample" value="0.9" />
+            <param name="max_depth" value="8" />
+            <param name="lambda_l1" value="0.04" />
+            <param name="lambda_l2" value="0.07" />
+            <param name="min_gain_to_split" value="0.02" />
+            <param name="min_child_weight" value="39.0" />
+            <param name="verbose" value="-1" />
+            <param name="random_state" value="1" />
+            <output name="outfile_fit" file="lgb_class_model.txt" compare="sim_size" delta="5" />
         </test>
 
     </tests>
@@ -265,7 +267,7 @@
  
  The tool predicts the class labels for new samples and adds them as the last column to the prediction dataset. The new dataset (i.e. tabular input plus an additional column containing predicted values) is then returned as a tabular file. The prediction output format should look like the training dataset.
 
-    ]]></help>
+    ]]>    </help>
     <expand macro="sklearn_citation">
         <citation type="bibtex">
 @incollection{NIPS2017_6907,