[mlpack] 121/207: Simple test for ARFF Loader

Barak A. Pearlmutter barak+git at pearlmutter.net
Thu Mar 23 17:53:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

commit 140131b06ee339b1bb6aa19f027963880258b91b
Author: Praveen Ch <chvsp972911 at gmail.com>
Date:   Fri Mar 3 19:02:08 2017 +1100

    Simple test for ARFF Loader
---
 src/mlpack/tests/load_arff_test.cpp | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/src/mlpack/tests/load_arff_test.cpp b/src/mlpack/tests/load_arff_test.cpp
new file mode 100644
index 0000000..c93915f
--- /dev/null
+++ b/src/mlpack/tests/load_arff_test.cpp
@@ -0,0 +1,39 @@
+/*
+  @file load_arff_test.cpp
+  @author Praveen Ch
+
+  A test to check whether the arff loader is case insensitive to declarations:
+  @relation, @attribute, @data.
+
+*/
+
+#include <mlpack/core/data/load_arff.hpp>
+#include <mlpack/core/data/dataset_mapper.hpp>
+#include <mlpack/prereqs.hpp>
+#include <mlpack/core/data/map_policies/increment_policy.hpp>
+
+#include <boost/algorithm/string/trim.hpp>
+#include <unordered_map>
+#include <boost/bimap.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include "test_tools.hpp"
+
+using namespace mlpack::data;
+
+BOOST_AUTO_TEST_SUITE(ARFFLoaderTest);
+
+BOOST_AUTO_TEST_CASE(CaseTest)
+{
+  arma::mat dataset;
+
+  DatasetMapper<IncrementPolicy> info;
+
+  LoadARFF<double, IncrementPolicy>("casecheck.arff", dataset, info);
+
+  BOOST_CHECK_EQUAL(dataset.n_rows, 2);
+  BOOST_CHECK_EQUAL(dataset.n_cols, 3);
+
+}
+
+BOOST_AUTO_TEST_SUITE_END();
\ No newline at end of file

-- 
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