[mlpack-git] master: Compare against the relative error. (49d2783)
gitdub at mlpack.org
gitdub at mlpack.org
Fri Jul 8 18:51:09 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/aaefadd7cfd1f0f7d4ad0118d7e23cea76383397...cf2e18cfe61a475d6b9ca1a0676fa675c5fb70b6
>---------------------------------------------------------------
commit 49d2783f3ecbc781213a8f140e11d7219c9fa0bc
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date: Sat Jul 9 00:19:46 2016 +0200
Compare against the relative error.
>---------------------------------------------------------------
49d2783f3ecbc781213a8f140e11d7219c9fa0bc
src/mlpack/tests/pca_test.cpp | 9 ---------
src/mlpack/tests/randomized_svd_test.cpp | 2 +-
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/mlpack/tests/pca_test.cpp b/src/mlpack/tests/pca_test.cpp
index b8bc88a..5176f88 100644
--- a/src/mlpack/tests/pca_test.cpp
+++ b/src/mlpack/tests/pca_test.cpp
@@ -221,15 +221,6 @@ BOOST_AUTO_TEST_CASE(ExactPCAVarianceRetainedTest)
}
/**
- * Test that setting the variance retained parameter to perform dimensionality
- * reduction works using the randomized svd PCA method.
- */
-BOOST_AUTO_TEST_CASE(RandomizedPCAVarianceRetainedTest)
-{
- PCAVarianceRetained<RandomizedSVDPolicy>();
-}
-
-/**
* Test that scaling PCA works.
*/
BOOST_AUTO_TEST_CASE(PCAScalingTest)
diff --git a/src/mlpack/tests/randomized_svd_test.cpp b/src/mlpack/tests/randomized_svd_test.cpp
index d0050e9..df8d663 100644
--- a/src/mlpack/tests/randomized_svd_test.cpp
+++ b/src/mlpack/tests/randomized_svd_test.cpp
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(RandomizedSVDReconstructionError)
s3 = s1.subvec(0, s2.n_elem - 1);
// The sigular value error should be small.
- double error = arma::norm(s2 - s3, "frob");
+ double error = arma::norm(s2 - s3, "frob") / arma::norm(s2, "frob");
BOOST_REQUIRE_SMALL(error, 1e-5);
arma::mat reconstruct = U2 * arma::diagmat(s2) * V2.t();
More information about the mlpack-git
mailing list