I have actual values and predicted values.
Actual: 33.3663, 38.2561, 28.6362, 35.6252
Predicted: 28.9721, 35.6161, 27.9561, 22.6272
I want to apply confusion matrix to find the accuracy.
First thing, confusion matrix is not for continuous values. AND you can also use it by converting continuous values to classes. check https://datascience.stackexchange.com/questions/46019/continuous-variable-not-supported-in-confusion-matrix
from sklearn.metrics import confusion_matrix
expected = [1, 1, 0, 1, 0, 0, 1, 0, 0, 0]
predicted = [1, 0, 0, 1, 0, 0, 1, 1, 1, 0]
results = confusion_matrix(expected, predicted)
print(results)
[[4 2]
[1 3]]
https://machinelearningmastery.com/confusion-matrix-machine-learning/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.