[mlpack-svn] r17033 - mlpack/trunk/src/mlpack/methods/nystroem_method

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Aug 15 12:54:11 EDT 2014


Author: marcus
Date: Fri Aug 15 12:54:10 2014
New Revision: 17033

Log:
Use the maxIterartion as template parameter.

Modified:
   mlpack/trunk/src/mlpack/methods/nystroem_method/kmeans_selection.hpp

Modified: mlpack/trunk/src/mlpack/methods/nystroem_method/kmeans_selection.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nystroem_method/kmeans_selection.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/nystroem_method/kmeans_selection.hpp	Fri Aug 15 12:54:10 2014
@@ -14,7 +14,13 @@
 namespace mlpack {
 namespace kernel {
 
-template<typename ClusteringType = kmeans::KMeans<> >
+/**
+ * Implementation of the kmeans sampling scheme.
+ *
+ * @tparam ClusteringType Type of clustering.
+ * @tparam maxIterations Maximum number of iterations allowed before giving up.
+ */
+template<typename ClusteringType = kmeans::KMeans<>, size_t maxIterations = 5>
 class KMeansSelection
 {
  public:
@@ -26,9 +32,7 @@
    * @param m Number of points to select.
    * @return Matrix pointer in which centroids are stored.
    */
-  const static arma::mat* Select(const arma::mat& data,
-                                 const size_t m,
-                                 const size_t maxIterations = 5)
+  const static arma::mat* Select(const arma::mat& data, const size_t m)
   {
     arma::Col<size_t> assignments;
     arma::mat* centroids = new arma::mat;



More information about the mlpack-svn mailing list