[mlpack-svn] r15441 - in mlpack/conf/jenkins-conf/benchmark/methods: matlab mlpy scikit shogun

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Jul 9 15:23:52 EDT 2013


Author: marcus
Date: Tue Jul  9 15:23:51 2013
New Revision: 15441

Log:
Use the data dimension instead of the hardcoded dimension.

Modified:
   mlpack/conf/jenkins-conf/benchmark/methods/matlab/kmeans.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpy/pca.py
   mlpack/conf/jenkins-conf/benchmark/methods/scikit/kmeans.py
   mlpack/conf/jenkins-conf/benchmark/methods/scikit/nbc.py
   mlpack/conf/jenkins-conf/benchmark/methods/shogun/nbc.py

Modified: mlpack/conf/jenkins-conf/benchmark/methods/matlab/kmeans.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/matlab/kmeans.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/matlab/kmeans.py	Tue Jul  9 15:23:51 2013
@@ -48,7 +48,7 @@
 		pass	
 		
 	'''
-  Non-negative Matrix Factorization. If the method has been successfully 
+  K-Means Clustering benchmark instance. If the method has been successfully 
   completed return the elapsed time in seconds.
 
   @param options - Extra options for the method.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpy/pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpy/pca.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpy/pca.py	Tue Jul  9 15:23:51 2013
@@ -49,7 +49,7 @@
   @param options - Extra options for the method.
   @return - Elapsed time in seconds or -1 if the method was not successful.
   '''
-  def PCASMlpy(self, options):
+  def PCAMlpy(self, options):
     totalTimer = Timer()
 
     # Load input dataset.
@@ -89,4 +89,4 @@
   def RunMethod(self, options):
     Log.Info("Perform PCA.", self.verbose)
 
-    return self.PCASMlpy(options)
+    return self.PCAMlpy(options)

Modified: mlpack/conf/jenkins-conf/benchmark/methods/scikit/kmeans.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/scikit/kmeans.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/scikit/kmeans.py	Tue Jul  9 15:23:51 2013
@@ -20,7 +20,7 @@
 from timer import *
 
 import numpy as np
-from mlpy import Kmeans
+from sklearn.cluster import KMeans
 
 '''
 This class implements the K-Means Clustering benchmark.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/scikit/nbc.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/scikit/nbc.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/scikit/nbc.py	Tue Jul  9 15:23:51 2013
@@ -58,7 +58,7 @@
     testData = np.genfromtxt(self.dataset[1], delimiter=',')
 
     # Labels are the last row of the training set.
-    labels = trainData[:,4]
+    labels = trainData[:, (trainData.shape[1] - 1)]
     trainData = trainData[:,:-1]
 
     with totalTimer:      

Modified: mlpack/conf/jenkins-conf/benchmark/methods/shogun/nbc.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/shogun/nbc.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/shogun/nbc.py	Tue Jul  9 15:23:51 2013
@@ -59,7 +59,7 @@
     testData = np.genfromtxt(self.dataset[1], delimiter=',')
 
     # Labels are the last row of the training set.
-    labels = Labels(trainData[:,4])
+    labels = Labels(trainData[:, (referenceData.shape[1] - 1)])
 
     with totalTimer:
       # Transform into features.



More information about the mlpack-svn mailing list