Package: pycm
PyCM: Python Confusion MatrixTable of contentsOverviewInstallationUsageDocumentTry PyCM in Your BrowserIssues & Bug ReportsTodoContributionAcknowledgmentsCiteAuthorsLicenseShow Your SupportChangelogCode of ConductOverviewPyCM is a multi-class confusion matrix library written in Python that supports both input data vectors and direct matrix, and a proper tool for post-classification model evaluation that supports most classes and overall statistics parameters.
PyCM is the swiss-army knife of confusion matrices, targeted mainly at data scientists that need a broad array of metrics for predictive models and accurate evaluation of a large variety of classifiers.Fig1. ConfusionMatrix Block DiagramOpen HubPyPI CounterGithub StarsBranchmasterdevCICode QualityInstallation⚠️  PyCM 3.9 is the last version to supportPython 3.5⚠️  PyCM 2.4 is the last version to supportPython 2.7&Python 3.4⚠️  Plotting capability requiresMatplotlib (>= 3.0.0)orSeaborn (>= 0.9.1)Source codeDownloadVersion 4.0orLatest SourceRunpip install -r requirements.txtorpip3 install -r requirements.txt(Need root access)Runpython3 setup.py installorpython setup.py install(Need root access)PyPICheckPython Packaging User GuideRunpip install pycm==4.0orpip3 install pycm==4.0(Need root access)CondaCheckConda Managing PackageUpdate Conda usingconda update conda(Need root access)Runconda install -c sepandhaghighi pycm(Need root access)Easy installRuneasy_install --upgrade pycm(Need root access)MATLABDownload and installMATLAB(>=8.5, 64/32 bit)Download and installPython3.x(>=3.6, 64/32 bit)SelectAdd to PATHoptionSelectInstall pipoptionRunpip install pycmorpip3 install pycm(Need root access)Configure Python interpreter>>pyversionPYTHON_EXECUTABLE_FULL_PATHVisitMATLAB ExamplesUsageFrom vector>>>frompycmimport*>>>y_actu=[2,0,2,2,0,1,1,2,2,0,1,2]>>>y_pred=[0,0,2,1,0,2,1,0,2,0,2,2]>>>cm=ConfusionMatrix(actual_vector=y_actu,predict_vector=y_pred)>>>cm.classes[0, 1, 2]>>>cm.table{0: {0: 3, 1: 0, 2: 0}, 1: {0: 0, 1: 1, 2: 2}, 2: {0: 2, 1: 1, 2: 3}}>>>cm.print_matrix()Predict 0       1       2Actual0       3       0       01       0       1       22       2       1       3>>>cm.print_normalized_matrix()Predict       0             1             2Actual0             1.0           0.0           0.01             0.0           0.33333       0.666672             0.33333       0.16667       0.5>>>cm.stat(summary=True)Overall Statistics :ACC Macro                                                         0.72222F1 Macro                                                          0.56515FPR Macro                                                         0.22222Kappa                                                             0.35484Overall ACC                                                       0.58333PPV Macro                                                         0.56667SOA1(Landis & Koch)                                               FairTPR Macro                                                         0.61111Zero-one Loss                                                     5Class Statistics :Classes                                                           0             1             2ACC(Accuracy)                                                     0.83333       0.75          0.58333AUC(Area under the ROC curve)                                     0.88889       0.61111       0.58333AUCI(AUC value interpretation)                                    Very Good     Fair          PoorF1(F1 score - harmonic mean of precision and sensitivity)         0.75          0.4           0.54545FN(False negative/miss/type 2 error)                              0             2             3FP(False positive/type 1 error/false alarm)                       2             1             2FPR(Fall-out or false positive rate)                              0.22222       0.11111       0.33333N(Condition negative)                                             9             9             6P(Condition positive or support)                                  3             3             6POP(Population)                                                   12            12            12PPV(Precision or positive predictive value)                       0.6           0.5           0.6TN(True negative/correct rejection)                               7             8             4TON(Test outcome negative)                                        7             10            7TOP(Test outcome positive)                                        5             2             5TP(True positive/hit)                                             3             1             3TPR(Sensitivity, recall, hit rate, or true positive rate)         1.0           0.33333       0.5Direct CM>>>frompycmimport*>>>cm2=ConfusionMatrix(matrix={"Class1":{"Class1":1,"Class2":2},"Class2":{"Class1":0,"Class2":5}})>>>cm2pycm.ConfusionMatrix(classes: ['Class1', 'Class2'])>>>cm2.classes['Class1', 'Class2']>>>cm2.print_matrix()Predict      Class1       Class2ActualClass1       1            2Class2       0            5>>>cm2.print_normalized_matrix()Predict       Class1        Class2ActualClass1        0.33333       0.66667Class2        0.0           1.0>>>cm2.stat(summary=True)Overall Statistics :ACC Macro                                                         0.75F1 Macro                                                          0.66667FPR Macro                                                         0.33333Kappa                                                             0.38462Overall ACC                                                       0.75PPV Macro                                                         0.85714SOA1(Landis & Koch)                                               FairTPR Macro                                                         0.66667Zero-one Loss                                                     2Class Statistics :Classes                                                           Class1        Class2ACC(Accuracy)                                                     0.75          0.75AUC(Area under the ROC curve)                                     0.66667       0.66667AUCI(AUC value interpretation)                                    Fair          FairF1(F1 score - harmonic mean of precision and sensitivity)         0.5           0.83333FN(False negative/miss/type 2 error)                              2             0FP(False positive/type 1 error/false alarm)                       0             2FPR(Fall-out or false positive rate)                              0.0           0.66667N(Condition negative)                                             5             3P(Condition positive or support)                                  3             5POP(Population)                                                   8             8PPV(Precision or positive predictive value)                       1.0           0.71429TN(True negative/correct rejection)                               5             1TON(Test outcome negative)                                        7             1TOP(Test outcome positive)                                        1             7TP(True positive/hit)                                             1             5TPR(Sensitivity, recall, hit rate, or true positive rate)         0.33333       1.0matrix()andnormalized_matrix()renamed toprint_matrix()andprint_normalized_matrix()inversion 1.5Activation thresholdthresholdis added inversion 0.9for real value prediction.
For more information visitExample3Load from filefileis added inversion 0.9.5in order to load saved confusion matrix with.objformat generated bysave_objmethod.For more information visitExample4Sample weightssample_weightis added inversion 1.2For more information visitExample5Transposetransposeis added inversion 1.2in order to transpose input matrix (only inDirect CMmode)Relabelrelabelmethod is added inversion 1.5in order to change ConfusionMatrix classnames.>>>cm.relabel(mapping={0:"L1",1:"L2",2:"L3"})>>>cmpycm.ConfusionMatrix(classes: ['L1', 'L2', 'L3'])Positionpositionmethod is added inversion 2.8in order to find the indexes of observations inpredict_vectorwhich made TP, TN, FP, FN.>>>cm.position(){0: {'FN': [], 'FP': [0, 7], 'TP': [1, 4, 9], 'TN': [2, 3, 5, 6, 8, 10, 11]}, 1: {'FN': [5, 10], 'FP': [3], 'TP': [6], 'TN': [0, 1, 2, 4, 7, 8, 9, 11]}, 2: {'FN': [0, 3, 7], 'FP': [5, 10], 'TP': [2, 8, 11], 'TN': [1, 4, 6, 9]}}To arrayto_arraymethod is added inversion 2.9in order to returns the confusion matrix in the form of a NumPy array. This can be helpful to apply different operations over the confusion matrix for different purposes such as aggregation, normalization, and combination.>>>cm.to_array()array([[3, 0, 0],[0, 1, 2],[2, 1, 3]])>>>cm.to_array(normalized=True)array([[1.     , 0.     , 0.     ],[0.     , 0.33333, 0.66667],[0.33333, 0.16667, 0.5    ]])>>>cm.to_array(normalized=True,one_vs_all=True,class_name="L1")array([[1.     , 0.     ],[0.22222, 0.77778]])Combinecombinemethod is added inversion 3.0in order to merge two confusion matrices. This option will be useful in mini-batch learning.>>>cm_combined=cm2.combine(cm3)>>>cm_combined.print_matrix()Predict      Class1       Class2ActualClass1       2            4Class2       0            10Plotplotmethod is added inversion 3.0in order to plot a confusion matrix using Matplotlib or Seaborn.>>>cm.plot()>>>frommatplotlibimportpyplotasplt>>>cm.plot(cmap=plt.cm.Greens,number_label=True,plot_lib="matplotlib")>>>cm.plot(cmap=plt.cm.Reds,normalized=True,number_label=True,plot_lib="seaborn")ROC curveROCCurve, added inversion 3.7, is devised to compute the Receiver Operating Characteristic (ROC) or simply ROC curve. In ROC curves, the Y axis represents the True Positive Rate, and the X axis represents the False Positive Rate. Thus, the ideal point is located at the top left of the curve, and a larger area under the curve represents better performance. ROC curve is a graphical representation of binary classifiers' performance. In PyCM,ROCCurvebinarizes the output based on the "One vs. Rest" strategy to provide an extension of ROC for multi-class classifiers. Getting the actual labels vector, the target probability estimates of the positive classes, and the list of ordered labels of classes, this method is able to compute and plot TPR-FPR pairs for different discrimination thresholds and compute the area under the ROC curve.>>>crv=ROCCurve(actual_vector=np.array([1,1,2,2]),probs=np.array([[0.1,0.9],[0.4,0.6],[0.35,0.65],[0.8,0.2]]),classes=[2,1])>>>crv.thresholds[0.1, 0.2, 0.35, 0.4, 0.6, 0.65, 0.8, 0.9]>>>auc_trp=crv.area()>>>auc_trp[1]0.75>>>auc_trp[2]0.75Precision-Recall curvePRCurve, added inversion 3.7, is devised to compute the Precision-Recall curve in which the Y axis represents the Precision, and the X axis represents the Recall of a classifier. Thus, the ideal point is located at the top right of the curve, and a larger area under the curve represents better performance. Precision-Recall curve is a graphical representation of binary classifiers' performance. In PyCM,PRCurvebinarizes the output based on the "One vs. Rest" strategy to provide an extension of this curve for multi-class classifiers. Getting the actual labels vector, the target probability estimates of the positive classes, and the list of ordered labels of classes, this method is able to compute and plot Precision-Recall pairs for different discrimination thresholds and compute the area under the curve.>>>crv=PRCurve(actual_vector=np.array([1,1,2,2]),probs=np.array([[0.1,0.9],[0.4,0.6],[0.35,0.65],[0.8,0.2]]),classes=[2,1])>>>crv.thresholds[0.1, 0.2, 0.35, 0.4, 0.6, 0.65, 0.8, 0.9]>>>auc_trp=crv.area()>>>auc_trp[1]0.29166666666666663>>>auc_trp[2]0.29166666666666663Parameter recommenderThis option has been added inversion 1.9to recommend the most related parameters considering the characteristics of the input dataset.
The suggested parameters are selected according to some characteristics of the input such as being balance/imbalance and binary/multi-class.
All suggestions can be categorized into three main groups: imbalanced dataset, binary classification for a balanced dataset, and multi-class classification for a balanced dataset.
The recommendation lists have been gathered according to the respective paper of each parameter and the capabilities which had been claimed by the paper.>>>cm.imbalanceFalse>>>cm.binaryFalse>>>cm.recommended_list['MCC', 'TPR Micro', 'ACC', 'PPV Macro', 'BCD', 'Overall MCC', 'Hamming Loss', 'TPR Macro', 'Zero-one Loss', 'ERR', 'PPV Micro', 'Overall ACC']is_imbalancedparameter has been added inversion 3.3, so the user can indicate whether the concerned dataset is imbalanced or not. As long as the user does not provide any information in this regard, the automatic detection algorithm will be used.>>>cm=ConfusionMatrix(y_actu,y_pred,is_imbalanced=True)>>>cm.imbalanceTrue>>>cm=ConfusionMatrix(y_actu,y_pred,is_imbalanced=False)>>>cm.imbalanceFalseCompareInversion 2.0, a method for comparing several confusion matrices is introduced. This option is a combination of several overall and class-based benchmarks. Each of the benchmarks evaluates the performance of the classification algorithm from good to poor and give them a numeric score. The score of good and poor performances are 1 and 0, respectively.After that, two scores are calculated for each confusion matrices, overall and class-based. The overall score is the average of the score of seven overall benchmarks which are Landis & Koch, Cramer, Matthews, Goodman-Kruskal's Lambda A, Goodman-Kruskal's Lambda B, Krippendorff's Alpha, and Pearson's C. In the same manner, the class-based score is the average of the score of six class-based benchmarks which are Positive Likelihood Ratio Interpretation, Negative Likelihood Ratio Interpretation, Discriminant Power Interpretation, AUC value Interpretation, Matthews Correlation Coefficient Interpretation and Yule's Q Interpretation. It should be noticed that if one of the benchmarks returns none for one of the classes, that benchmarks will be eliminated in total averaging. If the user sets weights for the classes, the averaging over the value of class-based benchmark scores will transform to a weighted average.If the user sets the value ofby_classboolean inputTrue, the best confusion matrix is the one with the maximum class-based score. Otherwise, if a confusion matrix obtains the maximum of both overall and class-based scores, that will be reported as the best confusion matrix, but in any other case, the compared object doesn’t select the best confusion matrix.>>>cm2=ConfusionMatrix(matrix={0:{0:2,1:50,2:6},1:{0:5,1:50,2:3},2:{0:1,1:7,2:50}})>>>cm3=ConfusionMatrix(matrix={0:{0:50,1:2,2:6},1:{0:50,1:5,2:3},2:{0:1,1:55,2:2}})>>>cp=Compare({"cm2":cm2,"cm3":cm3})>>>print(cp)Best : cm2Rank  Name   Class-Score       Overall-Score1     cm2    0.50278           0.580952     cm3    0.33611           0.52857>>>cp.bestpycm.ConfusionMatrix(classes: [0, 1, 2])>>>cp.sorted['cm2', 'cm3']>>>cp.best_name'cm2'Multilabel confusion matrixFromversion 4.0,MultiLabelCMhas been added to calculate class-wise or sample-wise multilabel confusion matrices. In class-wise mode, confusion matrices are calculated for each class, and in sample-wise mode, they are generated per sample. All generated confusion matrices are binarized with a one-vs-rest transformation.>>>mlcm=MultiLabelCM(actual_vector=[{"cat","bird"},{"dog"}],predict_vector=[{"cat"},{"dog","bird"}],classes=["cat","dog","bird"])>>>mlcm.actual_vector_multihot[[1, 0, 1], [0, 1, 0]]>>>mlcm.predict_vector_multihot[[1, 0, 0], [0, 1, 1]]>>>mlcm.get_cm_by_class("cat").print_matrix()Predict 0       1Actual0       1       01       0       1>>>mlcm.get_cm_by_sample(0).print_matrix()Predict 0       1Actual0       1       01       1       1Online helponline_helpfunction is added inversion 1.1in order to open each statistics definition in web browser>>>frompycmimportonline_help>>>online_help("J")>>>online_help("SOA1(Landis & Koch)")>>>online_help(2)List of items are available by callingonline_help()(without argument)If PyCM website is not available, setalt_link = True(new inversion 2.4)Screen recordTry PyCM in your browser!PyCM can be used online in interactive Jupyter Notebooks via the Binder or Colab services! Try it out now! :CheckExamplesinDocumentfolderIssues & bug reportsFill an issue and describe it. We'll check it ASAP!Please complete the issue templateDiscord :https://discord.com/invite/zqpU2b3J3fWebsite :https://www.pycm.ioMailing List :https://mail.python.org/mailman3/lists/pycm.python.org/Email :info@pycm.ioAcknowledgmentsNLnet foundationhas supported the PyCM project from version3.6to4.0through theNGI AssureFund. This fund is set up byNLnet foundationwith funding from the European Commission'sNext Generation Internet program, administered by DG Communications Networks, Content, and Technology under grant agreementNo 957073.Python Software Foundation (PSF)grants PyCM library partially for version3.7.PSFis the organization behind Python. Their mission is to promote, protect, and advance the Python programming language and to support and facilitate the growth of a diverse and international community of Python programmers.CiteIf you use PyCM in your research, we would appreciate citations to the following paper :Haghighi, S., Jasemi, M., Hessabi, S. and Zolanvari, A. (2018). PyCM: Multiclass confusion matrix library in Python. Journal of Open Source Software, 3(25), p.729.@article{Haghighi2018,
  doi = {10.21105/joss.00729},
  url = {https://doi.org/10.21105/joss.00729},
  year  = {2018},
  month = {may},
  publisher = {The Open Journal},
  volume = {3},
  number = {25},
  pages = {729},
  author = {Sepand Haghighi and Masoomeh Jasemi and Shaahin Hessabi and Alireza Zolanvari},
  title = {{PyCM}: Multiclass confusion matrix library in Python},
  journal = {Journal of Open Source Software}
}DownloadPyCM.bibJOSSZenodoResearchgateShow your supportStar this repoGive a ⭐️ if this project helped you!Donate to our projectIf you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelogand this project adheres toSemantic Versioning.Unreleased4.0- 2023-06-07AddedpycmMultiLabelErrorclassMultiLabelCMclassget_cm_by_classmethodget_cm_by_samplemethod__mlcm_vector_handler__function__mlcm_assign_classes__function__mlcm_vectors_filter__function__set_to_multihot__functiondeprecatedfunctionChangedDocument modifiedREADME.mdmodifiedExample-4 modifiedTest system modifiedPython 3.5 support dropped3.9- 2023-05-01AddedOVERALL_PARAMSdictionary__imbalancement_handler__functionvector_serializerfunctionNPV micro/macrolog_lossmethod23 new distance/similarityDennisDigbyDispersionDoolittleEyraudFager & McGowanFaithFleiss-Levin-PaikForbes IForbes IIFossumGilbert & WellsGoodallGoodman & Kruskal's LambdaGoodman & Kruskal Lambda-rGuttman's Lambda AGuttman's Lambda BHamannHarris & LaheyHawkins & DotsonKendall's TauKent & Foster IKent & Foster IIChangedmetrics_offparameter added to ConfusionMatrix__init__methodCLASS_PARAMSchanged to a dictionaryCode style modifiedsortparameter added torelabelmethodDocument modifiedCONTRIBUTING.mdupdatedcodecovremoved fromdev-requirements.txtTest system modified3.8- 2023-02-01Addeddistancemethod__contains__method__getitem__methodGoodman-Kruskal's Lambda A benchmarkGoodman-Kruskal's Lambda B benchmarkKrippendorff's Alpha benchmarkPearson's C benchmark30 new distance/similarityAMPLEAnderberg's DAndres & Marzo's DeltaBaroni-Urbani & Buser IBaroni-Urbani & Buser IIBatagelj & BrenBaulieu IBaulieu IIBaulieu IIIBaulieu IVBaulieu VBaulieu VIBaulieu VIIBaulieu VIIIBaulieu IXBaulieu XBaulieu XIBaulieu XIIBaulieu XIIIBaulieu XIVBaulieu XVBenini IBenini IICanberraClementConsonni & Todeschini IConsonni & Todeschini IIConsonni & Todeschini IIIConsonni & Todeschini IVConsonni & Todeschini VChangedrelabelmethod sort bug fixedREADME.mdmodifiedCompareoverall benchmarks default weights updatedDocument modifiedTest system modified3.7- 2022-12-15AddedCurveclassROCCurveclassPRCurveclasspycmCurveErrorclassChangedCONTRIBUTING.mdupdatedmatrix_params_calcfunction optimizedREADME.mdmodifiedDocument modifiedTest system modifiedPython 3.11added totest.yml3.6- 2022-08-17AddedHamming distanceBraun-Blanquet similarityChangedclassesparameter added tomatrix_params_from_tablefunctionMatrices withnumpy.integerelements are now acceptedArrays added tomatrixparameter accepting formatsWebsite changed tohttp://www.pycm.ioDocument modifiedREADME.mdmodified3.5- 2022-04-27AddedAnaconda workflowCustom iterating settingCustom casting settingChangedplotmethod updatedclass_statisticsfunction modifiedoverall_statisticsfunction modifiedBCD_calcfunction modifiedCONTRIBUTING.mdupdatedCODE_OF_CONDUCT.mdupdatedDocument modified3.4- 2022-01-26AddedColab badgeDiscord badgebrier_scoremethodChangedJ (Jaccard index)section inDocument.ipynbupdatedsave_objmethod updatedPython 3.10added totest.ymlExample-3 updatedDocstrings of the functions updatedCONTRIBUTING.mdupdated3.3- 2021-10-27Added__compare_weight_handler__functionChangedis_imbalancedparameter added to ConfusionMatrix__init__methodclass_benchmark_weightandoverall_benchmark_weightparameters added to Compare__init__methodstatistic_recommendfunction modifiedCompareweightparameter renamed toclass_weightDocument modifiedLicense updatedAUTHORS.mdupdatedREADME.mdmodifiedBlock diagrams updated3.2- 2021-08-11Addedclasses_filterfunctionChangedclassesparameter added tomatrix_params_calcfunctionclassesparameter added to__obj_vector_handler__functionclassesparameter added to ConfusionMatrix__init__methodnameparameter removed fromhtml_initfunctionshortenerparameter added tohtml_tablefunctionshortenerparameter added tosave_htmlmethodDocument modifiedHTML report modified3.1- 2021-03-11Addedrequirements-splitter.pysensitivity_indexmethodChangedTest system modifiedoverall_statisticsfunction modifiedHTML report modifiedDocument modifiedReferences format updatedCONTRIBUTING.mdupdated3.0- 2020-10-26Addedplot_test.pyaxes_genfunctionadd_number_labelfunctionplotmethodcombinemethodmatrix_combinefunctionChangedDocument modifiedREADME.mdmodifiedExample-2 deprecatedExample-7 deprecatedError messages modified2.9- 2020-09-23Addednotebook_check.pyto_arraymethod__copy__methodcopymethodChangedaveragemethod refactored2.8- 2020-07-09Addedlabel_mapattributepositionsattributepositionmethodKrippendorff's AlphaAickin's Alphaweighted_alphamethodChangedSingle class bug fixedCLASS_NUMBER_ERRORerror type changed topycmMatrixErrorrelabelmethod bug fixedDocument modifiedREADME.mdmodified2.7- 2020-05-11Addedaveragemethodweighted_averagemethodweighted_kappamethodpycmAverageErrorclassBangdiwala's BMATLAB examplesGithub actionChangedDocument modifiedREADME.mdmodifiedrelabelmethod bug fixedsparse_table_printfunction bug fixedmatrix_checkfunction bug fixedMinor bug inCompareclass fixedClass names mismatch bug fixed2.6- 2020-03-25Addedcustom_rounderfunctioncomplementfunctionsparse_matrixattributesparse_normalized_matrixattributeNet benefit (NB)Yule's Q interpretation (QI)Adjusted Rand index (ARI)TNR micro/macroFPR micro/macroFNR micro/macroChangedsparseparameter added toprint_matrix,print_normalized_matrixandsave_statmethodsheaderparameter added tosave_csvmethodHandler functions moved topycm_handler.pyError objects moved topycm_error.pyVerified tests references updatedVerified tests moved toverified_test.pyTest system modifiedCONTRIBUTING.mdupdatedNamespace optimizedREADME.mdmodifiedDocument modifiedprint_normalized_matrixmethod modifiednormalized_table_calcfunction modifiedsetup.pymodifiedsummary mode updatedDockerfile updatedPython 3.8added to.travis.yamlandappveyor.ymlRemovedPC_PI_calcfunction2.5- 2019-10-16Added__version__variableIndividual classification success index (ICSI)Classification success index (CSI)Example-8 (Confidence interval)install.shautopep8.shDockerfileCImethod (supported statistics :ACC,AUC,Overall ACC,Kappa,TPR,TNR,PPV,NPV,PLR,NLR,PRE)Changedtest.shmoved to.travisfolderPython 3.4 support droppedPython 2.7 support droppedAUTHORS.mdupdatedsave_stat,save_csvandsave_htmlmethods Non-ASCII character bug fixedMixed type input vectors bug fixedCONTRIBUTING.mdupdatedExample-3 updatedREADME.mdmodifiedDocument modifiedCIattribute renamed toCI95kappa_se_calcfunction renamed tokappa_SE_calcse_calcfunction modified and renamed toSE_calcCI/SE functions moved topycm_ci.pyMinor bug insave_htmlmethod fixed2.4- 2019-07-31AddedTversky index (TI)Area under the PR curve (AUPR)FUNDING.ymlChangedAUC_calcfunction modifiedDocument modifiedsummaryparameter added tosave_html,save_stat,save_csvandstatmethodssample_weightbug innumpyarray format fixedInputs manipulation bug fixedTest system modifiedWarning system modifiedalt_linkparameter added tosave_htmlmethod andonline_helpfunctionCompareclass tests moved tocompare_test.pyWarning tests moved towarning_test.py2.3- 2019-06-27AddedAdjusted F-score (AGF)Overlap coefficient (OC)Otsuka-Ochiai coefficient (OOC)Changedsave_statandsave_vectorparameters added tosave_objmethodDocument modifiedREADME.mdmodifiedParameters recommendation for imbalance dataset  modifiedMinor bug inCompareclass fixedpycm_helpfunction modifiedBenchmarks color modified2.2- 2019-05-30AddedNegative likelihood ratio interpretation (NLRI)Cramer's benchmark (SOA5)Matthews correlation coefficient interpretation (MCCI)Matthews's benchmark (SOA6)F1 macroF1 microAccuracy macroChangedCompareclass score calculation modifiedParameters recommendation for multi-class dataset  modifiedParameters recommendation for imbalance dataset  modifiedREADME.mdmodifiedDocument modifiedLogo updated2.1- 2019-05-06AddedAdjusted geometric mean (AGM)Yule's Q (Q)Compareclass and parameters recommendation system block diagramsChangedDocument links bug fixedDocument modified2.0- 2019-04-15AddedG-Mean (GM)Index of balanced accuracy (IBA)Optimized precision (OP)Pearson's C (C)CompareclassParameters recommendation warningConfusionMatrixequal methodChangedDocument modifiedstat_printfunction bug fixedtable_printfunction bug fixedBetaparameter renamed tobeta(F_calcfunction &F_betamethod)Parameters recommendation for imbalance dataset  modifiednormalizeparameter added tosave_htmlmethodpycm_func.pysplitted intopycm_class_func.pyandpycm_overall_func.pyvector_filter,vector_check,class_checkandmatrix_checkfunctions moved topycm_util.pyRACC_calcandRACCU_calcfunctions exception handler modifiedDocstrings modified1.9- 2019-02-25AddedAutomatic/Manual (AM)Bray-Curtis dissimilarity (BCD)CODE_OF_CONDUCT.mdISSUE_TEMPLATE.mdPULL_REQUEST_TEMPLATE.mdCONTRIBUTING.mdX11 color names support forsave_htmlmethodParameters recommendation systemWarning message for high dimension matrix printInteractive notebooks section (binder)Changedsave_matrixandnormalizeparameters added tosave_csvmethodREADME.mdmodifiedDocument modifiedConfusionMatrix.__init__optimizedDocument and examples output files moved to different foldersTest system modifiedrelabelmethod bug fixed1.8- 2019-01-05AddedLift score (LS)version_check.pyChangedcolorparameter added tosave_htmlmethodError messages modifiedDocument modifiedWebsite changed tohttp://www.pycm.irInterpretation functions moved topycm_interpret.pyUtility functions moved topycm_util.pyUnnecessaryelseandelifremoved==changed tois1.7- 2018-12-18AddedGini index (GI)Example-7pycm_profile.pyChangedclass_nameparameter added tostat,save_stat,save_csvandsave_htmlmethodsoverall_paramandclass_paramparameters empty list bug fixedmatrix_params_calc,matrix_params_from_tableandvector_filterfunctions optimizedoverall_MCC_calc,CEN_misclassification_calcandconvex_combinationfunctions optimizedDocument modified1.6- 2018-12-06AddedAUC value interpretation (AUCI)Example-6Anaconda cloud packageChangedoverall_paramandclass_paramparameters added tostat,save_statandsave_htmlmethodsclass_paramparameter added tosave_csvmethod_removed from overall statistics namesREADME.mdmodifiedDocument modified1.5- 2018-11-26AddedRelative classifier information (RCI)Discriminator power (DP)Youden's index (Y)Discriminant power interpretation (DPI)Positive likelihood ratio interpretation (PLRI)__len__methodrelabelmethod__class_stat_init__function__overall_stat_init__functionmatrixattribute as dictnormalized_matrixattribute as dictnormalized_tableattribute  as dictChangedREADME.mdmodifiedDocument modifiedLR+renamed toPLRLR-renamed toNLRnormalized_matrixmethod renamed toprint_normalized_matrixmatrixmethod renamed toprint_matrixentropy_calcfixedcross_entropy_calcfixedconditional_entropy_calcfixedprint_tablebug for large numbers fixedJSON key bug insave_objfixedtransposebug insave_objfixedPython 3.7added to.travis.yamlandappveyor.yml1.4- 2018-11-12AddedArea under curve (AUC)AUNUAUNPClass balance accuracy (CBA)Global performance index (RR)Overall MCCDistance index (dInd)Similarity index (sInd)one_vs_alldev-requirements.txtChangedREADME.mdmodifiedDocument modifiedsave_statmodifiedrequirements.txtmodified1.3- 2018-10-10AddedConfusion entropy (CEN)Overall confusion entropy (Overall CEN)Modified confusion entropy (MCEN)Overall modified confusion entropy (Overall MCEN)Information score (IS)ChangedREADME.mdmodified1.2- 2018-10-01AddedNo information rate (NIR)P-Valuesample_weighttransposeChangedREADME.mdmodifiedKey error in some parameters fixedOSXenv added to.travis.yml1.1- 2018-09-08AddedZero-one lossSupportonline_helpfunctionChangedREADME.mdmodifiedhtml_tablefunction modifiedtable_printfunction modifiednormalized_table_printfunction modified1.0- 2018-08-30AddedHamming lossChangedREADME.mdmodified0.9.5- 2018-07-08AddedObj loadObj saveExample-4ChangedREADME.mdmodifiedBlock diagram updated0.9- 2018-06-28AddedActivation thresholdExample-3Jaccard indexOverall Jaccard indexChangedREADME.mdmodifiedsetup.pymodified0.8.6- 2018-05-31AddedExample section in documentPython 2.7 CIJOSS paper pdfChangedCite sectionConfusionMatrix docstringround function changed to numpy.aroundREADME.mdmodified0.8.5- 2018-05-21AddedExample-1 (Comparison of three different classifiers)Example-2 (How to plot via matplotlib)JOSS paperConfusionMatrix docstringChangedTable size in HTML reportTest systemREADME.mdmodified0.8.1- 2018-03-22AddedGoodman and Kruskal's lambda BGoodman and Kruskal's lambda ACross entropyConditional entropyJoint entropyReference entropyResponse entropyKullback-Liebler divergenceDirect ConfusionMatrixKappa unbiasedKappa no prevalenceRandom accuracy unbiasedpycmVectorErrorclasspycmMatrixErrorclassMutual informationSupportnumpyarraysChangedNotebook file updatedRemovedpycmErrorclass0.7- 2018-02-26AddedCramer's V95% confidence intervalChi-SquaredPhi-SquaredChi-Squared DFStandard errorKappa standard errorKappa 95% confidence intervalCicchetti benchmarkChangedOverall statistics color in HTML reportParameters description link in HTML report0.6- 2018-02-21AddedCSV reportChangelogOutput filesdigitparameter toConfusionMatrixobjectChangedConfusion matrix color in HTML reportParameters description link in HTML reportCapitalize descriptions0.5- 2018-02-17AddedScott's piGwet's AC1Bennett S scoreHTML report0.4- 2018-02-05AddedTPR micro/macroPPV micro/macroOverall RACCError rate (ERR)FBeta scoreF0.5F2Fleiss benchmarkAltman benchmarkOutput file(.pycm)ChangedClass with zero itemNormalized matrixRemovedKappa and SOA for each class0.3- 2018-01-27AddedKappaRandom accuracyLandis and Koch benchmarkoverall_stat0.2- 2018-01-24AddedPopulationCondition positiveCondition negativeTest outcome positiveTest outcome negativePrevalenceG-measureMatrix methodNormalized matrix methodParams methodChangedstatistic_resulttoclass_statparamstostat0.1- 2018-01-22AddedACCBMDORF1-ScoreFDRFNRFORFPRLR+LR-MCCMKNPVPPVTNRTPRdocuments andREADME.md