TheDigitalFrontier / parallel-decision-trees

Semester project in CS205 Computing Foundations for Computational Science at Harvard School of Engineering and Applied Sciences, spring 2020.
MIT License
3 stars 1 forks source link

Metrics for comparing targets and predictions #51

Closed johannes-kk closed 4 years ago

johannes-kk commented 4 years ago

Create metrics.cpp and metrics.hpp, similar to losses.* but for comparing targets to predictions.

E.g. accuracy:

double accuracy_score(datavec targets, datavec predictions){
    // todo: verify that target and predict have same size
    double correct = 0;
    for (int i = 0; i < targets.size(); i++){
        if (targets[i] == predictions[i]){
            correct += 1;
        } 
    }
    return correct/targets.size();
}
wfseaton commented 4 years ago

Which metrics would we want? Here is sklearn's list for reference: https://scikit-learn.org/stable/modules/model_evaluation.html

johannes-kk commented 4 years ago

accuracy is all we need to begin with. Precision, Recall, F1-score and the likes would be nice to have, but nothing we need. We're focusing on binary classification for the MVP, and accuracy is plenty to make comparisons between methods and runs.