{"id":33897977,"url":"https://github.com/luizfernandolj/mlquantify","last_synced_at":"2026-02-09T23:10:08.756Z","repository":{"id":246442425,"uuid":"820955488","full_name":"luizfernandolj/mlquantify","owner":"luizfernandolj","description":"A Python Quantification Library","archived":false,"fork":false,"pushed_at":"2026-02-05T20:59:44.000Z","size":75501,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-06T06:29:28.092Z","etag":null,"topics":["machine-learning","prevalence-estimation","python","quantification"],"latest_commit_sha":null,"homepage":"https://luizfernandolj.github.io/mlquantify/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luizfernandolj.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-27T14:08:48.000Z","updated_at":"2026-02-05T21:05:44.000Z","dependencies_parsed_at":"2025-08-19T23:18:14.716Z","dependency_job_id":"920c5a1d-5e38-40cd-83a7-27f4c346e5f0","html_url":"https://github.com/luizfernandolj/mlquantify","commit_stats":null,"previous_names":["luizfernandolj/libquantifiers","luizfernandolj/quantifyml"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/luizfernandolj/mlquantify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizfernandolj%2Fmlquantify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizfernandolj%2Fmlquantify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizfernandolj%2Fmlquantify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizfernandolj%2Fmlquantify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luizfernandolj","download_url":"https://codeload.github.com/luizfernandolj/mlquantify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizfernandolj%2Fmlquantify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29284993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["machine-learning","prevalence-estimation","python","quantification"],"created_at":"2025-12-11T20:04:02.483Z","updated_at":"2026-02-09T23:10:08.738Z","avatar_url":"https://github.com/luizfernandolj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![PyPI - Version](https://img.shields.io/pypi/v/mlquantify)\n[![docs](https://img.shields.io/badge/docs-sphinx-blue)](https://github.com/luizfernandolj/mlquantify/)\n\n\n\u003ca href=\"https://luizfernandolj.github.io/mlquantify/\"\u003e\u003cimg src=\"assets/logo_mlquantify-white.svg\" alt=\"mlquantify logo\"\u003e\u003c/a\u003e\n\u003ch4 align=\"center\"\u003eA Python Package for Quantification\u003c/h4\u003e\n\n___\n\n **mlquantify** is a Python library for quantification, also known as supervised prevalence estimation, designed to estimate the distribution of classes within datasets. It offers a range of tools for various quantification methods, model selection tailored for quantification tasks, evaluation metrics, and protocols to assess quantification performance. Additionally, mlquantify includes popular datasets and visualization tools to help analyze and interpret results.\n\n Website: https://luizfernandolj.github.io/mlquantify/\n\n___\n\n## Installation\n\nTo install mlquantify, run the following command:\n\n```bash\npip install mlquantify\n```\n\nIf you only want to update, run the code below:\n\n```bash\npip install --upgrade mlquantify\n```\n\n___\n\n## Contents\n\n| Section | Description |\n|---|---|\n| **21 Quantification Methods** | Methods for quantification, such as classify \u0026 Count Correct methods, Threshold Optimization, Mixture Models and more.|\n| **Dynamic class management** | All methods are dynamic, and handles multiclass and binary problems, in case of binary it makes One-Vs-All (OVA) automatically. |\n| **Model Selection** | Criteria and processes used to select the best model, such as grid-search for the case of quantification|\n| **Evaluation Metrics** | Specific metrics used to evaluate quantification performance, (e.g., AE, MAE, NAE, SE, KLD, etc.). |\n| **Evaluation Protocols** | Evaluation protocols used, based on sampling generation (e.g., APP, NPP, etc.).. |\n| **Comprehensive Documentation** | Complete documentation of the project, including code, data, and results. |\n\n___\n\n## Quick example:\n\nThis code first loads the breast cancer dataset from _sklearn_, which is then split into training and testing sets. It uses the _Expectation Maximisation Quantifier (EMQ)_ with a RandomForest classifier to predict class prevalence. After training the model, it evaluates performance by calculating and printing the absolute error and bias between the real and predicted prevalences.\n\n```python\nfrom mlquantify.methods import EMQ\nfrom mlquantify.metrics import MAE, NRAE\nfrom mlquantify.utils import get_prev_from_labels\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\n\n# Loading dataset from sklearn\nfeatures, target = load_breast_cancer(return_X_y=True)\n\n#Splitting into train and test\nX_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.3)\n\n#Create the model, here it is the Expectation Maximisation Quantifier (EMQ) with a classifier\nmodel = EMQ(RandomForestClassifier())\nmodel.fit(X_train, y_train)\n\n#Predict the class prevalence for X_test\npred_prevalence = model.predict(X_test)\nreal_prevalence = get_prev_from_labels(y_test)\n\n#Get the error for the prediction\nmae = MAE(real_prevalence, pred_prevalence)\nnrae = NRAE(real_prevalence, pred_prevalence)\n\nprint(f\"Mean Absolute Error -\u003e {mae}\")\nprint(f\"Normalized Relative Absolute Error -\u003e {nrae}\")\n```\n\n- In case you need any help, refer to the [User Guide](https://luizfernandolj.github.io/mlquantify/user_guide.html).\n- Explore the [API documentation](https://luizfernandolj.github.io/mlquantify/api/index.html) for detailed developer information.\n- See also the library in the pypi site in [pypi mlquantify](https://pypi.org/project/mlquantify/)\n\n___\n\n## Requirements\n\n- Scikit-learn\n- pandas\n- numpy\n- joblib\n- tqdm\n- matplotlib\n- xlrd","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizfernandolj%2Fmlquantify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluizfernandolj%2Fmlquantify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizfernandolj%2Fmlquantify/lists"}