Use CSVs not ARFFs. Transpose the dataset upon loading.

This commit is contained in:
Ryan Curtin
2011-10-29 01:56:37 +00:00
parent 33e346c983
commit 194eeb732b
5 changed files with 4 additions and 14 deletions
+4 -4
View File
@@ -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;
@@ -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
1 @relation test 3 3 3 3 0
@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
1 3,4,4,3,0 3 3 3 3 0
2 3,3,4,3,0 3 4 4 3 0
3 3,6,4,3,0 3 4 4 3 0