Commit 577aca06 authored by sgebreeg's avatar sgebreeg
Browse files

clean up

parent 107dba25
......@@ -93,6 +93,7 @@ string DecisionTree::predictSingle(vector <string>& test, Node *treeRoot, Predic
}
Question *question = treeRoot->question;
int splitIndex = question->splitFeatureIndex;
cout<<splitIndex<<endl;
std::pair<int, double> featureInfoGain(question->splitFeatureIndex,
treeRoot->informationGainFromParent); // value init
......
......@@ -236,6 +236,14 @@ vector <pair<int, double>> sort(map<int, double> &M, vector <string> test, vecto
cout << features[it.first] << " is " << test[it.first] << ", ";
count++;
}
// cout<<endl;
//
// cout<<"All explanation: ";
// for (auto &it : A) {
//
// cout << features[it.first] << " is " << test[it.first] << ", ";
//
// }
cout << endl;
return A;
}
......
......@@ -43,9 +43,9 @@ int main(int argc, char *argv[]) {
vector <vector<string>> datasetAsString;
vector <FeatureType> featureTypes;
vector <string> features;
datasetAsString = parseDataToString("../datasets/mnist.data");
featureTypes = parseFeatureTypes("../datasets/mnist.featureTypes");
features = parseFeatures("../datasets/mnist.features");
datasetAsString = parseDataToString("../datasets/adult.data");
featureTypes = parseFeatureTypes("../datasets/adult.featureTypes");
features = parseFeatures("../datasets/adult.features");
//pick number of features to select for random sub-spacing
float featureWeight = sqrt(features.size())/features.size();
......@@ -81,11 +81,11 @@ int main(int argc, char *argv[]) {
cout << endl;
cout << "********************* Forest accuracy *****************" << endl;
accuracyReport report = randomForest->getAccuracy(datasetAsString,testingIdxs);
accuracy += report.accuracy;
randomForest->printAccuracyReportFile(report);
// cout << "********************* Forest accuracy *****************" << endl;
// accuracyReport report = randomForest->getAccuracy(datasetAsString,testingIdxs);
//
// accuracy += report.accuracy;
// randomForest->printAccuracyReportFile(report);
cout << "**************** prediction with explanation ********** " << endl;
......
Supports Markdown
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