[mlpack-svn] r15521 - mlpack/conf/jenkins-conf/benchmark/methods/mlpack

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 22 08:37:26 EDT 2013


Author: marcus
Date: Mon Jul 22 08:37:25 2013
New Revision: 15521

Log:
Clean up mlpack scripts.

Modified:
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py
   mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkfn.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the All K-Furthest-Neighbors benchmark instance, show some informations 
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform  All K-Furthest-Neighbors on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -86,7 +86,7 @@
 		# In this case we add this to the command line.
 		if len(self.dataset) == 2:
 			cmd = shlex.split(self.path + "allkfn -r " + self.dataset[0] + " -q " + 
-					self.dataset[1] + " -v -n neighbors.csv -d distances.csv" + options)
+					self.dataset[1] + " -v -n neighbors.csv -d distances.csv " + options)
 		else:
 			cmd = shlex.split(self.path + "allkfn -r " + self.dataset +
 					" -v -n neighbors.csv -d distances.csv " + options)		

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allknn.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the All K-Nearest-Neighbors benchmark instance, show some informations 
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform All K-Nearest-Neighbors on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -86,7 +85,7 @@
 		# In this case we add this to the command line.
 		if len(self.dataset) == 2:
 			cmd = shlex.split(self.path + "allknn -r " + self.dataset[0] + " -q " + 
-					self.dataset[1] + " -v -n neighbors.csv -d distances.csv" + options)
+					self.dataset[1] + " -v -n neighbors.csv -d distances.csv " + options)
 		else:
 			cmd = shlex.split(self.path + "allknn -r " + self.dataset + 
 					" -v -n neighbors.csv -d distances.csv " + options)		

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/allkrann.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the All K-Rank-Approximate-Nearest-Neighbors benchmark instance, show 
 	some informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform ALLKRANN on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -86,7 +85,7 @@
 		# In this case we add this to the command line.
 		if len(self.dataset) == 2:
 			cmd = shlex.split(self.path + "allkrann -r " + self.dataset[0] + " -q " + 
-					self.dataset[1] + " -v -n neighbors.csv -d distances.csv" + options)
+					self.dataset[1] + " -v -n neighbors.csv -d distances.csv " + options)
 		else:
 			cmd = shlex.split(self.path + "allkrann -r " + self.dataset + 
 					" -v -n neighbors.csv -d distances.csv " + options)		

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/det.py	Mon Jul 22 08:37:25 2013
@@ -34,7 +34,7 @@
 	Create the Estimation With Density Estimation Trees benchmark instance, show 
 	some informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Density Estimation on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -49,20 +49,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/emst.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Fast Euclidean Minimum Spanning Tree benchmark instance, show some
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform EMST on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/fastmks.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Fast Max-Kernel Search benchmark instance, show some informations 
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Fast Max-Kernel Search on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/gmm.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Gaussian Mixture Model benchmark instance, show some informations
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Gaussian Mixture Model on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -134,5 +133,4 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.em
-		return time
+		return timer.em

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_generate.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Markov Model Sequence Generator benchmark instance, show some
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform HMM Sequence Generator on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_loglik.py	Mon Jul 22 08:37:25 2013
@@ -29,8 +29,14 @@
 '''
 class HMMLOGLIK(object):
 
-	# Create the Hidden Markov Model Training instance, show some informations and
-	# return the instance.
+	''' 
+	Create the Hidden Markov Model Sequence Log-Likelihood benchmark instance, 
+	show some	informations and return the instance.
+  
+  @param dataset - Input dataset to perform HMM Log-Likelihood on.
+  @param path - Path to the mlpack executable.
+  @param verbose - Display informational messages.
+	'''
 	def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True): 
 		self.verbose = verbose
 		self.dataset = dataset
@@ -42,20 +48,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -81,7 +86,7 @@
 			cmd = shlex.split(self.path + "hmm_loglik -i " + self.dataset[0] + " -m " 
 					+ self.dataset[1] + " -v " + options)	
 		else:
-			Log.Fatal("Not enough input datasets.")
+			Log.Fatal("This method requires two datasets.")
 			return -1
 
 		# Run command with the nessecary arguments and return its output as a byte 

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_train.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Hidden Markov Model Training benchmark instance, show some
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Hidden Markov Model Training on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/hmm_viterbi.py	Mon Jul 22 08:37:25 2013
@@ -30,8 +30,14 @@
 '''
 class HMMVITERBI(object):
 
-	# Create the HHidden Markov Model Viterbi State Prediction instance, show some
-	# informations and return the instance.
+	''' 
+	Create the Hidden Markov Model Viterbi State Prediction benchmark instance, 
+	show some	informations and return the instance.
+  
+  @param dataset - Input dataset to perform HMM Viterbi State Prediction on.
+  @param path - Path to the mlpack executable.
+  @param verbose - Display informational messages.
+	'''
 	def __init__(self, dataset, path=os.environ["MLPACK_BIN"], verbose=True): 
 		self.verbose = verbose
 		self.dataset = dataset
@@ -43,20 +49,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/ica.py	Mon Jul 22 08:37:25 2013
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kernel_pca.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Kernel Principal Components Analysis benchmark instance, show some 
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform KPCA on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
   Create the K-Means Clustering benchmark instance, show some informations and
   return the instance.
   
