[mlpack-svn] r15525 - in mlpack/conf/jenkins-conf/benchmark/methods/weka: . src

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 22 11:04:36 EDT 2013


Author: marcus
Date: Mon Jul 22 11:04:35 2013
New Revision: 15525

Log:
Clean up weka scripts.

Modified:
   mlpack/conf/jenkins-conf/benchmark/methods/weka/allknn.py
   mlpack/conf/jenkins-conf/benchmark/methods/weka/kmeans.py
   mlpack/conf/jenkins-conf/benchmark/methods/weka/linear_regression.py
   mlpack/conf/jenkins-conf/benchmark/methods/weka/nbc.py
   mlpack/conf/jenkins-conf/benchmark/methods/weka/pca.py
   mlpack/conf/jenkins-conf/benchmark/methods/weka/src/AllKnn.java
   mlpack/conf/jenkins-conf/benchmark/methods/weka/src/KMeans.java
   mlpack/conf/jenkins-conf/benchmark/methods/weka/src/LinearRegression.java

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/allknn.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/allknn.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/allknn.py	Mon Jul 22 11:04:35 2013
@@ -40,12 +40,6 @@
 		self.verbose = verbose
 		self.dataset = dataset
 		self.path = path
-
-	'''
-	Destructor to clean up at the end.
-	'''
-	def __del__(self):		
-		pass	
 		
 	'''
   All K-Nearest-Neighbors. If the method has been successfully completed return 
@@ -120,5 +114,4 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.total_time
-		return time
+		return timer.total_time

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/kmeans.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/kmeans.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/kmeans.py	Mon Jul 22 11:04:35 2013
@@ -39,13 +39,7 @@
 	def __init__(self, dataset, path=os.environ["WEKA_CLASSPATH"], verbose = True): 
 		self.verbose = verbose
 		self.dataset = dataset
-		self.path = path
-
-	'''
-	Destructor to clean up at the end.
-	'''
-	def __del__(self):		
-		pass	
+		self.path = path	
 		
 	'''
   K-Means Clustering benchmark instance. If the method has been successfully 
@@ -113,5 +107,4 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.total_time
-		return time
+		return timer.total_time

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/linear_regression.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/linear_regression.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/linear_regression.py	Mon Jul 22 11:04:35 2013
@@ -40,12 +40,6 @@
 		self.verbose = verbose
 		self.dataset = dataset
 		self.path = path
-
-	'''
-	Destructor to clean up at the end.
-	'''
-	def __del__(self):		
-		pass	
 		
 	'''
   Linear Regression. If the method has been successfully completed return 
@@ -120,5 +114,4 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.total_time
-		return time
+		return timer.total_time

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/nbc.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/nbc.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/nbc.py	Mon Jul 22 11:04:35 2013
@@ -40,12 +40,6 @@
 		self.verbose = verbose
 		self.dataset = dataset
 		self.path = path
-
-	'''
-	Destructor to clean up at the end.
-	'''
-	def __del__(self):		
-		pass	
 		
 	'''
   Naive Bayes Classifier. If the method has been successfully completed return 
@@ -57,8 +51,8 @@
 	def RunMethod(self, options):
 		Log.Info("Perform NBC.", self.verbose)
 
-		if len(self.dataset) < 2:
-			Log.Fatal("The method need two datasets.")
+		if len(self.dataset) != 2:
+			Log.Fatal("This method requires two datasets.")
 			return -1
 
 		# Split the command using shell-like syntax.
@@ -117,5 +111,4 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.total_time
-		return time
+		return timer.total_time

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/pca.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/pca.py	Mon Jul 22 11:04:35 2013
@@ -40,12 +40,6 @@
 		self.verbose = verbose
 		self.dataset = dataset
 		self.path = path
-
-	'''
-	Destructor to clean up at the end.
-	'''
-	def __del__(self):		
-		pass	
 		
 	'''
   Perform Principal Components Analysis. If the method has been successfully 

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/src/AllKnn.java
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/src/AllKnn.java	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/src/AllKnn.java	Mon Jul 22 11:04:35 2013
@@ -20,10 +20,12 @@
 	    + "reference points and query points, or just a reference set which\n"
 	    + "will be used as both the reference and query set.\n\n"
 			+ "Required options:\n"
-			+ "(-k) [int]        Number of furthest neighbors to find.\n"
-			+ "(-l) [int]        Leaf size for tree building.  Default value 20.\n"
-			+ "(-q) [string]     File containing query points (optional).\n"
-			+ "Default value ''.\n");
+			+ "-r [string]     File containing the reference dataset.\n"
+			+ "-k [int]        Number of furthest neighbors to find.\n\n"
+			+ "Options:\n"
+			+ "-l [int]        Leaf size for tree building.  Default value 20.\n"
+			+ "-q [string]     File containing query points (optional).\n"
+			+ "                Default value ''.\n");
 	
 	public static void main(String args[]) {
 		Timers timer = new Timers();

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/src/KMeans.java
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/src/KMeans.java	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/src/KMeans.java	Mon Jul 22 11:04:35 2013
@@ -18,11 +18,12 @@
   private static final String USAGE = String
       .format("This program performs K-Means clustering on the given dataset.\n\n"
           + "Required options:\n"
-          + "(-c) [int]         Number of clusters to find.\n"
-          + "(-i) [string]      Input dataset to perform clustering on."
-          + "-m) [int]          Maximum number of iterations before K-Means\n"
-          + "                   terminates.  Default value 1000.\n"
-          + "(-s) [int]         Random seed. ");
+          + "-c [int]         Number of clusters to find.\n"
+          + "-i [string]      Input dataset to perform clustering on.\n\n"
+          + "Options:\n"
+          + "-m [int]         Maximum number of iterations before K-Means\n"
+          + "                 terminates. Default value 1000.\n"
+          + "-s [int]         Random seed.");
 
   public static void main(String args[]) {
     Timers timer = new Timers();

Modified: mlpack/conf/jenkins-conf/benchmark/methods/weka/src/LinearRegression.java
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/weka/src/LinearRegression.java	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/weka/src/LinearRegression.java	Mon Jul 22 11:04:35 2013
@@ -18,9 +18,9 @@
           + "Required options:\n"
           + "-i [string]     File containing X (regressors).\n\n"
           + "Options:\n\n"
-          + "(-r) [string]   Optional file containing y (responses).\n"
-          + "                If not given, the responses are assumed\n"
-          + "                to be the last row of the input file.");
+          + "-r [string]   Optional file containing y (responses).\n"
+          + "              If not given, the responses are assumed\n"
+          + "              to be the last row of the input file.");
   
   public static void main(String args[]) {
     Timers timer = new Timers();



More information about the mlpack-svn mailing list