[mlpack] 149/149: Tests for Non-linearly separable dataset fixed.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Sat May 2 09:11:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch svn-trunk
in repository mlpack.
commit 35183840f52ed256e192ea6b9a3d6fc3bbe4ea79
Author: saxena.udit <saxena.udit at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date: Wed Jan 7 20:04:08 2015 +0000
Tests for Non-linearly separable dataset fixed.
git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17507 9d5b8971-822b-0410-80eb-d18c1038ef23
---
src/mlpack/tests/adaboost_test.cpp | 55 +++-----------------------------------
1 file changed, 4 insertions(+), 51 deletions(-)
diff --git a/src/mlpack/tests/adaboost_test.cpp b/src/mlpack/tests/adaboost_test.cpp
index 8c526d7..6d0ec63 100644
--- a/src/mlpack/tests/adaboost_test.cpp
+++ b/src/mlpack/tests/adaboost_test.cpp
@@ -207,15 +207,10 @@ BOOST_AUTO_TEST_CASE(HammingLossBoundNonLinearSepData)
arma::Mat<size_t> labels;
-<<<<<<< HEAD
- if (!data::Load("nonlinsepdata_labels.txt", labels))
- BOOST_FAIL("Cannot load labels for nonlinsepdata_labels.txt");
-=======
if (!data::Load("train_labels_nonlinsep.txt",labels))
BOOST_FAIL("Cannot load labels for train_labels_nonlinsep.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
// no need to map the labels here
// Define your own weak learner, perceptron in this case.
@@ -254,15 +249,9 @@ BOOST_AUTO_TEST_CASE(WeakLearnerErrorNonLinearSepData)
arma::Mat<size_t> labels;
-<<<<<<< HEAD
- if (!data::Load("nonlinsepdata_labels.txt",labels))
- BOOST_FAIL("Cannot load labels for nonlinsepdata_labels.txt");
-
-=======
if (!data::Load("train_labels_nonlinsep.txt",labels))
BOOST_FAIL("Cannot load labels for train_labels_nonlinsep.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
// no need to map the labels here
// Define your own weak learner, perceptron in this case.
@@ -501,15 +490,10 @@ BOOST_AUTO_TEST_CASE(HammingLossBoundNonLinearSepData_DS)
arma::Mat<size_t> labels;
-<<<<<<< HEAD
- if (!data::Load("nonlinsepdata_labels.txt",labels))
- BOOST_FAIL("Cannot load labels for nonlinsepdata_labels.txt");
-
-=======
if (!data::Load("train_labels_nonlinsep.txt",labels))
BOOST_FAIL("Cannot load labels for train_labels_nonlinsep.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
+
// no need to map the labels here
// Define your own weak learner, Decision Stump in this case.
@@ -553,15 +537,9 @@ BOOST_AUTO_TEST_CASE(WeakLearnerErrorNonLinearSepData_DS)
arma::Mat<size_t> labels;
-<<<<<<< HEAD
- if (!data::Load("nonlinsepdata_labels.txt",labels))
- BOOST_FAIL("Cannot load labels for nonlinsepdata_labels.txt");
-
-=======
if (!data::Load("train_labels_nonlinsep.txt",labels))
BOOST_FAIL("Cannot load labels for train_labels_nonlinsep.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
// no need to map the labels here
// Define your own weak learner, Decision Stump in this case.
@@ -617,9 +595,7 @@ BOOST_AUTO_TEST_CASE(ClassifyTest_VERTEBRALCOL)
// Define your own weak learner, perceptron in this case.
// Run the perceptron for perceptron_iter iterations.
-<<<<<<< HEAD
- int perceptron_iter = 5000;
-=======
+
int perceptron_iter = 1000;
arma::mat testData;
@@ -631,43 +607,30 @@ BOOST_AUTO_TEST_CASE(ClassifyTest_VERTEBRALCOL)
if (!data::Load("vc2_test_labels.txt",trueTestLabels))
BOOST_FAIL("Cannot load labels for vc2_test_labels.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
arma::Row<size_t> perceptronPrediction(labels.n_cols);
perceptron::Perceptron<> p(inputData, labels.row(0), perceptron_iter);
p.Classify(inputData, perceptronPrediction);
// Define parameters for the adaboost
-<<<<<<< HEAD
- int iterations = 250;
- double tolerance = 1e-10;
- AdaBoost<> a(inputData, labels.row(0), iterations, tolerance, p);
- arma::Row<size_t> predictedLabels(inputData.n_cols);
- a.Classify(inputData, predictedLabels);
-=======
int iterations = 100;
double tolerance = 1e-10;
AdaBoost<> a(inputData, labels.row(0), iterations, tolerance, p);
arma::Row<size_t> predictedLabels(testData.n_cols);
a.Classify(testData, predictedLabels);
->>>>>>> Tests for Non-linearly separable dataset fixed.
int localError = 0;
for (size_t i = 0; i < trueTestLabels.n_cols; i++)
if(trueTestLabels(i) != predictedLabels(i))
localError++;
-<<<<<<< HEAD
- double lError = (double) localError / labels.n_cols;
-
- BOOST_REQUIRE_LT(lError, 0.30);
-=======
+
double lError = (double) localError / trueTestLabels.n_cols;
BOOST_REQUIRE(lError <= 0.30);
->>>>>>> Tests for Non-linearly separable dataset fixed.
+
}
/**
@@ -684,15 +647,9 @@ BOOST_AUTO_TEST_CASE(ClassifyTest_NONLINSEP)
arma::Mat<size_t> labels;
-<<<<<<< HEAD
- if (!data::Load("nonlinsepdata_labels.txt",labels))
- BOOST_FAIL("Cannot load labels for nonlinsepdata_labels.txt");
-
-=======
if (!data::Load("train_labels_nonlinsep.txt",labels))
BOOST_FAIL("Cannot load labels for train_labels_nonlinsep.txt");
->>>>>>> Tests for Non-linearly separable dataset fixed.
// no need to map the labels here
// Define your own weak learner, perceptron in this case.
@@ -729,13 +686,9 @@ BOOST_AUTO_TEST_CASE(ClassifyTest_NONLINSEP)
for (size_t i = 0; i < trueTestLabels.n_cols; i++)
if(trueTestLabels(i) != predictedLabels(i))
localError++;
-<<<<<<< HEAD
- double lError = (double) localError / labels.n_cols;
-=======
double lError = (double) localError / trueTestLabels.n_cols;
->>>>>>> Tests for Non-linearly separable dataset fixed.
BOOST_REQUIRE(lError <= 0.30);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list