MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / score

Method score

src/thundersvm/util/metric.cpp:10–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8}
9
10float_type Accuracy::score(const vector<float_type> &predict_y, const vector<float_type> &ground_truth_y) {
11 int n_correct = 0;
12 for (int i = 0; i < predict_y.size(); ++i) {
13 if (predict_y[i] == ground_truth_y[i])
14 n_correct++;
15 }
16 float accuracy = n_correct / (float) ground_truth_y.size();
17 return accuracy;
18}
19
20string MSE::name() {
21 return "Mean Squared Error";

Callers 11

test_cvMethod · 0.80
mainFunction · 0.80
train_RFunction · 0.80
predict_RFunction · 0.80
thundersvm_train_subFunction · 0.80
thundersvm_predict_subFunction · 0.80
mainFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 5

test_cvMethod · 0.64