[mlpack-svn] r15265 - mlpack/conf/jenkins-conf/benchmark/methods/mlpack
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jun 19 17:00:56 EDT 2013
Author: marcus
Date: 2013-06-19 17:00:56 -0400 (Wed, 19 Jun 2013)
New Revision: 15265
Modified:
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
Log:
Add support for options.
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py
===================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py 2013-06-19 20:55:18 UTC (rev 15264)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpack/pca.py 2013-06-19 21:00:56 UTC (rev 15265)
@@ -2,14 +2,14 @@
@file pca.py
@author Marcus Edel
- Class to benchmark the mlpack Principal Components Analysis.
+ Class to benchmark the mlpack Principal Components Analysis method.
'''
import os
import sys
import inspect
-# import the util path, this method even works if the path contains
+# Import the util path, this method even works if the path contains
# symlinks to modules.
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(
os.path.split(inspect.getfile(inspect.currentframe()))[0], '../../util')))
@@ -23,7 +23,6 @@
import re
import collections
-
class PCA(object):
# Create the Principal Components Analysis instance, show some informations
@@ -43,7 +42,7 @@
match = pattern.match(s)
if not match:
- Log.Fatal("Can't parse description", self.verbose)
+ Log.Warn("Can't parse description", self.verbose)
description = ''
else:
description = match.group(1)
@@ -61,11 +60,11 @@
os.remove(f)
# Perform Principal Components Analysis and return the elapsed time.
- def RunMethod(self):
+ def RunMethod(self, options):
Log.Info('Perform PCA.', self.verbose)
# Split the command using shell-like syntax.
- cmd = shlex.split(self.path + "pca -i " + self.dataset + " -o output.csv -v")
+ cmd = shlex.split(self.path + "pca -i " + self.dataset + " -o output.csv -v " + options)
# Run command with the nessecary arguments and return its output as
# a byte string. We have untrusted input so we disables all shell
@@ -95,7 +94,7 @@
match = pattern.match(data)
if not match:
- print "can't parse the data: wrong format"
+ print "Can't parse the data: wrong format"
return False
else:
# Create a namedtuple and return the timer data.
More information about the mlpack-svn
mailing list