I have a lot of .csv files with the following format.
338,800
338,550
339,670
340,600
327,500
301,430
299,350
284,339
284,338
283,335
283,330
283,310
282,310
Using Scikit-Learn
is the best option to go for in your case as it provides a confusion_matrix
function. Here is an approach you can easily extend.
from sklearn.metrics import confusion_matrix
# Read your csv files
with open('A1.csv', 'r') as readFile:
true_values = [int(ff) for ff in readFile]
with open('B1.csv', 'r') as readFile:
predictions = [int(ff) for ff in readFile]
# Produce the confusion matrix
confusionMatrix = confusion_matrix(true_values, predictions)
print(confusionMatrix)
This is the output you would expect.
[[0 2]
[0 2]]
For more hint - check out the following link:
How to write a confusion matrix in Python?