From c967f8933015fa5e56dc15f086c4b9e67768c94b Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Thu, 24 May 2018 10:38:31 +0200 Subject: [PATCH 1/2] fix case weights check in cpp version --- src/Forest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forest.cpp b/src/Forest.cpp index 46e191460..990334a1a 100644 --- a/src/Forest.cpp +++ b/src/Forest.cpp @@ -112,7 +112,7 @@ void Forest::initCpp(std::string dependent_variable_name, MemoryMode memory_mode // Load case weights from file if (!case_weights_file.empty()) { loadDoubleVectorFromFile(case_weights, case_weights_file); - if (case_weights.size() != num_samples - 1) { + if (case_weights.size() != num_samples) { throw std::runtime_error("Number of case weights is not equal to number of samples."); } } From d0ae5ce6bb9411946a7c9b6d4637298c3be41235 Mon Sep 17 00:00:00 2001 From: Marvin Wright Date: Thu, 24 May 2018 10:40:26 +0200 Subject: [PATCH 2/2] remove extraneous code --- src/ForestProbability.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ForestProbability.h b/src/ForestProbability.h index 0a4b9e388..aa42c893f 100644 --- a/src/ForestProbability.h +++ b/src/ForestProbability.h @@ -67,9 +67,6 @@ class ForestProbability: public Forest { // Splitting weights std::vector class_weights; - // Table with classifications and true classes - std::map, size_t> classification_table; - private: const std::vector& getTreePrediction(size_t tree_idx, size_t sample_idx) const; size_t getTreePredictionTerminalNodeID(size_t tree_idx, size_t sample_idx) const;