[mlpack-git] master: Don't use finalHypothesis. (31c557d)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Mon Nov 30 17:24:42 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/10b9d45b806a3e879b0564d78ccb183ebc7051ba...31c557d9cc7e4da57fd8a246085c19e076d12271
>---------------------------------------------------------------
commit 31c557d9cc7e4da57fd8a246085c19e076d12271
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Nov 30 22:23:39 2015 +0000
Don't use finalHypothesis.
>---------------------------------------------------------------
31c557d9cc7e4da57fd8a246085c19e076d12271
src/mlpack/tests/adaboost_test.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/tests/adaboost_test.cpp b/src/mlpack/tests/adaboost_test.cpp
index b8db20c..197c50e 100644
--- a/src/mlpack/tests/adaboost_test.cpp
+++ b/src/mlpack/tests/adaboost_test.cpp
@@ -124,9 +124,13 @@ BOOST_AUTO_TEST_CASE(HammingLossBoundVertebralColumn)
size_t iterations = 50;
double tolerance = 1e-10;
AdaBoost<> a(inputData, labels.row(0), p, iterations, tolerance);
+
+ arma::Row<size_t> predictedLabels;
+ a.Classify(inputData, predictedLabels);
+
size_t countError = 0;
for (size_t i = 0; i < labels.n_cols; i++)
- if (labels(i) != a.finalHypothesis(i))
+ if (labels(i) != predictedLabels(i))
countError++;
double hammingLoss = (double) countError / labels.n_cols;
More information about the mlpack-git
mailing list