Commit cabe18e1 authored by sgebreeg's avatar sgebreeg
Browse files

Merge branch 'master' into 'faster-continuous-data-split'

# Conflicts:
#   src/DecisionTree.cpp
#   src/DecisionTree.hpp
parents 59575907 97ff316e
......@@ -33,7 +33,7 @@ Node *train(vector <vector<string>> &data, vector <FeatureType> &featureType,
informationGainFromParent = parentEntropy - originalEntropy;
}
if (currentDepth > maxDepth || originalEntropy == 0.0) {
if (*currentDepth > maxDepth || originalEntropy == 0.0) {
Node *leaf = new Node(NULL, NULL, NULL, true, classification, originalEntropy, informationGainFromParent);
return leaf;
......
......@@ -21,6 +21,7 @@ public:
Node *root;
int maxDepth;
int maxDepthReached;
float featureWeight;
......
......@@ -119,6 +119,8 @@ RandomForest::getForestPrediction(vector <string>& test, RandomForest *forest, v
sort(itr->second, test, features);
}
}
cout << "Maximum depth reached = "<<tree->maxDepthReached<< " ";
cout << endl;
}
//pick the biggest voted label
......@@ -205,7 +207,6 @@ vector <pair<int, double>> sort(vector <std::pair<int, double>> &M, vector <stri
cout << features[it.first] << " is " << test[it.first] << "(information gain: " << it.second << "), ";
count++;
}
cout << endl;
return A;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment