{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example-4 (File)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from pycm import ConfusionMatrix\n", "import numpy as np\n", "import os\n", "if \"Example4_Files\" not in os.listdir():\n", " os.mkdir(\"Example4_Files\")\n", "y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200])\n", "y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200])" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pycm.ConfusionMatrix(classes: [100, 200, 500, 600])" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cm=ConfusionMatrix(y_test, y_pred)\n", "cm" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Predict 100 200 500 600 \n", "Actual\n", "100 0 0 0 0 \n", "\n", "200 9 6 1 0 \n", "\n", "500 1 1 1 0 \n", "\n", "600 1 0 0 0 \n", "\n", "\n", "\n", "\n", "\n", "Overall Statistics : \n", "\n", "95% CI (0.14096,0.55904)\n", "ACC Macro 0.675\n", "AUNP None\n", "AUNU None\n", "Bennett S 0.13333\n", "CBA 0.17708\n", "Chi-Squared None\n", "Chi-Squared DF 9\n", "Conditional Entropy 1.23579\n", "Cramer V None\n", "Cross Entropy 1.70995\n", "F1 Macro 0.23043\n", "F1 Micro 0.35\n", "Gwet AC1 0.19505\n", "Hamming Loss 0.65\n", "Joint Entropy 2.11997\n", "KL Divergence None\n", "Kappa 0.07801\n", "Kappa 95% CI (-0.2185,0.37453)\n", "Kappa No Prevalence -0.3\n", "Kappa Standard Error 0.15128\n", "Kappa Unbiased -0.12554\n", "Lambda A 0.0\n", "Lambda B 0.0\n", "Mutual Information 0.10088\n", "NIR 0.8\n", "Overall ACC 0.35\n", "Overall CEN 0.3648\n", "Overall J (0.60294,0.15074)\n", "Overall MCC 0.12642\n", "Overall MCEN 0.37463\n", "Overall RACC 0.295\n", "Overall RACCU 0.4225\n", "P-Value 1.0\n", "PPV Macro None\n", "PPV Micro 0.35\n", "Pearson C None\n", "Phi-Squared None\n", "RCI 0.11409\n", "RR 5.0\n", "Reference Entropy 0.88418\n", "Response Entropy 1.33667\n", "SOA1(Landis & Koch) Slight\n", "SOA2(Fleiss) Poor\n", "SOA3(Altman) Poor\n", "SOA4(Cicchetti) Poor\n", "SOA5(Cramer) None\n", "SOA6(Matthews) Negligible\n", "Scott PI -0.12554\n", "Standard Error 0.10665\n", "TPR Macro None\n", "TPR Micro 0.35\n", "Zero-one Loss 13\n", "\n", "Class Statistics :\n", "\n", "Classes 100 200 500 600 \n", "ACC(Accuracy) 0.45 0.45 0.85 0.95 \n", "AGF(Adjusted F-score) 0.0 0.33642 0.56659 0.0 \n", "AGM(Adjusted geometric mean) None 0.56694 0.7352 0 \n", "AM(Difference between automatic and manual classification) 11 -9 -1 -1 \n", "AUC(Area under the roc curve) None 0.5625 0.63725 0.5 \n", "AUCI(AUC value interpretation) None Poor Fair Poor \n", "BCD(Bray-Curtis dissimilarity) 0.275 0.225 0.025 0.025 \n", "BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 \n", "CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 \n", "DOR(Diagnostic odds ratio) None 1.8 8.0 None \n", "DP(Discriminant power) None 0.14074 0.4979 None \n", "DPI(Discriminant power interpretation) None Poor Poor None \n", "ERR(Error rate) 0.55 0.55 0.15 0.05 \n", "F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 \n", "F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 \n", "F2(F2 score) 0.0 0.42254 0.35714 0.0 \n", "FDR(False discovery rate) 1.0 0.14286 0.5 None \n", "FN(False negative/miss/type 2 error) 0 10 2 1 \n", "FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 \n", "FOR(False omission rate) 0.0 0.76923 0.11111 0.05 \n", "FP(False positive/type 1 error/false alarm) 11 1 1 0 \n", "FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 \n", "G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None \n", "GI(Gini index) None 0.125 0.27451 0.0 \n", "GM(G-mean geometric mean of specificity and sensitivity) None 0.53033 0.56011 0.0 \n", "IBA(Index of balanced accuracy) None 0.17578 0.12303 0.0 \n", "IS(Information score) None 0.09954 1.73697 None \n", "J(Jaccard index) 0.0 0.35294 0.25 0.0 \n", "LS(Lift score) None 1.07143 3.33333 None \n", "MCC(Matthews correlation coefficient) None 0.10483 0.32673 None \n", "MCCI(Matthews correlation coefficient interpretation) None Negligible Weak None \n", "MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 \n", "MK(Markedness) 0.0 0.08791 0.38889 None \n", "N(Condition negative) 20 4 17 19 \n", "NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 \n", "NLRI(Negative likelihood ratio interpretation) None Negligible Negligible Negligible \n", "NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 \n", "OC(Overlap coefficient) None 0.85714 0.5 None \n", "OOC(Otsuka-Ochiai coefficient) None 0.56695 0.40825 None \n", "OP(Optimized precision) None 0.11667 0.37308 -0.05 \n", "P(Condition positive or support) 0 16 3 1 \n", "PLR(Positive likelihood ratio) None 1.5 5.66667 None \n", "PLRI(Positive likelihood ratio interpretation) None Poor Fair None \n", "POP(Population) 20 20 20 20 \n", "PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None \n", "PRE(Prevalence) 0.0 0.8 0.15 0.05 \n", "Q(Yule Q - coefficient of colligation) None 0.28571 0.77778 None \n", "RACC(Random accuracy) 0.0 0.28 0.015 0.0 \n", "RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 \n", "TN(True negative/correct rejection) 9 3 16 19 \n", "TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 \n", "TON(Test outcome negative) 9 13 18 20 \n", "TOP(Test outcome positive) 11 7 2 0 \n", "TP(True positive/hit) 0 6 1 0 \n", "TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 \n", "Y(Youden index) None 0.125 0.27451 0.0 \n", "dInd(Distance index) None 0.67315 0.66926 1.0 \n", "sInd(Similarity index) None 0.52401 0.52676 0.29289 \n", "\n" ] } ], "source": [ "print(cm)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Save" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Message': 'D:\\\\For Asus Laptop\\\\projects\\\\pycm\\\\Document\\\\Example4_Files\\\\cm.obj',\n", " 'Status': True}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cm.save_obj(os.path.join(\"Example4_Files\",\"cm\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open File" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Message': 'D:\\\\For Asus Laptop\\\\projects\\\\pycm\\\\Document\\\\Example4_Files\\\\cm_stat.obj',\n", " 'Status': True}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cm.save_obj(os.path.join(\"Example4_Files\",\"cm_stat\"),save_stat=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open File" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Message': 'D:\\\\For Asus Laptop\\\\projects\\\\pycm\\\\Document\\\\Example4_Files\\\\cm_no_vectors.obj',\n", " 'Status': True}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cm.save_obj(os.path.join(\"Example4_Files\",\"cm_no_vectors\"),save_vector=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Open File" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pycm.ConfusionMatrix(classes: [100, 200, 500, 600])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cm_load = ConfusionMatrix(file=open(os.path.join(\"Example4_Files\",\"cm.obj\"),\"r\"))\n", "cm" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Predict 100 200 500 600 \n", "Actual\n", "100 0 0 0 0 \n", "\n", "200 9 6 1 0 \n", "\n", "500 1 1 1 0 \n", "\n", "600 1 0 0 0 \n", "\n", "\n", "\n", "\n", "\n", "Overall Statistics : \n", "\n", "95% CI (0.14096,0.55904)\n", "ACC Macro 0.675\n", "AUNP None\n", "AUNU None\n", "Bennett S 0.13333\n", "CBA 0.17708\n", "Chi-Squared None\n", "Chi-Squared DF 9\n", "Conditional Entropy 1.23579\n", "Cramer V None\n", "Cross Entropy 1.70995\n", "F1 Macro 0.23043\n", "F1 Micro 0.35\n", "Gwet AC1 0.19505\n", "Hamming Loss 0.65\n", "Joint Entropy 2.11997\n", "KL Divergence None\n", "Kappa 0.07801\n", "Kappa 95% CI (-0.2185,0.37453)\n", "Kappa No Prevalence -0.3\n", "Kappa Standard Error 0.15128\n", "Kappa Unbiased -0.12554\n", "Lambda A 0.0\n", "Lambda B 0.0\n", "Mutual Information 0.10088\n", "NIR 0.8\n", "Overall ACC 0.35\n", "Overall CEN 0.3648\n", "Overall J (0.60294,0.15074)\n", "Overall MCC 0.12642\n", "Overall MCEN 0.37463\n", "Overall RACC 0.295\n", "Overall RACCU 0.4225\n", "P-Value 1.0\n", "PPV Macro None\n", "PPV Micro 0.35\n", "Pearson C None\n", "Phi-Squared None\n", "RCI 0.11409\n", "RR 5.0\n", "Reference Entropy 0.88418\n", "Response Entropy 1.33667\n", "SOA1(Landis & Koch) Slight\n", "SOA2(Fleiss) Poor\n", "SOA3(Altman) Poor\n", "SOA4(Cicchetti) Poor\n", "SOA5(Cramer) None\n", "SOA6(Matthews) Negligible\n", "Scott PI -0.12554\n", "Standard Error 0.10665\n", "TPR Macro None\n", "TPR Micro 0.35\n", "Zero-one Loss 13\n", "\n", "Class Statistics :\n", "\n", "Classes 100 200 500 600 \n", "ACC(Accuracy) 0.45 0.45 0.85 0.95 \n", "AGF(Adjusted F-score) 0.0 0.33642 0.56659 0.0 \n", "AGM(Adjusted geometric mean) None 0.56694 0.7352 0 \n", "AM(Difference between automatic and manual classification) 11 -9 -1 -1 \n", "AUC(Area under the roc curve) None 0.5625 0.63725 0.5 \n", "AUCI(AUC value interpretation) None Poor Fair Poor \n", "BCD(Bray-Curtis dissimilarity) 0.275 0.225 0.025 0.025 \n", "BM(Informedness or bookmaker informedness) None 0.125 0.27451 0.0 \n", "CEN(Confusion entropy) 0.33496 0.35708 0.53895 0.0 \n", "DOR(Diagnostic odds ratio) None 1.8 8.0 None \n", "DP(Discriminant power) None 0.14074 0.4979 None \n", "DPI(Discriminant power interpretation) None Poor Poor None \n", "ERR(Error rate) 0.55 0.55 0.15 0.05 \n", "F0.5(F0.5 score) 0.0 0.68182 0.45455 0.0 \n", "F1(F1 score - harmonic mean of precision and sensitivity) 0.0 0.52174 0.4 0.0 \n", "F2(F2 score) 0.0 0.42254 0.35714 0.0 \n", "FDR(False discovery rate) 1.0 0.14286 0.5 None \n", "FN(False negative/miss/type 2 error) 0 10 2 1 \n", "FNR(Miss rate or false negative rate) None 0.625 0.66667 1.0 \n", "FOR(False omission rate) 0.0 0.76923 0.11111 0.05 \n", "FP(False positive/type 1 error/false alarm) 11 1 1 0 \n", "FPR(Fall-out or false positive rate) 0.55 0.25 0.05882 0.0 \n", "G(G-measure geometric mean of precision and sensitivity) None 0.56695 0.40825 None \n", "GI(Gini index) None 0.125 0.27451 0.0 \n", "GM(G-mean geometric mean of specificity and sensitivity) None 0.53033 0.56011 0.0 \n", "IBA(Index of balanced accuracy) None 0.17578 0.12303 0.0 \n", "IS(Information score) None 0.09954 1.73697 None \n", "J(Jaccard index) 0.0 0.35294 0.25 0.0 \n", "LS(Lift score) None 1.07143 3.33333 None \n", "MCC(Matthews correlation coefficient) None 0.10483 0.32673 None \n", "MCCI(Matthews correlation coefficient interpretation) None Negligible Weak None \n", "MCEN(Modified confusion entropy) 0.33496 0.37394 0.58028 0.0 \n", "MK(Markedness) 0.0 0.08791 0.38889 None \n", "N(Condition negative) 20 4 17 19 \n", "NLR(Negative likelihood ratio) None 0.83333 0.70833 1.0 \n", "NLRI(Negative likelihood ratio interpretation) None Negligible Negligible Negligible \n", "NPV(Negative predictive value) 1.0 0.23077 0.88889 0.95 \n", "OC(Overlap coefficient) None 0.85714 0.5 None \n", "OOC(Otsuka-Ochiai coefficient) None 0.56695 0.40825 None \n", "OP(Optimized precision) None 0.11667 0.37308 -0.05 \n", "P(Condition positive or support) 0 16 3 1 \n", "PLR(Positive likelihood ratio) None 1.5 5.66667 None \n", "PLRI(Positive likelihood ratio interpretation) None Poor Fair None \n", "POP(Population) 20 20 20 20 \n", "PPV(Precision or positive predictive value) 0.0 0.85714 0.5 None \n", "PRE(Prevalence) 0.0 0.8 0.15 0.05 \n", "Q(Yule Q - coefficient of colligation) None 0.28571 0.77778 None \n", "RACC(Random accuracy) 0.0 0.28 0.015 0.0 \n", "RACCU(Random accuracy unbiased) 0.07563 0.33062 0.01562 0.00063 \n", "TN(True negative/correct rejection) 9 3 16 19 \n", "TNR(Specificity or true negative rate) 0.45 0.75 0.94118 1.0 \n", "TON(Test outcome negative) 9 13 18 20 \n", "TOP(Test outcome positive) 11 7 2 0 \n", "TP(True positive/hit) 0 6 1 0 \n", "TPR(Sensitivity, recall, hit rate, or true positive rate) None 0.375 0.33333 0.0 \n", "Y(Youden index) None 0.125 0.27451 0.0 \n", "dInd(Distance index) None 0.67315 0.66926 1.0 \n", "sInd(Similarity index) None 0.52401 0.52676 0.29289 \n", "\n" ] } ], "source": [ "print(cm)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Obj File" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\"Actual-Vector\": [600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200], \"Digit\": 5, \"Transpose\": false, \"Predict-Vector\": [100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200], \"Matrix\": [[100, [[200, 0], [500, 0], [100, 0], [600, 0]]], [200, [[200, 6], [500, 1], [100, 9], [600, 0]]], [500, [[200, 1], [500, 1], [100, 1], [600, 0]]], [600, [[200, 0], [500, 0], [100, 1], [600, 0]]]], \"Sample-Weight\": null}\n" ] } ], "source": [ "print(open(os.path.join(\"Example4_Files\",\"cm.obj\"),\"r\").read())" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\"Actual-Vector\": [600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200], \"Digit\": 5, \"Transpose\": false, \"Predict-Vector\": [100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200], \"Class-Stat\": {\"OC\": {\"200\": 0.8571428571428571, \"500\": 0.5, \"100\": \"None\", \"600\": \"None\"}, \"dInd\": {\"200\": 0.673145600891813, \"500\": 0.6692567908186672, \"100\": \"None\", \"600\": 1.0}, \"NLR\": {\"200\": 0.8333333333333334, \"500\": 0.7083333333333334, \"100\": \"None\", \"600\": 1.0}, \"MCC\": {\"200\": 0.10482848367219183, \"500\": 0.32673201960653564, \"100\": \"None\", \"600\": \"None\"}, \"RACCU\": {\"200\": 0.33062499999999995, \"500\": 0.015625, \"100\": 0.07562500000000001, \"600\": 0.0006250000000000001}, \"IS\": {\"200\": 0.09953567355091428, \"500\": 1.736965594166206, \"100\": \"None\", \"600\": \"None\"}, \"MK\": {\"200\": 0.08791208791208782, \"500\": 0.38888888888888884, \"100\": 0.0, \"600\": \"None\"}, \"ACC\": {\"200\": 0.45, \"500\": 0.85, \"100\": 0.45, \"600\": 0.95}, \"FOR\": {\"200\": 0.7692307692307692, \"500\": 0.11111111111111116, \"100\": 0.0, \"600\": 0.050000000000000044}, \"FDR\": {\"200\": 0.1428571428571429, \"500\": 0.5, \"100\": 1.0, \"600\": \"None\"}, \"Y\": {\"200\": 0.125, \"500\": 0.27450980392156854, \"100\": \"None\", \"600\": 0.0}, \"PLRI\": {\"200\": \"Poor\", \"500\": \"Fair\", \"100\": \"None\", \"600\": \"None\"}, \"G\": {\"200\": 0.5669467095138409, \"500\": 0.408248290463863, \"100\": \"None\", \"600\": \"None\"}, \"TOP\": {\"200\": 7, \"500\": 2, \"100\": 11, \"600\": 0}, \"TON\": {\"200\": 13, \"500\": 18, \"100\": 9, \"600\": 20}, \"FNR\": {\"200\": 0.625, \"500\": 0.6666666666666667, \"100\": \"None\", \"600\": 1.0}, \"F0.5\": {\"200\": 0.6818181818181818, \"500\": 0.45454545454545453, \"100\": 0.0, \"600\": 0.0}, \"DOR\": {\"200\": 1.7999999999999998, \"500\": 7.999999999999997, \"100\": \"None\", \"600\": \"None\"}, \"sInd\": {\"200\": 0.5240141808835057, \"500\": 0.5267639848569737, \"100\": \"None\", \"600\": 0.29289321881345254}, \"RACC\": {\"200\": 0.28, \"500\": 0.015, \"100\": 0.0, \"600\": 0.0}, \"DPI\": {\"200\": \"Poor\", \"500\": \"Poor\", \"100\": \"None\", \"600\": \"None\"}, \"NLRI\": {\"200\": \"Negligible\", \"500\": \"Negligible\", \"100\": \"None\", \"600\": \"Negligible\"}, \"FP\": {\"200\": 1, \"100\": 11, \"500\": 1, \"600\": 0}, \"TP\": {\"200\": 6, \"100\": 0, \"500\": 1, \"600\": 0}, \"MCEN\": {\"200\": 0.3739448088748241, \"500\": 0.5802792108518123, \"100\": 0.3349590631259315, \"600\": 0.0}, \"GI\": {\"200\": 0.125, \"500\": 0.27450980392156854, \"100\": \"None\", \"600\": 0.0}, \"AGM\": {\"200\": 0.5669417382415922, \"500\": 0.7351956938438939, \"100\": \"None\", \"600\": 0}, \"ERR\": {\"200\": 0.55, \"500\": 0.15000000000000002, \"100\": 0.55, \"600\": 0.050000000000000044}, \"OOC\": {\"200\": 0.5669467095138409, \"500\": 0.4082482904638631, \"100\": \"None\", \"600\": \"None\"}, \"PRE\": {\"200\": 0.8, \"500\": 0.15, \"100\": 0.0, \"600\": 0.05}, \"AGF\": {\"200\": 0.33642097801219245, \"500\": 0.5665926996700735, \"100\": 0.0, \"600\": 0.0}, \"J\": {\"200\": 0.35294117647058826, \"500\": 0.25, \"100\": 0.0, \"600\": 0.0}, \"PPV\": {\"200\": 0.8571428571428571, \"500\": 0.5, \"100\": 0.0, \"600\": \"None\"}, \"DP\": {\"200\": 0.1407391082701595, \"500\": 0.49789960499474867, \"100\": \"None\", \"600\": \"None\"}, \"FPR\": {\"200\": 0.25, \"500\": 0.05882352941176472, \"100\": 0.55, \"600\": 0.0}, \"MCCI\": {\"200\": \"Negligible\", \"500\": \"Weak\", \"100\": \"None\", \"600\": \"None\"}, \"AUCI\": {\"200\": \"Poor\", \"500\": \"Fair\", \"100\": \"None\", \"600\": \"Poor\"}, \"IBA\": {\"200\": 0.17578125, \"500\": 0.1230296039984621, \"100\": \"None\", \"600\": 0.0}, \"PLR\": {\"200\": 1.5, \"500\": 5.666666666666665, \"100\": \"None\", \"600\": \"None\"}, \"AUC\": {\"200\": 0.5625, \"500\": 0.6372549019607843, \"100\": \"None\", \"600\": 0.5}, \"TPR\": {\"200\": 0.375, \"500\": 0.3333333333333333, \"100\": \"None\", \"600\": 0.0}, \"LS\": {\"200\": 1.0714285714285714, \"500\": 3.3333333333333335, \"100\": \"None\", \"600\": \"None\"}, \"BM\": {\"200\": 0.125, \"500\": 0.27450980392156854, \"100\": \"None\", \"600\": 0.0}, \"AM\": {\"200\": -9, \"500\": -1, \"100\": 11, \"600\": -1}, \"POP\": {\"200\": 20, \"500\": 20, \"100\": 20, \"600\": 20}, \"P\": {\"200\": 16, \"500\": 3, \"100\": 0, \"600\": 1}, \"BCD\": {\"200\": 0.225, \"500\": 0.025, \"100\": 0.275, \"600\": 0.025}, \"Q\": {\"200\": 0.28571428571428575, \"500\": 0.7777777777777778, \"100\": \"None\", \"600\": \"None\"}, \"TNR\": {\"200\": 0.75, \"500\": 0.9411764705882353, \"100\": 0.45, \"600\": 1.0}, \"N\": {\"200\": 4, \"500\": 17, \"100\": 20, \"600\": 19}, \"F2\": {\"200\": 0.4225352112676056, \"500\": 0.35714285714285715, \"100\": 0.0, \"600\": 0.0}, \"NPV\": {\"200\": 0.23076923076923078, \"500\": 0.8888888888888888, \"100\": 1.0, \"600\": 0.95}, \"GM\": {\"200\": 0.5303300858899106, \"500\": 0.5601120336112039, \"100\": \"None\", \"600\": 0.0}, \"TN\": {\"200\": 3, \"100\": 9, \"500\": 16, \"600\": 19}, \"OP\": {\"200\": 0.1166666666666667, \"500\": 0.373076923076923, \"100\": \"None\", \"600\": -0.050000000000000044}, \"F1\": {\"200\": 0.5217391304347826, \"500\": 0.4, \"100\": 0.0, \"600\": 0.0}, \"CEN\": {\"200\": 0.3570795472009597, \"500\": 0.5389466410223563, \"100\": 0.3349590631259315, \"600\": 0.0}, \"FN\": {\"200\": 10, \"100\": 0, \"500\": 2, \"600\": 1}}, \"Matrix\": [[100, [[200, 0], [500, 0], [100, 0], [600, 0]]], [200, [[200, 6], [500, 1], [100, 9], [600, 0]]], [500, [[200, 1], [500, 1], [100, 1], [600, 0]]], [600, [[200, 0], [500, 0], [100, 1], [600, 0]]]], \"Sample-Weight\": null, \"Overall-Stat\": {\"NIR\": 0.8, \"Gwet AC1\": 0.19504643962848295, \"Phi-Squared\": \"None\", \"SOA1(Landis & Koch)\": \"Slight\", \"AUNU\": \"None\", \"Zero-one Loss\": 13, \"Kappa No Prevalence\": -0.30000000000000004, \"Kappa Standard Error\": 0.15128176601206766, \"Cramer V\": \"None\", \"SOA6(Matthews)\": \"Negligible\", \"Mutual Information\": 0.10087710767390168, \"PPV Macro\": \"None\", \"Overall ACC\": 0.35, \"AUNP\": \"None\", \"Overall RACC\": 0.29500000000000004, \"Chi-Squared\": \"None\", \"TPR Micro\": 0.35, \"Bennett S\": 0.1333333333333333, \"Standard Error\": 0.1066536450385077, \"Kappa\": 0.07801418439716304, \"ACC Macro\": 0.675, \"Conditional Entropy\": 1.235789374242786, \"CBA\": 0.17708333333333331, \"Kappa Unbiased\": -0.12554112554112543, \"SOA5(Cramer)\": \"None\", \"Overall J\": [0.6029411764705883, 0.15073529411764708], \"RR\": 5.0, \"Overall MCEN\": 0.3746281299595305, \"Overall MCC\": 0.1264200803632855, \"PPV Micro\": 0.35, \"Cross Entropy\": 1.709947752496911, \"Overall CEN\": 0.3648028121279775, \"P-Value\": 0.9999981549942787, \"Pearson C\": \"None\", \"KL Divergence\": \"None\", \"Hamming Loss\": 0.65, \"Kappa 95% CI\": [-0.21849807698648957, 0.3745264457808156], \"Lambda A\": 0.0, \"SOA3(Altman)\": \"Poor\", \"95% CI\": [0.14095885572452488, 0.559041144275475], \"Lambda B\": 0.0, \"SOA4(Cicchetti)\": \"Poor\", \"SOA2(Fleiss)\": \"Poor\", \"TPR Macro\": \"None\", \"Response Entropy\": 1.3366664819166876, \"F1 Macro\": 0.23043478260869565, \"RCI\": 0.11409066398451011, \"Joint Entropy\": 2.119973094021975, \"F1 Micro\": 0.35, \"Chi-Squared DF\": 9, \"Reference Entropy\": 0.8841837197791889, \"Overall RACCU\": 0.42249999999999993, \"Scott PI\": -0.12554112554112543}}\n" ] } ], "source": [ "print(open(os.path.join(\"Example4_Files\",\"cm_stat.obj\"),\"r\").read())" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\"Actual-Vector\": null, \"Digit\": 5, \"Transpose\": false, \"Predict-Vector\": null, \"Matrix\": [[100, [[200, 0], [500, 0], [100, 0], [600, 0]]], [200, [[200, 6], [500, 1], [100, 9], [600, 0]]], [500, [[200, 1], [500, 1], [100, 1], [600, 0]]], [600, [[200, 0], [500, 0], [100, 1], [600, 0]]]], \"Sample-Weight\": null}\n" ] } ], "source": [ "print(open(os.path.join(\"Example4_Files\",\"cm_no_vectors.obj\"),\"r\").read())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }