diff pre_process.xml @ 41:a16f33c6ca64 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 9981e25b00de29ed881b2229a173a8c812ded9bb
author bgruening
date Wed, 09 Aug 2023 13:29:02 +0000
parents 0e5fcf7ddc75
children
line wrap: on
line diff
--- a/pre_process.xml	Thu Aug 11 08:57:59 2022 +0000
+++ b/pre_process.xml	Wed Aug 09 13:29:02 2023 +0000
@@ -1,4 +1,4 @@
-<tool id="sklearn_data_preprocess" name="Preprocess" version="@VERSION@" profile="20.05">
+<tool id="sklearn_data_preprocess" name="Preprocess" version="@VERSION@" profile="@PROFILE@">
     <description>raw feature vectors into standardized datasets</description>
     <macros>
         <import>main_macros.xml</import>
@@ -18,11 +18,11 @@
 import sys
 import json
 import pandas
-import pickle
 
 from scipy.io import mmread
 from scipy.io import mmwrite
 from sklearn import preprocessing
+from galaxy_ml.model_persist import dump_model_to_h5
 from galaxy_ml.utils import read_columns, SafeEval
 
 
@@ -81,8 +81,7 @@
 #end if
 
 #if $save:
-with open("$outfile_fit", 'wb') as out_handler:
-    pickle.dump(estimator, out_handler, pickle.HIGHEST_PROTOCOL)
+dump_model_to_h5(estimator, "$outfile_fit")
 #end if
         ]]>
         </configfile>
@@ -116,7 +115,7 @@
     </inputs>
     <outputs>
         <data format="tabular" name="outfile_transform" from_work_dir="./output" />
-        <data format="zip" name="outfile_fit">
+        <data format="h5mlm" name="outfile_fit">
             <filter>save</filter>
         </data>
     </outputs>
@@ -125,10 +124,13 @@
             <param name="infile" value="train.tabular" ftype="tabular" />
             <param name="selected_column_selector_option" value="all_columns" />
             <param name="selected_input_type" value="tabular" />
-            <param name="selected_pre_processor" value="KernelCenterer" />
+            <param name="selected_pre_processor" value="QuantileTransformer" />
             <param name="save" value="true" />
+            <param name="random_state" value="200" />
+            <param name="n_quantiles" value="10" />
+            <param name="subsample" value="100" />
             <output name="outfile_transform" file="prp_result01" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model01" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model01" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="train.tabular" ftype="tabular" />
@@ -137,7 +139,7 @@
             <param name="selected_pre_processor" value="MinMaxScaler" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result02" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model02" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model02" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="train.tabular" ftype="tabular" />
@@ -146,7 +148,7 @@
             <param name="selected_pre_processor" value="PolynomialFeatures" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result03" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model03" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model03" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="train.tabular" ftype="tabular" />
@@ -155,7 +157,7 @@
             <param name="selected_pre_processor" value="RobustScaler" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result04" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model04" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model04" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="csr_sparse2.mtx" ftype="txt" />
@@ -163,7 +165,7 @@
             <param name="selected_pre_processor" value="Binarizer" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result05" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model05" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model05" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="train.tabular" ftype="tabular" />
@@ -172,7 +174,7 @@
             <param name="selected_pre_processor" value="StandardScaler" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result07" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model07" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model07" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="csr_sparse2.mtx" ftype="txt" />
@@ -180,7 +182,7 @@
             <param name="selected_pre_processor" value="MaxAbsScaler" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result08" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model08" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model08" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="csr_sparse2.mtx" ftype="txt" />
@@ -188,7 +190,7 @@
             <param name="selected_pre_processor" value="Normalizer" />
             <param name="save" value="true" />
             <output name="outfile_transform" file="prp_result09" ftype="tabular" />
-            <output name="outfile_fit" file="prp_model09" ftype="zip" compare="sim_size" delta="5" />
+            <output name="outfile_fit" file="prp_model09" ftype="h5mlm" compare="sim_size" delta="5" />
         </test>
         <test>
             <param name="infile" value="regression_X.tabular" ftype="tabular" />