Get accuracy of the predicted results
| 19 | |
| 20 | // Get accuracy of the predicted results |
| 21 | float accuracy(const array &predicted, const array &target) { |
| 22 | return 100 * count<float>(predicted == target) / target.elements(); |
| 23 | } |
| 24 | |
| 25 | void naive_bayes_train(float *priors, array &mu, array &sig2, |
| 26 | const array &train_feats, const array &train_classes, |
no test coverage detected