Skip to content

Commit

Permalink
Merge pull request #321 from imbs-hl/fix_case_weights
Browse files Browse the repository at this point in the history
Fix case weights check in cpp version
  • Loading branch information
mnwright authored May 24, 2018
2 parents e38aba7 + d0ae5ce commit 2459cf9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/Forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/ForestProbability.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ class ForestProbability: public Forest {
// Splitting weights
std::vector<double> class_weights;

// Table with classifications and true classes
std::map<std::pair<double, double>, size_t> classification_table;

private:
const std::vector<double>& getTreePrediction(size_t tree_idx, size_t sample_idx) const;
size_t getTreePredictionTerminalNodeID(size_t tree_idx, size_t sample_idx) const;
Expand Down

0 comments on commit 2459cf9

Please sign in to comment.