add confusion matrix tutorial to AI4Forensics

This commit is contained in:
Frank Xu
2023-10-12 22:23:51 -04:00
parent 580bb6cd0d
commit ebf660bb08
2 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[4, 2],\n",
" [2, 2]], dtype=int64)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.metrics import confusion_matrix\n",
"\n",
"actual = [0,0,1,1,0,0,0,0,0,1]\n",
"predicted = [0,1,1,0,0,1,10,0,1]\n",
"\n",
"confusion_matrix(actual, predicted)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "forensic",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}