-  @param dataset - Input dataset to perform K-Means on.
+  @param dataset - Input dataset to perform K-Means clustering on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
   '''
@@ -47,20 +47,19 @@
       s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False) 
     except Exception, e:
       Log.Fatal("Could not execute command: " + str(cmd))
-      return -1
-
-    # Use regular expression pattern to get the description.
-    pattern = re.compile(r"""(.*?)Required.*?options:""", 
-        re.VERBOSE|re.MULTILINE|re.DOTALL)
-    
-    match = pattern.match(s)
-    if not match:
-      Log.Warn("Can't parse description", self.verbose)
-      description = ""
     else:
-      description = match.group(1)
-    
-    self.description = description
+      # Use regular expression pattern to get the description.
+      pattern = re.compile(r"""(.*?)Required.*?options:""", 
+          re.VERBOSE|re.MULTILINE|re.DOTALL)
+      
+      match = pattern.match(s)
+      if not match:
+        Log.Warn("Can't parse description", self.verbose)
+        description = ""
+      else:
+        description = match.group(1)
+      
+      self.description = description
 
   '''
   Destructor to clean up at the end. Use this method to remove created files.
@@ -140,5 +139,4 @@
   @return Elapsed time in seconds.
   '''
   def GetTime(self, timer):
-    time = timer.clustering
-    return time
+    return timer.clustering

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lars.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Least Angle Regression benchmark instance, show some informations 
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Least Angle Regression on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -83,7 +82,7 @@
 		Log.Info("Perform LARS.", self.verbose)
 
 		if len(self.dataset) < 2:
-			Log.Fatal("The method need two datasets.")
+			Log.Fatal("This method requires two datasets.")
 			return -1
 
 		# Split the command using shell-like syntax.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/linear_regression.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Simple Linear Regression Prediction benchmark instance, show some
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Linear Regression Prediction on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -140,6 +139,5 @@
 	@return Elapsed time in seconds.
 	'''
 	def GetTime(self, timer):
-		time = timer.regression
-		return time
+		return timer.regression
 		
\ No newline at end of file

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/local_coordinate_coding.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Local Coordinate Coding benchmark instance, show some informations 
 	and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Local Coordinate Coding on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/lsh.py	Mon Jul 22 08:37:25 2013
@@ -33,7 +33,7 @@
 	Create the All K-Approximate-Nearest-Neighbor Search with LSH benchmark 
 	instance, show some informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform LSH on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -48,20 +48,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nbc.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Parametric Naive Bayes Classifier benchmark instance, show some 
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Naive Bayes Classifier on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
 
-		self.description = description
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -82,8 +81,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.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nca.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Neighborhood Components Analysis benchmark instance, show some
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform NCA on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/nmf.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Non-negative Matrix Factorization benchmark instance, show some 
 	informations and return the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform NMF on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 		  s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
 
-		self.description = description
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py	Mon Jul 22 08:37:25 2013
@@ -48,20 +48,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/range_search.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Range Search benchmark instance, show some informations and return
 	the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Range Search on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.
@@ -86,7 +85,7 @@
 		# In this case we add this to the command line.
 		if len(self.dataset) == 2:
 			cmd = shlex.split(self.path + "range_search -r " + self.dataset[0] + "-q "
-					+ self.dataset[1] + " -v -n neighbors.csv -d distances.csv" + options)
+					+ self.dataset[1] + " -v -n neighbors.csv -d distances.csv " + options)
 		else:
 			cmd = shlex.split(self.path + "range_search -r " + self.dataset + 
 					" -v -n neighbors.csv -d distances.csv " + options)		

Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py	(original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/sparse_coding.py	Mon Jul 22 08:37:25 2013
@@ -32,7 +32,7 @@
 	Create the Sparse Coding benchmark instance, show some informations and return
 	the instance.
   
-  @param dataset - Input dataset to perform PCA on.
+  @param dataset - Input dataset to perform Sparse Coding on.
   @param path - Path to the mlpack executable.
   @param verbose - Display informational messages.
 	'''
@@ -47,20 +47,19 @@
 			s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False)	
 		except Exception, e:
 			Log.Fatal("Could not execute command: " + str(cmd))
-			return -1
-
-		# Use regular expression pattern to get the description.
-		pattern = re.compile(r"""(.*?)Required.*?options:""", 
-				re.VERBOSE|re.MULTILINE|re.DOTALL)
-		
-		match = pattern.match(s)
-		if not match:
-			Log.Warn("Can't parse description", self.verbose)
-			description = ""
 		else:
-			description = match.group(1)
-		
-		self.description = description
+			# Use regular expression pattern to get the description.
+			pattern = re.compile(r"""(.*?)Required.*?options:""", 
+					re.VERBOSE|re.MULTILINE|re.DOTALL)
+			
+			match = pattern.match(s)
+			if not match:
+				Log.Warn("Can't parse description", self.verbose)
+				description = ""
+			else:
+				description = match.group(1)
+			
+			self.description = description
 
 	'''
 	Destructor to clean up at the end. Use this method to remove created files.



More information about the mlpack-svn mailing list