# Extra Keras Metrics
![PyPI version](https://badge.fury.io/py/extra-keras-metrics.svg)
[![python](https://img.shields.io/pypi/pyversions/extra-keras-metrics)](https://pypi.org/project/extra-keras-metrics/)
[![license](https://img.shields.io/pypi/l/extra-keras-metrics)](https://pypi.org/project/extra-keras-metrics/)
![Downloads](https://pepy.tech/badge/extra-keras-metrics)
[![mypy](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/workflows/mypy.yml/badge.svg)](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/)
[![Github Actions](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/workflows/python.yml/badge.svg)](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/)
Additional metrics integrated with the TensorFlow and Keras Neural Network libraries.
## How do I install this package?
As usual, just download it using pip:
```shell
pip install extra_keras_metrics
```
## How do I use this package?
In addition to importing individual metrics, sets of metrics are also available.
### Multi-class metrics
To retrieve an instance of the set of multi-class metrics, use:
```python
from extra_keras_metrics import get_minimal_multiclass_metrics
model = my_keras_model()
model.compile(
optimizer="nadam",
loss="categorical_crossentropy",
metrics=get_minimal_multiclass_metrics()
)
```
### Sparse multi-class metrics
To retrieve an instance of the set of sparse multi-class metrics, use:
```python
from extra_keras_metrics import get_sparse_multiclass_metrics
model = my_keras_model()
model.compile(
optimizer="nadam",
loss="sparse_categorical_crossentropy",
metrics=get_sparse_multiclass_metrics()
)
```
Note that currently, this only includes categorical accuracy, as it is the only one provided out-of-the-box by TensorFlow. More metrics are planned.
### Binary metrics
To retrieve an instance of the set of binary metrics, use:
```python
from extra_keras_metrics import get_standard_binary_metrics
model = my_keras_model()
model.compile(
optimizer="nadam",
loss="binary_crossentropy",
metrics=get_standard_binary_metrics()
)
```
### All the binary metrics
We have implemented a wide range of binary metrics, including some lesser-known ones. To include **all** available binary metrics, use:
```python
from extra_keras_metrics import get_complete_binary_metrics
model = my_keras_model()
model.compile(
optimizer="nadam",
loss="binary_crossentropy",
metrics=get_complete_binary_metrics()
)
```
## Extras
You might also enjoy these related packages:
- [extra_keras_utils](https://github.com/LucaCappelletti94/extra_keras_utils) - contains commonly used code for Keras projects.
- [plot_keras_history](https://github.com/LucaCappelletti94/plot_keras_history) - automatically plots Keras training history.
Raw data
{
"_id": null,
"home_page": "https://github.com/LucaCappelletti94/extra_keras_metrics",
"name": "extra-keras-metrics",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Luca Cappelletti",
"author_email": "cappelletti.luca94@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/18/80/8e9188e2f93ac04a1d9179a1853bfab12554b6e695b83476ffe0dd728c07/extra_keras_metrics-2.0.14.tar.gz",
"platform": null,
"description": "# Extra Keras Metrics\n\n![PyPI version](https://badge.fury.io/py/extra-keras-metrics.svg)\n[![python](https://img.shields.io/pypi/pyversions/extra-keras-metrics)](https://pypi.org/project/extra-keras-metrics/)\n[![license](https://img.shields.io/pypi/l/extra-keras-metrics)](https://pypi.org/project/extra-keras-metrics/)\n![Downloads](https://pepy.tech/badge/extra-keras-metrics)\n[![mypy](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/workflows/mypy.yml/badge.svg)](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/)\n[![Github Actions](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/workflows/python.yml/badge.svg)](https://github.com/LucaCappelletti94/extra_keras_metrics/actions/)\n\nAdditional metrics integrated with the TensorFlow and Keras Neural Network libraries.\n\n## How do I install this package?\n\nAs usual, just download it using pip:\n\n```shell\npip install extra_keras_metrics\n```\n\n## How do I use this package?\n\nIn addition to importing individual metrics, sets of metrics are also available.\n\n### Multi-class metrics\n\nTo retrieve an instance of the set of multi-class metrics, use:\n\n```python\nfrom extra_keras_metrics import get_minimal_multiclass_metrics\n\nmodel = my_keras_model()\nmodel.compile(\n optimizer=\"nadam\",\n loss=\"categorical_crossentropy\",\n metrics=get_minimal_multiclass_metrics()\n)\n```\n\n### Sparse multi-class metrics\n\nTo retrieve an instance of the set of sparse multi-class metrics, use:\n\n```python\nfrom extra_keras_metrics import get_sparse_multiclass_metrics\n\nmodel = my_keras_model()\nmodel.compile(\n optimizer=\"nadam\",\n loss=\"sparse_categorical_crossentropy\",\n metrics=get_sparse_multiclass_metrics()\n)\n```\n\nNote that currently, this only includes categorical accuracy, as it is the only one provided out-of-the-box by TensorFlow. More metrics are planned.\n\n### Binary metrics\n\nTo retrieve an instance of the set of binary metrics, use:\n\n```python\nfrom extra_keras_metrics import get_standard_binary_metrics\n\nmodel = my_keras_model()\nmodel.compile(\n optimizer=\"nadam\",\n loss=\"binary_crossentropy\",\n metrics=get_standard_binary_metrics()\n)\n```\n\n### All the binary metrics\n\nWe have implemented a wide range of binary metrics, including some lesser-known ones. To include **all** available binary metrics, use:\n\n```python\nfrom extra_keras_metrics import get_complete_binary_metrics\n\nmodel = my_keras_model()\nmodel.compile(\n optimizer=\"nadam\",\n loss=\"binary_crossentropy\",\n metrics=get_complete_binary_metrics()\n)\n```\n\n## Extras\n\nYou might also enjoy these related packages:\n\n- [extra_keras_utils](https://github.com/LucaCappelletti94/extra_keras_utils) - contains commonly used code for Keras projects.\n- [plot_keras_history](https://github.com/LucaCappelletti94/plot_keras_history) - automatically plots Keras training history.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Additional metrics integrated with the TensorFlow and Keras NN library.",
"version": "2.0.14",
"project_urls": {
"Homepage": "https://github.com/LucaCappelletti94/extra_keras_metrics"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "18808e9188e2f93ac04a1d9179a1853bfab12554b6e695b83476ffe0dd728c07",
"md5": "74edaf3f137639298a28e32531961f99",
"sha256": "c1e702efe91a611c237db7257d749decd09e9e003bd5d98f20fd138ee10062f3"
},
"downloads": -1,
"filename": "extra_keras_metrics-2.0.14.tar.gz",
"has_sig": false,
"md5_digest": "74edaf3f137639298a28e32531961f99",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8765,
"upload_time": "2024-10-28T07:32:50",
"upload_time_iso_8601": "2024-10-28T07:32:50.714783Z",
"url": "https://files.pythonhosted.org/packages/18/80/8e9188e2f93ac04a1d9179a1853bfab12554b6e695b83476ffe0dd728c07/extra_keras_metrics-2.0.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-28 07:32:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LucaCappelletti94",
"github_project": "extra_keras_metrics",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "extra-keras-metrics"
}