changeset 1:10d11b35b2fd draft

planemo upload for repository https://github.com/bgruening/galaxytools/tools/sklearn commit a9f28163f0d2e808e49c43a6df5a040706e79991
author bgruening
date Thu, 23 Jun 2016 15:26:15 -0400
parents 12b2bef577d0
children 43075be4044b
files main_macros.xml test-data/accuracy_score.txt test-data/auc.txt test-data/average_precision_score.txt test-data/brier_score_loss.txt test-data/classification_report.txt test-data/confusion_matrix.txt test-data/f1_score.txt test-data/fbeta_score.txt test-data/hamming_loss.txt test-data/hinge_loss.txt test-data/jaccard_similarity_score.txt test-data/log_loss.txt test-data/matthews_corrcoef.txt test-data/precision_recall_curve.txt test-data/precision_recall_fscore_support.txt test-data/precision_score.txt test-data/recall_score.txt test-data/roc_auc_score.txt test-data/roc_curve.txt test-data/y.tabular test-data/zero_one_loss.txt
diffstat 22 files changed, 137 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main_macros.xml	Fri Jun 03 13:56:11 2016 -0400
+++ b/main_macros.xml	Thu Jun 23 15:26:15 2016 -0400
@@ -1,6 +1,16 @@
 <macros>
   <token name="@VERSION@">0.9</token>
 
+  <token name="@COLUMNS_FUNCTION@">
+def columns(f,c):
+  data = pandas.read_csv(f, sep='\t', header=None, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False)
+  cols = c.split (',')
+  cols = map(int, cols)
+  cols = list(map(lambda x: x - 1, cols))
+  y = data.iloc[:,cols].values
+  return y
+  </token>
+
   <xml name="python_requirements">
     <requirements>
         <requirement type="package" version="0.2.1b">eden</requirement>
@@ -219,12 +229,12 @@
   </xml>
 
   <xml name="average">
-    <param argument="average" type="select" optional="True" label="Averaging type" help=" ">
-      <option value="binary" selected="true" help="Only report results for the class specified by pos_label. Applicable only on binary classification.">binary</option>
+    <param argument="average" type="select" optional="true" label="Averaging type" help=" ">
       <option value="micro" help="Calculate metrics globally by counting the total true positives, false negatives and false positives.">micro</option>
       <option value="samples" help="Calculate metrics for each instance, and find their average (only meaningful for multilabel).">samples</option>
       <!--option value="macro" help=""></option-->
       <!--option value="weighted" help=""></option-->
+      <yield/>
     </param>
   </xml>
 
@@ -248,6 +258,43 @@
     <yield/>
   </xml>
 
+
+  <xml name="clf_inputs_extended" token_label1=" " token_label2=" " token_multiple="False">
+    <conditional name="true_columns">
+      <param name="selected_input1" type="select" label="Select the input type of true labels dataset:">
+          <option value="tabular" selected="true">Tabular</option>
+          <option value="sparse">Sparse</option>
+      </param>
+      <when value="tabular">
+        <param name="infile1" type="data" label="@LABEL1@"/>
+        <param name="col1" type="data_column" data_ref="infile1" label="Select the target column:"/>
+      </when>
+      <when value="sparse">
+          <param name="infile1" type="data" format="txt" label="@LABEL1@"/>
+      </when>
+    </conditional>
+    <conditional name="predicted_columns">
+      <param name="selected_input2" type="select" label="Select the input type of predicted labels dataset:">
+          <option value="tabular" selected="true">Tabular</option>
+          <option value="sparse">Sparse</option>
+      </param>
+      <when value="tabular">
+        <param name="infile2" type="data" label="@LABEL2@"/>
+        <param name="col2" multiple="@MULTIPLE@" type="data_column" data_ref="infile2" label="Select target column(s):"/>
+      </when>
+      <when value="sparse">
+          <param name="infile2" type="data" format="txt" label="@LABEL1@"/>
+      </when>
+    </conditional>
+  </xml>
+
+  <xml name="clf_inputs" token_label1="Dataset containing true labels (tabular):" token_label2="Dataset containing predicted values (tabular):" token_multiple1="False" token_multiple="False">
+    <param name="infile1" type="data" format="tabular" label="@LABEL1@"/>
+    <param name="col1" multiple="@MULTIPLE1@" type="data_column" data_ref="infile1" label="Select the target column:"/>
+    <param name="infile2" type="data" format="tabular" label="@LABEL2@"/>
+    <param name="col2" multiple="@MULTIPLE@" type="data_column" data_ref="infile2" label="Select target column(s):"/>
+  </xml>
+
   <xml name="multiple_input" token_name="input_files" token_max_num="10" token_format="txt" token_label="Sparse matrix file (.mtx, .txt)" token_help_text="Specify a sparse matrix file in .txt format.">
     <repeat name="@NAME@" min="1" max="@MAX_NUM@" title="Select input file(s):">
         <param name="input" type="data" format="@FORMAT@" label="@LABEL@" help="@HELP_TEXT@"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/accuracy_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+accuracy_score : 
