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

Function accuracy

examples/machine_learning/naive_bayes.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
25void naive_bayes_train(float *priors, array &mu, array &sig2,
26 const array &train_feats, const array &train_classes,

Callers 1

naive_bayes_demoFunction · 0.70

Calls 1

elementsMethod · 0.45

Tested by

no test coverage detected