Use CSVs not ARFFs. Transpose the dataset upon loading.
This commit is contained in:
@@ -15,8 +15,8 @@ BOOST_AUTO_TEST_CASE(SimpleNBCTest) {
|
||||
size_t number_of_classes_ = 2;
|
||||
|
||||
arma::mat train_data, train_res, calc_mat;
|
||||
train_data.load(filename_train_);
|
||||
train_res.load(train_result_);
|
||||
train_data.load(filename_train_, arma::auto_detect, true, true);
|
||||
train_res.load(train_result_, arma::auto_detect, true, true);
|
||||
|
||||
CLI::GetParam<int>("nbc/classes") = number_of_classes_;
|
||||
SimpleNaiveBayesClassifier nbc_test_(train_data);
|
||||
@@ -41,8 +41,8 @@ BOOST_AUTO_TEST_CASE(SimpleNBCTest) {
|
||||
|
||||
arma::mat test_data, test_res;
|
||||
arma::vec test_res_vec, calc_vec;
|
||||
test_data.load(filename_test_);
|
||||
test_res.load(test_result_);
|
||||
test_data.load(filename_test_, arma::auto_detect, true, true);
|
||||
test_res.load(test_result_, arma::auto_detect, true, true);
|
||||
nbc_test_.Classify(test_data, calc_vec);
|
||||
|
||||
size_t number_of_datum = test_data.n_cols;
|
||||
|
||||
-10
@@ -1,13 +1,3 @@
|
||||
@relation test
|
||||
|
||||
% These should get 100% classification with k < 30
|
||||
@attribute a real
|
||||
@attribute b real
|
||||
@attribute c real
|
||||
@attribute d real
|
||||
@attribute class {0,1}
|
||||
|
||||
@data
|
||||
3,3,3,3,0
|
||||
3,4,4,3,0
|
||||
3,4,4,3,0
|
||||
|
Reference in New Issue
Block a user