Move SplitData to data namespace.

It seems more appropriate to me; the util namespace primarily contains utilities
for C++ programming in mlpack, whereas the data namespace contains utilities for
manipulating data.
This commit is contained in:
Ryan Curtin
2016-04-22 09:03:23 -04:00
parent c20195c141
commit 410bed0b7a
2 changed files with 5 additions and 5 deletions
@@ -4,7 +4,7 @@
#include <mlpack/core.hpp>
namespace mlpack {
namespace util {
namespace data {
/**
*Split training data and test data
@@ -95,7 +95,7 @@ TrainTestSplit(const arma::Mat<T> &input,
trainLabel, testLabel);
}
} // namespace util
} // namespace data
} // namespace mlpack
#endif
+3 -3
View File
@@ -4,15 +4,15 @@
*
* Test the SparseAutoencoder class.
*/
#include <mlpack/core.hpp>
#include <mlpack/core/util/split_data.hpp>
#include <mlpack/core/data/split_data.hpp>
#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"
using namespace mlpack;
using namespace arma;
using namespace mlpack::data;
BOOST_AUTO_TEST_SUITE(SplitDataTest);
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(SplitDataSplitResultMat)
arma::linspace<Labels>(0, input.n_cols-1,
input.n_cols);
auto const value = util::TrainTestSplit(input, labels, 0.2);
auto const value = TrainTestSplit(input, labels, 0.2);
BOOST_REQUIRE(std::get<0>(value).n_cols == 8);
BOOST_REQUIRE(std::get<1>(value).n_cols == 2);
BOOST_REQUIRE(std::get<2>(value).n_cols == 8);