Skip to main content

Extra Keras Metrics

PyPI version python license Downloads mypy Github 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:

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:

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:

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:

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:

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:

Metadata

Release files for extra-keras-metrics 2.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extra-keras-metrics 2.0.14
File Size Uploaded
extra_keras_metrics-2.0.14.tar.gz 8.8 kB Details

Release files / extra_keras_metrics-2.0.14.tar.gz

Download URL extra_keras_metrics-2.0.14.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c1e702efe91a611c237db7257d749decd09e9e003bd5d98f20fd138ee10062f3
BLAKE2b-256 checksum
How to use checksums
18808e9188e2f93ac04a1d9179a1853bfab12554b6e695b83476ffe0dd728c07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

Release history Release notifications | RSS feed

This release

2.0.14 This release

1 release file

2.0.12

1 release file

2.0.10

1 release file

2.0.9

1 release file

2.0.8

1 release file

2.0.7

1 release file

2.0.6

1 release file

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page