[mlpack-svn] r15450 - in mlpack/conf/jenkins-conf/benchmark/methods: mlpack mlpy shogun
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Jul 11 10:50:27 EDT 2013
Author: marcus
Date: Thu Jul 11 10:50:27 2013
New Revision: 15450
Log:
Clean methods and set the correct dimension.
Modified:
mlpack/conf/jenkins-conf/benchmark/methods/mlpack/kmeans.py
mlpack/conf/jenkins-conf/benchmark/methods/mlpy/kernel_pca.py
mlpack/conf/jenkins-conf/benchmark/methods/shogun/nbc.py
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 Thu Jul 11 10:50:27 2013
@@ -26,7 +26,7 @@
'''
This class implements the K-Means clustering benchmark.
'''
-class KMeans(object):
+class KMEANS(object):
'''
Create the K-Means Clustering benchmark instance, show some informations and
Modified: mlpack/conf/jenkins-conf/benchmark/methods/mlpy/kernel_pca.py
==============================================================================
--- mlpack/conf/jenkins-conf/benchmark/methods/mlpy/kernel_pca.py (original)
+++ mlpack/conf/jenkins-conf/benchmark/methods/mlpy/kernel_pca.py Thu Jul 11 10:50:27 2013
@@ -60,7 +60,7 @@
# Get the new dimensionality, if it is necessary.
dimension = re.search('-d (\d+)', options)
if not dimension:
- d = data.shape[1]
+ d = data.shape[0]
else:
d = int(dimension.group(1))
if (d > data.shape[1]):
@@ -98,49 +98,7 @@
model.learn(kernel)
out = model.transform(kernel, k=d)
- print out
-
-
-
- return 0
-
- # # Load input dataset.
- # # If the dataset contains two files then the second file is the query file
- # # In this case we add this to the command line.
- # Log.Info("Loading dataset", self.verbose)
- # if len(self.dataset) == 2:
- # referenceData = np.genfromtxt(self.dataset[0], delimiter=',')
- # queryData = np.genfromtxt(self.dataset[1], delimiter=',')
- # else:
- # referenceData = np.genfromtxt(self.dataset, delimiter=',')
-
- # # Labels are the last row of the dataset.
- # labels = referenceData[:, (referenceData.shape[1] - 1)]
- # referenceData = referenceData[:,:-1]
-
- # with totalTimer:
- # # Get all the parameters.
- # k = re.search("-k (\d+)", options)
- # if not k:
- # Log.Fatal("Required option: Number of furthest neighbors to find.")
- # return -1
- # else:
- # k = int(k.group(1))
- # if (k < 1 or k > referenceData.shape[0]):
- # Log.Fatal("Invalid k: " + k.group(1) + "; must be greater than 0 and "
- # + "less ")
- # return -1
-
- # # Perform All K-Nearest-Neighbors.
- # model = mlpy.KNN(k)
- # model.learn(referenceData, labels)
-
- # if len(self.dataset) == 2:
- # out = model.pred(queryData)
- # else:
- # out = model.pred(referenceData)
-
- # return totalTimer.ElapsedTime()
+ return totalTimer.ElapsedTime()
'''
Perform Kernel Principal Components Analysis. If the method has been
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 Thu Jul 11 10:50:27 2013
@@ -59,7 +59,7 @@
testData = np.genfromtxt(self.dataset[1], delimiter=',')
# Labels are the last row of the training set.
- labels = Labels(trainData[:, (referenceData.shape[1] - 1)])
+ labels = Labels(trainData[:, (trainData.shape[1] - 1)])
with totalTimer:
# Transform into features.
More information about the mlpack-svn
mailing list