{"id":20165470,"url":"https://github.com/tabahi/accuracy_metrics","last_synced_at":"2025-03-03T03:23:52.225Z","repository":{"id":229244274,"uuid":"776221890","full_name":"tabahi/accuracy_metrics","owner":"tabahi","description":"Precision, Recall, F1, UAR, WAR all in one","archived":false,"fork":false,"pushed_at":"2024-04-07T01:47:19.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T14:52:32.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tabahi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-22T23:41:00.000Z","updated_at":"2024-03-22T23:49:07.000Z","dependencies_parsed_at":"2024-03-27T01:27:36.855Z","dependency_job_id":"d0f9ab83-1db1-4fa4-9ae2-798420ff3431","html_url":"https://github.com/tabahi/accuracy_metrics","commit_stats":null,"previous_names":["tabahi/accuracy_metrics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2Faccuracy_metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2Faccuracy_metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2Faccuracy_metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabahi%2Faccuracy_metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabahi","download_url":"https://codeload.github.com/tabahi/accuracy_metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241601566,"owners_count":19988912,"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":[],"created_at":"2024-11-14T00:37:55.671Z","updated_at":"2025-03-03T03:23:52.202Z","avatar_url":"https://github.com/tabahi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# accuracy_metrics\n- Saving everyone the hassle. Precision, Recall, F1, unweighted average recall (micro-average), weighted accuracy (typical macro-accuracy), and confusion matrix, all in one code.\n- Requires ndarray type labels for numpy.\n- Option to skip a class in weighting macro averages.\n\n## Use:\n```python\nimport accuracy_metrics #put accuracy_metrics.py in your project dir.\n\ny_true =['M', 'F', 'M', 'F', 'O', 'F', 'M', 'F', 'M', 'O', 'M', 'F', 'O', 'F', 'M', 'F', 'M', 'F', 'M', 'F', 'O', 'F', 'M', 'F', 'M', 'F', 'M', 'O', 'O', 'F', 'M', 'F', 'M', 'F', 'F', 'F', 'O']\ny_pred =['F', 'F', 'M', 'O', 'F', 'F', 'M', 'F', 'M', 'F', 'M', 'M', 'O', 'F', 'F', 'M', 'O', 'F', 'F', 'M', 'F', 'M', 'F', 'M', 'M', 'O', 'F', 'F', 'M', 'O', 'F', 'F', 'M', 'M', 'M', 'F', 'O']\n\n\nresults = accuracy_metrics.generate_classification_metrics(y_true, y_pred, skip_label='O', confusion_csv=\"confusion.csv\", precisions_csv=\"precisions.csv\")\nprint(results)\n\n'''\n{'N_counts': [17, 13, 7], 'uar': 43.67, 'war': 43.33, 'precision': 0.405, 'recall': 0.405, 'f1_score': 0.405, 'precision_sk': 0.433, 'recall_sk': 0.419, 'f1_score_sk': 0.426}\n_sk for metrics calculated skipping the skipped class.\n'''\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabahi%2Faccuracy_metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabahi%2Faccuracy_metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabahi%2Faccuracy_metrics/lists"}