+0.846153846154
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/auc.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+auc : 
+2.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/average_precision_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+average_precision_score : 
+1.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/brier_score_loss.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+brier_score_loss : 
+0.564102564103
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/classification_report.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,9 @@
+classification_report : 
+             precision    recall  f1-score   support
+
+          0       1.00      1.00      1.00        14
+          1       1.00      0.62      0.77        16
+          2       0.60      1.00      0.75         9
+
+avg / total       0.91      0.85      0.85        39
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/confusion_matrix.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,4 @@
+confusion_matrix : 
+[[14  0  0]
+ [ 0 10  6]
+ [ 0  0  9]]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/f1_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+f1_score : 
+0.847633136095
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/fbeta_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+fbeta_score : 
+0.847633136095
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/hamming_loss.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+hamming_loss : 
+0.153846153846
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/hinge_loss.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+hinge_loss : 
+2.76882271268
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/jaccard_similarity_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+jaccard_similarity_score : 
+0.846153846154
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/log_loss.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+log_loss : 
+3.72487354027
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/matthews_corrcoef.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+matthews_corrcoef : 
+1.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/precision_recall_curve.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+precision_recall_curve : 
+(array([ 1.,  1.]), array([ 1.,  0.]), array([1]))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/precision_recall_fscore_support.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+precision_recall_fscore_support : 
+(0.90769230769230769, 0.84615384615384615, 0.8476331360946745, None)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/precision_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+precision_score : 
+0.907692307692
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/recall_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+recall_score : 
+0.846153846154
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/roc_auc_score.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+roc_auc_score : 
+1.0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/roc_curve.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+roc_curve : 
+(array([ 0.,  1.]), array([ 1.,  1.]), array([1, 0]))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/y.tabular	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,39 @@
+0	0	0.0	1.0	2.0	0	0	-2.76903910779	-0.777269253713	2.08028572913
+2	2	0.0	0.0	1.0	1	1	-1.46032791667	0.555654963057	-1.54234795893
+1	1	0.0	1.0	0.0	1	1	1.72939677275	-1.3402943146	-7.95375106924
+0	0	1.0	0.0	0.0	0	0	-3.15016545997	0.19568758864	1.40593056786
+2	2	0.0	0.0	1.0	1	1	1.21845859294	-0.677633363546	-6.62421395692
+0	0	1.0	0.0	0.0	0	0	-3.25263252854	-0.908498631085	2.74671790479
+2	2	0.0	0.0	1.0	1	1	1.38291089706	-0.924165117418	-6.87449092795
+0	0	1.0	0.0	0.0	0	0	-1.7423603376	-0.326034812837	-1.12743832183
+1	2	0.0	1.0	0.0	1	1	-1.88141734237	0.0471879612496	-0.990485600884
+1	2	0.0	0.9	0.1	1	1	-1.32547081613	-0.193430743286	-1.66958283068
+1	1	0.0	1.0	0.0	1	1	-2.7799666645	0.485621555351	1.21494093967
+2	2	0.0	0.2	0.8	1	1	-1.60125339649	-0.493901618129	-1.20213785254
+1	2	0.0	1.0	0.0	1	1	-1.86658623206	0.162709340336	-0.691875382528
+1	1	0.0	1.0	0.0	1	1	-1.82214550549	-0.130278514956	-0.836834994045
+1	2	0.0	0.9	0.1	1	1	-1.910728736	-0.0978509403157	-0.469743754594
+1	2	0.0	1.0	0.0	1	1	1.1191441248	-0.350015230403	-6.43122655533
+0	0	1.0	0.0	0.0	0	0	-1.80789829975	-0.267725170783	-0.533251833633
+1	1	0.0	0.9	0.1	1	1	-1.82704375852	0.186802710054	-0.367392242502
+1	1	0.0	0.9	0.1	1	1	1.05683832083	-0.491476736579	-6.10526049159
+0	0	1.0	0.0	0.0	0	0	1.58740583243	-1.32084852823	-7.47140590741
+0	0	1.0	0.0	0.0	0	0	-2.47802529094	-0.500673021108	1.37455405057
+2	2	0.0	0.3	0.7	1	1	-1.85517293032	-0.363363308535	-0.177124010926
+1	1	0.0	0.8	0.2	1	1	0.84169544958	-0.533176028466	-5.7625592501
+0	0	1.0	0.0	0.0	0	0	0.971871089969	-0.336154264594	-5.74291415928
+0	0	1.0	0.0	0.0	0	0	-2.18006328471	-0.33580204472	0.261632810716
+2	2	0.0	0.2	0.8	1	1	1.62753221054	-1.0437871236	-7.15189570944
+0	0	1.0	0.0	0.0	0	0	0.982418549211	-1.02370887933	-6.10073429813
+0	0	1.0	0.0	0.0	0	0	-1.51375235626	-0.156051081077	-1.37297970696
+1	1	0.0	1.0	0.0	1	1	-1.05517039337	0.171153321655	-1.66261211523
+1	1	0.0	1.0	0.0	1	1	1.05117238483	-0.819727602718	-6.16276877471
+0	0	1.0	0.0	0.0	0	0	-2.60008493281	-0.303483971372	0.937773514338
+2	2	0.0	0.0	1.0	1	1	-1.89873152969	-0.370955554274	0.0400346749524
+1	1	0.0	0.8	0.2	1	1	1.30185976049	-0.750494764082	-6.91956219185
+0	0	1.0	0.0	0.0	0	0	-2.20545858405	-0.462493064934	0.374957060793
+2	2	0.0	0.3	0.7	1	1	-2.97088391755	-0.384323906096	1.93410852068
+2	2	0.0	0.0	1.0	1	1	-1.52001848153	-0.275207915229	-0.625142611926
+1	1	0.0	1.0	0.0	1	1	1.32168915538	-0.986903615337	-7.22461895473
+0	0	1.0	0.0	0.0	0	0	-2.42938278814	0.0312031758068	0.740031884365
+1	2	0.0	0.0	1.0	1	1	-1.52001848153	-0.370955554274	0.937773514338
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/zero_one_loss.txt	Thu Jun 23 15:26:15 2016 -0400
@@ -0,0 +1,2 @@
+zero_one_loss : 
+0.153846153846