{"id":18418619,"url":"https://github.com/bsm/mlmetrics","last_synced_at":"2025-04-07T13:31:21.958Z","repository":{"id":48564074,"uuid":"154684732","full_name":"bsm/mlmetrics","owner":"bsm","description":"Common metrics for evaluation of machine learning models","archived":false,"fork":false,"pushed_at":"2021-07-20T08:36:04.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T19:02:45.010Z","etag":null,"topics":["classification","confusion-matrix","golang","kappa","logloss","machine-learning","matthews","ml","online-machine-learning","r2","regression"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bsm.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":"2018-10-25T14:24:09.000Z","updated_at":"2024-04-27T09:17:13.000Z","dependencies_parsed_at":"2022-09-04T05:35:08.802Z","dependency_job_id":null,"html_url":"https://github.com/bsm/mlmetrics","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fmlmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fmlmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fmlmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fmlmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsm","download_url":"https://codeload.github.com/bsm/mlmetrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247661670,"owners_count":20975096,"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":["classification","confusion-matrix","golang","kappa","logloss","machine-learning","matthews","ml","online-machine-learning","r2","regression"],"created_at":"2024-11-06T04:14:09.242Z","updated_at":"2025-04-07T13:31:21.600Z","avatar_url":"https://github.com/bsm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML metrics\n\n[![GoDoc](https://godoc.org/github.com/bsm/mlmetrics?status.svg)](https://godoc.org/github.com/bsm/mlmetrics)\n[![Test](https://github.com/bsm/openmetrics/actions/workflows/test.yml/badge.svg)](https://github.com/bsm/openmetrics/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nCommon metrics for evaluation of machine learning models.\n\nGoals:\n\n* Fast!\n* Thread-safe\n* Support for online evaluation\n\n## Supported Metrics\n\nClassification:\n\n* [Accuracy](https://en.wikipedia.org/wiki/Accuracy_and_precision)\n* [Confusion Matrix](https://en.wikipedia.org/wiki/Confusion_matrix)\n* [F1 Score](https://en.wikipedia.org/wiki/F1_score)\n* [Kappa](https://en.wikipedia.org/wiki/Cohen%27s_kappa)\n* [Matthews](https://en.wikipedia.org/wiki/Matthews_correlation_coefficient)\n* [LogLoss](https://en.wikipedia.org/wiki/Loss_functions_for_classification)\n* [Precision](https://en.wikipedia.org/wiki/Information_retrieval#Precision)\n* [Sensitivity](https://en.wikipedia.org/wiki/Sensitivity_(test))\n\nRegression:\n\n* [Mean Absolute Error](https://en.wikipedia.org/wiki/Mean_absolute_error)\n* [Mean Squared Error](https://en.wikipedia.org/wiki/Mean_squared_error)\n* [Root Mean Squared Error](https://en.wikipedia.org/wiki/Root-mean-square_deviation)\n* [Mean Squared Error](https://en.wikipedia.org/wiki/Root-mean-square_deviation)\n* [R²](https://en.wikipedia.org/wiki/Coefficient_of_determination)\n\n## Documentation\n\nDocumentation and example are available via godoc at http://godoc.org/github.com/bsm/mlmetrics\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"github.com/bsm/mlmetrics\"\n)\n\nfunc main() {\n\tyTrue := []int{2, 0, 2, 2, 0, 1}\n\tyPred := []int{0, 0, 2, 2, 0, 2}\n\n\tmat := mlmetrics.NewConfusionMatrix()\n\tfor i := range yTrue {\n\t\tmat.Observe(yTrue[i], yPred[i])\n\t}\n\n\t// print matrix\n\tfor i := 0; i \u003c mat.Order(); i++ {\n\t\tfmt.Println(mat.Row(i))\n\t}\n\n\t// print metrics\n\tfmt.Println()\n\tfmt.Printf(\"accuracy : %.3f\\n\", mat.Accuracy())\n\tfmt.Printf(\"kappa    : %.3f\\n\", mat.Kappa())\n\tfmt.Printf(\"matthews : %.3f\\n\", mat.Matthews())\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fmlmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsm%2Fmlmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fmlmetrics/lists"}