{"id":21033118,"url":"https://github.com/mwydmuch/xcolumns","last_synced_at":"2025-12-27T11:18:59.871Z","repository":{"id":117939736,"uuid":"592865968","full_name":"mwydmuch/xCOLUMNs","owner":"mwydmuch","description":"Consistent Optimization of Label-wise Utilities in Multi-label classificatioN","archived":false,"fork":false,"pushed_at":"2024-04-12T18:19:17.000Z","size":3213,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T06:16:19.284Z","etag":null,"topics":["extreme-classification","inference-algorithms","machine-learning","ml","multi-label-classification","recommender-systems","utility-optimization","xmlc"],"latest_commit_sha":null,"homepage":"","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/mwydmuch.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}},"created_at":"2023-01-24T17:49:55.000Z","updated_at":"2024-04-24T22:37:57.838Z","dependencies_parsed_at":"2023-11-14T02:38:23.346Z","dependency_job_id":"912fb8cd-e1c8-4d6c-bf1f-7dc4ea2f3adb","html_url":"https://github.com/mwydmuch/xCOLUMNs","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/mwydmuch%2FxCOLUMNs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FxCOLUMNs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FxCOLUMNs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FxCOLUMNs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwydmuch","download_url":"https://codeload.github.com/mwydmuch/xCOLUMNs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475358,"owners_count":20296712,"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":["extreme-classification","inference-algorithms","machine-learning","ml","multi-label-classification","recommender-systems","utility-optimization","xmlc"],"created_at":"2024-11-19T12:51:50.793Z","updated_at":"2025-12-27T11:18:54.811Z","avatar_url":"https://github.com/mwydmuch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/xcolumns.svg)](https://badge.fury.io/py/xcolumns)\n[![Documentation Status](https://readthedocs.org/projects/xcolumns/badge/?version=latest)](https://xcolumns.readthedocs.io/en/latest/?badge=latest)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://pre-commit.com/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/mwydmuch/xCOLUMNs/master/docs/_static/xCOLUMNs_logo.png\" width=\"500px\"/\u003e\n\u003c/p\u003e\n\n# x **Consistent Optimization of Label-wise Utilities in Multi-label classificatioN** s\n\nxCOLUMNs is a small Python library that aims to implement different methods for the optimization of a general family of\nmetrics that can be defined on multi-label classification matrices.\nThese include, but are not limited to, label-wise metrics.\nThe library provides an efficient implementation of the different optimization methods that easily scale to the extreme multi-label classification (XMLC) - problems with a very large number of labels and instances.\n\nAll the methods operate on conditional probability estimates of the labels, which are the output of the multi-label classification models.\nBased on these estimates, the methods aim to find the optimal prediction for a given test set or to find the optimal population classifier as a plug-in rule on top of the conditional probability estimator.\nThis makes the library very flexible and allows to use it with any multi-label classification model that provides conditional probability estimates.\nThe library directly supports numpy arrays, PyTorch tensors, and sparse CSR matrices from scipy as input/output data types.\n\nFor more details, please see our short usage guide, the documentation, and/or the papers that describe the methods implemented in the library.\n\n\n## Quick start\n\n### Installation\n\nThe library can be installed using pip:\n```sh\npip install xcolumns\n```\nIt should work on all major platforms (Linux, macOS, Windows) and with Python 3.8+.\n\n\n### Usage\n\nWe provide a short usage guide for the library in [short_usage_guide.ipynb](https://github.com/mwydmuch/xCOLUMNs/blob/master/short_usage_guide.ipynb) notebook.\nYou can also check the documentation for more details.\n\n\n## Methods implemented in xCOLUMNs\n\nThe library implements the following methods:\n\n### Instance-wise weighted prediction\n\nThe library implements a set of methods for instance-wise weighted prediction, that include optimal infernece strategies for some metrics, such as:\n- Precision at k\n- Propensity-scored precision at k\n- Macro-averaged recall at k\n- Macro-averaged balanced accuracy at k\n- and others ...\n\n### Optimization of prediction for a given test set using Block Coordinate Ascent/Descent (BCA/BCD)\n\nThe method aims to optimize the prediction for a given metrics and test set using the block coordinate ascent/descent algorithm.\n\nThe method was first introduced and described in the paper:\n\u003e [Erik Schultheis, Marek Wydmuch, Wojciech Kotłowski, Rohit Babbar, Krzysztof Dembczyński. Generalized test utilities for long-tail performance in extreme multi-label classification. NeurIPS 2023.](https://arxiv.org/abs/2311.05081)\n\n### Finding optimal population classifier using Frank-Wolfe (FW)\n\nThe method finds the optimal population classifier for given metric using the Frank-Wolfe optimization algorithm on the provided training set.\n\nThe method was first introduced and described in the paper:\n\u003e [Erik Schultheis, Wojciech Kotłowski, Marek Wydmuch, Rohit Babbar, Strom Borman, Krzysztof Dembczyński. Consistent algorithms for multi-label classification with macro-at-k metrics. ICLR 2024.](https://arxiv.org/abs/2401.16594)\n\n\n## Repository structure\n\nThe repository is organized as follows:\n- `docs/` - Sphinx documentation\n- `experiments/` - a code for reproducing experiments from the papers, see the README.md file in the directory for more details\n- `xcolumns/` - the library source code\n- `tests/` - tests for the library (the coverage is bit limited at the moment, but these test should guarantee that the main components of the library works as expected)\n\n\n## Development and contributing\n\nThe library was created as a part of our research projects.\nWe are happy to share it with the community and we hope that someone will find it useful.\nIf you have any questions or suggestions or if you found a bug, please open an issue.\nWe are also happy to accept contributions in the form of pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwydmuch%2Fxcolumns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwydmuch%2Fxcolumns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwydmuch%2Fxcolumns/lists"}