MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / accuracy

Function accuracy

examples/machine_learning/knn.cpp:21–23  ·  view source on GitHub ↗

Get accuracy of the predicted results

Source from the content-addressed store, hash-verified

19
20// Get accuracy of the predicted results
21float accuracy(const array &predicted, const array &target) {
22 return 100 * count<float>(predicted == target) / target.elements();
23}
24
25// Calculate all the distances from testing set to training set
26array distance(array train, array test) {

Callers 1

knn_demoFunction · 0.70

Calls 1

elementsMethod · 0.45

Tested by

no test coverage detected