dirichletcal


Namedirichletcal JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/dirichletcal/dirichlet_python
SummaryPython code for Dirichlet calibration
upload_time2024-08-05 18:52:13
maintainerNone
docs_urlNone
authorMiquel Perello Nieto and Hao Song
requires_python>=3.12
licenseNone
keywords classifier calibration dirichlet multiclass probability
VCS
bugtrack_url
requirements numpy scipy scikit-learn jax jaxlib
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CI][ci:b]][ci]
[![License BSD3][license:b]][license]
![Python3.12][python:b]
[![pypi][pypi:b]][pypi]
[![codecov][codecov:b]][codecov]
[![DOI](https://zenodo.org/badge/227004259.svg)](https://zenodo.org/badge/latestdoi/227004259)

[ci]: https://github.com/dirichletcal/dirichlet_python/actions/workflows/ci.yml
[ci:b]: https://github.com/dirichletcal/dirichlet_python/workflows/CI/badge.svg
[license]: https://github.com/dirichletcal/dirichlet_python/blob/master/LICENSE.txt
[license:b]: https://img.shields.io/github/license/dirichletcal/dirichlet_python.svg
[python:b]: https://img.shields.io/badge/python-3.12-blue
[pypi]: https://badge.fury.io/py/dirichletcal
[pypi:b]: https://badge.fury.io/py/dirichletcal.svg
[codecov]: https://codecov.io/gh/dirichletcal/dirichlet_python
[codecov:b]: https://codecov.io/gh/dirichletcal/dirichlet_python/branch/master/graph/badge.svg

# Dirichlet Calibration Python implementation

This is a Python implementation of the Dirichlet Calibration presented in
__Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities
with Dirichlet calibration__ at NeurIPS 2019. The original version used Python
3.8 and reached version `0.4.2`. The code started using Python 3.12 from
version `0.5.0`, you can see the other version in the GitHub history, tags, or
in Pypi.

# Installation

```
# Clone the repository
git clone git@github.com:dirichletcal/dirichlet_python.git
# Go into the folder
cd dirichlet_python
# Create a new virtual environment with Python3
python3.12 -m venv venv
# Load the generated virtual environment
source venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# Install all the dependencies
pip install -r requirements.txt
pip install --upgrade jaxlib
```

# Unittest

```
python -m unittest discover dirichletcal
```


# Cite

If you use this code in a publication please cite the following paper


```
@inproceedings{kull2019dircal,
  title={Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities with Dirichlet calibration},
  author={Kull, Meelis and Nieto, Miquel Perello and K{\"a}ngsepp, Markus and Silva Filho, Telmo and Song, Hao and Flach, Peter},
  booktitle={Advances in Neural Information Processing Systems},
  pages={12295--12305},
  year={2019}
}
```

# Examples

You can find some examples on how to use this package in the folder
[examples](examples)

# Pypi

To push a new version to Pypi first build the package

```
python3.12 setup.py sdist
```

And then upload to Pypi with twine

```
twine upload dist/*
```

It may require user and password if these are not set in your home directory a
file  __.pypirc__

```
[pypi]
username = __token__
password = pypi-yourtoken
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dirichletcal/dirichlet_python",
    "name": "dirichletcal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "classifier, calibration, dirichlet, multiclass, probability",
    "author": "Miquel Perello Nieto and Hao Song",
    "author_email": "perello.nieto@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/a2/5006b6d405fb2b1beb81515c315454eeef0255cff49fc82e0dadeb09b377/dirichletcal-0.5.2.tar.gz",
    "platform": null,
    "description": "[![CI][ci:b]][ci]\n[![License BSD3][license:b]][license]\n![Python3.12][python:b]\n[![pypi][pypi:b]][pypi]\n[![codecov][codecov:b]][codecov]\n[![DOI](https://zenodo.org/badge/227004259.svg)](https://zenodo.org/badge/latestdoi/227004259)\n\n[ci]: https://github.com/dirichletcal/dirichlet_python/actions/workflows/ci.yml\n[ci:b]: https://github.com/dirichletcal/dirichlet_python/workflows/CI/badge.svg\n[license]: https://github.com/dirichletcal/dirichlet_python/blob/master/LICENSE.txt\n[license:b]: https://img.shields.io/github/license/dirichletcal/dirichlet_python.svg\n[python:b]: https://img.shields.io/badge/python-3.12-blue\n[pypi]: https://badge.fury.io/py/dirichletcal\n[pypi:b]: https://badge.fury.io/py/dirichletcal.svg\n[codecov]: https://codecov.io/gh/dirichletcal/dirichlet_python\n[codecov:b]: https://codecov.io/gh/dirichletcal/dirichlet_python/branch/master/graph/badge.svg\n\n# Dirichlet Calibration Python implementation\n\nThis is a Python implementation of the Dirichlet Calibration presented in\n__Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities\nwith Dirichlet calibration__ at NeurIPS 2019. The original version used Python\n3.8 and reached version `0.4.2`. The code started using Python 3.12 from\nversion `0.5.0`, you can see the other version in the GitHub history, tags, or\nin Pypi.\n\n# Installation\n\n```\n# Clone the repository\ngit clone git@github.com:dirichletcal/dirichlet_python.git\n# Go into the folder\ncd dirichlet_python\n# Create a new virtual environment with Python3\npython3.12 -m venv venv\n# Load the generated virtual environment\nsource venv/bin/activate\n# Upgrade pip\npip install --upgrade pip\n# Install all the dependencies\npip install -r requirements.txt\npip install --upgrade jaxlib\n```\n\n# Unittest\n\n```\npython -m unittest discover dirichletcal\n```\n\n\n# Cite\n\nIf you use this code in a publication please cite the following paper\n\n\n```\n@inproceedings{kull2019dircal,\n  title={Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities with Dirichlet calibration},\n  author={Kull, Meelis and Nieto, Miquel Perello and K{\\\"a}ngsepp, Markus and Silva Filho, Telmo and Song, Hao and Flach, Peter},\n  booktitle={Advances in Neural Information Processing Systems},\n  pages={12295--12305},\n  year={2019}\n}\n```\n\n# Examples\n\nYou can find some examples on how to use this package in the folder\n[examples](examples)\n\n# Pypi\n\nTo push a new version to Pypi first build the package\n\n```\npython3.12 setup.py sdist\n```\n\nAnd then upload to Pypi with twine\n\n```\ntwine upload dist/*\n```\n\nIt may require user and password if these are not set in your home directory a\nfile  __.pypirc__\n\n```\n[pypi]\nusername = __token__\npassword = pypi-yourtoken\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python code for Dirichlet calibration",
    "version": "0.5.2",
    "project_urls": {
        "Download": "https://github.com/dirichletcal/dirichlet_python/archive/0.5.2.tar.gz",
        "Homepage": "https://github.com/dirichletcal/dirichlet_python"
    },
    "split_keywords": [
        "classifier",
        " calibration",
        " dirichlet",
        " multiclass",
        " probability"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5aa25006b6d405fb2b1beb81515c315454eeef0255cff49fc82e0dadeb09b377",
                "md5": "02c0d865324daa22ac7166c90fdbba5b",
                "sha256": "48d69089c127121543bba7abef6327a10e7c6008cec9823b01da5aaa94b5eeb7"
            },
            "downloads": -1,
            "filename": "dirichletcal-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "02c0d865324daa22ac7166c90fdbba5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 12677,
            "upload_time": "2024-08-05T18:52:13",
            "upload_time_iso_8601": "2024-08-05T18:52:13.475317Z",
            "url": "https://files.pythonhosted.org/packages/5a/a2/5006b6d405fb2b1beb81515c315454eeef0255cff49fc82e0dadeb09b377/dirichletcal-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-05 18:52:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dirichletcal",
    "github_project": "dirichlet_python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.14.0"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    "==",
                    "1.5.1"
                ]
            ]
        },
        {
            "name": "jax",
            "specs": [
                [
                    "==",
                    "0.4.31"
                ]
            ]
        },
        {
            "name": "jaxlib",
            "specs": [
                [
                    "==",
                    "0.4.31"
                ]
            ]
        }
    ],
    "lcname": "dirichletcal"
}
        
Elapsed time: 0.36452s