changeset 6:7509d7059040 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c64ccc5850c8e061a95fb64e07ed388384e82393
author bgruening
date Thu, 11 Oct 2018 03:30:01 -0400
parents 0987bc3904a0
children 4368259ff821
files search_model_validation.xml test-data/abc_model01 test-data/abc_result01 test-data/abr_model01 test-data/abr_result01 test-data/glm_model08 test-data/glm_result08
diffstat 7 files changed, 86 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/search_model_validation.xml	Sat Sep 29 07:26:39 2018 -0400
+++ b/search_model_validation.xml	Thu Oct 11 03:30:01 2018 -0400
@@ -85,6 +85,7 @@
 options = params["search_schemes"]["options"]
 options['cv'] = get_cv( options['cv'].strip() )
 options['n_jobs'] = N_JOBS
+primary_scoring = options['scoring']['primary_scoring']
 options['scoring'] = get_scoring(options['scoring'])
 if options['error_score']:
     options['error_score'] = 'raise'
@@ -114,6 +115,7 @@
             print(repr(warning.message))
 
 cv_result = pandas.DataFrame(searcher.cv_results_)
+cv_result.rename(inplace=True, columns={"mean_test_primary": "mean_test_"+primary_scoring, "rank_test_primary": "rank_test_"+primary_scoring})
 cv_result.to_csv(path_or_buf=outfile_result, sep='\t', header=True, index=False)
 
 #if $save:
@@ -453,6 +455,75 @@
                 </assert_contents>
             </output>
         </test>
+        <test>
+            <param name="selected_search_scheme" value="GridSearchCV"/>
+            <param name="infile_pipeline" value="pipeline02" ftype="zip"/>
+            <conditional name="search_param_selector">
+                <param name="search_p" value="eps: [0.01, 0.001]"/>
+                <param name="selected_param_type" value="final_estimator_p"/>
+            </conditional>
+            <param name="infile1" value="regression_X.tabular" ftype="tabular"/>
+            <param name="header1" value="true" />
+            <param name="selected_column_selector_option" value="all_columns"/>
+            <param name="infile2" value="regression_y.tabular" ftype="tabular"/>
+            <param name="header2" value="true" />
+            <param name="selected_column_selector_option2" value="all_columns"/>
+            <output name="outfile_result">
+                <assert_contents>
+                    <has_n_columns n="12"/>
+                    <has_text text="0.7762968161366681" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="selected_search_scheme" value="GridSearchCV"/>
+            <param name="infile_pipeline" value="pipeline05" ftype="zip"/>
+            <conditional name="search_param_selector">
+                <param name="search_p" value="n_estimators: [10, 50, 100, 300]"/>
+                <param name="selected_param_type" value="final_estimator_p"/>
+            </conditional>
+            <param name="infile1" value="regression_X.tabular" ftype="tabular"/>
+            <param name="header1" value="true" />
+            <param name="selected_column_selector_option" value="all_columns"/>
+            <param name="infile2" value="regression_y.tabular" ftype="tabular"/>
+            <param name="header2" value="true" />
+            <param name="selected_column_selector_option2" value="all_columns"/>
+            <output name="outfile_result">
+                <assert_contents>
+                    <has_n_columns n="12"/>
+                    <has_text text="0.8176497587057971" />
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_failure="true">
+            <param name="selected_search_scheme" value="GridSearchCV"/>
+            <param name="infile_pipeline" value="pipeline01" ftype="zip"/>
+            <conditional name="search_param_selector">
+                <param name="search_p" value="C: open('~/.ssh/authorized_keys', 'r').read()"/>
+                <param name="selected_param_type" value="final_estimator_p"/>
+            </conditional>
+            <param name="infile1" value="regression_X.tabular" ftype="tabular"/>
+            <param name="header1" value="true" />
+            <param name="selected_column_selector_option" value="all_columns"/>
+            <param name="infile2" value="regression_y.tabular" ftype="tabular"/>
+            <param name="header2" value="true" />
+            <param name="selected_column_selector_option2" value="all_columns"/>
+        </test>
+        <test expect_failure="true">
+            <param name="selected_search_scheme" value="GridSearchCV"/>
+            <param name="infile_pipeline" value="pipeline01" ftype="zip"/>
+            <conditional name="search_param_selector">
+                <param name="search_p" value="C: [1, 10, 100, 1000]"/>
+                <param name="selected_param_type" value="final_estimator_p"/>
+            </conditional>
+            <param name="cv" value="__import__('os').system('ls ~')"/>
+            <param name="infile1" value="regression_X.tabular" ftype="tabular"/>
+            <param name="header1" value="true" />
+            <param name="selected_column_selector_option" value="all_columns"/>
+            <param name="infile2" value="regression_y.tabular" ftype="tabular"/>
+            <param name="header2" value="true" />
+            <param name="selected_column_selector_option2" value="all_columns"/>
+        </test>
     </tests>
     <help>
         <![CDATA[
Binary file test-data/abc_model01 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/abc_result01	Thu Oct 11 03:30:01 2018 -0400
@@ -0,0 +1,6 @@
+0	1	2	3	predicted
+3.68258022948	2.82110345641	-3.9901407239999998	-1.9523364774	1
+0.015942057224	-0.7119585943469999	0.125502976978	-0.972218263337	0
+2.0869076882499997	0.929399321468	-2.1292408448400004	-1.9971402218799998	1
+1.4132105208399999	0.523750660422	-1.4210539291	-1.49298569451	1
+0.7683140439399999	1.38267855169	-0.989045048734	0.649504257894	1
Binary file test-data/abr_model01 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/abr_result01	Thu Oct 11 03:30:01 2018 -0400
@@ -0,0 +1,6 @@
+0	1	2	3	4	predicted
+86.97021227350001	1.00532111569	-1.01739601979	-0.613139481654	0.641846874331	0.323842059244
+91.2021798817	-0.6215229712070001	1.11914889596	0.390012184498	1.28956938152	1.1503117056799999
+-47.4101632272	-0.638416457964	-0.7327774684530001	-0.8640261049779999	-1.06109770116	-0.7191695359690001
+61.712804630200004	-1.0999480057700002	-0.739679672932	0.585657963012	1.4890682753600002	1.1503117056799999
+-206.998295124	0.130238853011	0.70574123041	1.3320656526399999	-1.3322092373799999	-0.7191695359690001
Binary file test-data/glm_model08 has changed
--- a/test-data/glm_result08	Sat Sep 29 07:26:39 2018 -0400
+++ b/test-data/glm_result08	Thu Oct 11 03:30:01 2018 -0400
@@ -1,5 +1,5 @@
-3.68258022948	2.82110345641	-3.9901407239999998	-1.9523364774	1
+3.68258022948	2.82110345641	-3.9901407239999998	-1.9523364774	0
 0.015942057224	-0.7119585943469999	0.125502976978	-0.972218263337	0
-2.0869076882499997	0.929399321468	-2.1292408448400004	-1.9971402218799998	1
-1.4132105208399999	0.523750660422	-1.4210539291	-1.49298569451	1
+2.0869076882499997	0.929399321468	-2.1292408448400004	-1.9971402218799998	0
+1.4132105208399999	0.523750660422	-1.4210539291	-1.49298569451	0
 0.7683140439399999	1.38267855169	-0.989045048734	0.649504257894	1