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:
@@ -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
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user