{"id":13738288,"url":"https://github.com/fcakyon/confplot","last_synced_at":"2025-05-07T10:34:34.865Z","repository":{"id":62564452,"uuid":"266805871","full_name":"fcakyon/confplot","owner":"fcakyon","description":"Confusion Matrix in Python: Plot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlib","archived":false,"fork":false,"pushed_at":"2020-08-18T08:24:27.000Z","size":275,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T10:34:08.028Z","etag":null,"topics":["confusion-matrix","confusionmatrix","linux","macos","matlab","matplotlib","package","pip","plot","pypi","python","seaborn","windows"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fcakyon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-25T14:50:24.000Z","updated_at":"2024-04-08T04:37:36.000Z","dependencies_parsed_at":"2022-11-03T16:45:35.983Z","dependency_job_id":null,"html_url":"https://github.com/fcakyon/confplot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcakyon%2Fconfplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcakyon%2Fconfplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcakyon%2Fconfplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcakyon%2Fconfplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcakyon","download_url":"https://codeload.github.com/fcakyon/confplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252860218,"owners_count":21815481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["confusion-matrix","confusionmatrix","linux","macos","matlab","matplotlib","package","pip","plot","pypi","python","seaborn","windows"],"created_at":"2024-08-03T03:02:17.247Z","updated_at":"2025-05-07T10:34:34.825Z","avatar_url":"https://github.com/fcakyon.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ConfPlot: Plot Confusion Matrix in Python\n\n[![Downloads](https://pepy.tech/badge/confplot)](https://pepy.tech/project/confplot)\n[![PyPI version](https://badge.fury.io/py/confplot.svg)](https://badge.fury.io/py/confplot)\n![CI](https://github.com/fcakyon/confplot/workflows/CI/badge.svg)\n\nPlot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlib\n\nThis module lets you plot a pretty looking confusion matrix from a np matrix or from a prediction results and actual labels.\n\nSample plots:\n\n\u003cimg src=\"screenshots/conf_matrix_plot1.png\" width=\"450\"\u003e \u003cimg src=\"screenshots/conf_matrix_plot2.png\" width=\"450\"\u003e\n\n## Getting started\n\n### Installation\n\n```console\npip install confplot\n```\n\n### Usage\n\n#### Plot confusion matrix from matrix\n\n```python\n# import package\nimport confplot\n\n# assume you have a confusion matrix array like this\narray = np.array(\n    [[13,  0,  1,  0,  2,  0],\n     [ 0, 50,  2,  0, 10,  0],\n     [ 0, 13, 16,  0,  0,  3],\n     [ 0,  0,  0, 13,  1,  0],\n     [ 0, 40,  0,  1, 15,  0],\n     [ 0,  0,  0,  0,  0, 20]]\n)\n\n# convert it to a pandas dataframe\ndf_cm = DataFrame(array, index=range(1, 7), columns=range(1, 7))\n\n# create and save confusion matrix plot as \"cm_plot.png\"\nconfplot.plot_confusion_matrix_from_matrix(df_cm, outfile=\"cm_plot.png\")\n```\n\n#### Plot confusion matrix from data\n```python\n# import package\nimport confplot\n\n# assume you have 1D y_true (actual values) and y_pred (predictions) arrays\ny_true = ...\ny_pred = ...\n\n# arange targetclass names if you want\ncolumns = [\"ahududu\", \"ananas\", \"armut\", \"avokado\", \"ayva\"]\n\n# create and save confusion matrix plot as \"cm_plot.png\"\nconfplot.plot_confusion_matrix_from_data(\n    y_true,\n    y_pred,\n    columns,\n    outfile=\"cm_plot.png\"\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcakyon%2Fconfplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcakyon%2Fconfplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcakyon%2Fconfplot/lists"}