Skip to main content

Additional metrics integrated with the keras NN library, taken directly from `Tensorflow <https://www.tensorflow.org/api_docs/python/tf/metrics/>`_

Project description

Travis CI build SonarCloud Quality SonarCloud Maintainability Codacy Maintainability Maintainability Pypi project Pypi total project downloads

Additional metrics integrated with the Keras NN library.

How do I install this package?

As usual, just download it using pip:

pip install extra_keras_metrics

Tests Coverage

Since some software handling coverages sometimes get slightly different results, here’s three of them:

Coveralls Coverage SonarCloud Coverage Code Climate Coverate

How do I use this package?

Other than by importing the single metrics from the package, we make available also sets of metrics.

Multi-class metrics

To retrieve an instance of the set of multi-class metrics you can 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 you can 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 for now this only includes the categorial accuracy, since it is the only one provided out-of-the-box by Tensorflow. We will be implementing more metrics ourselves.

Binary metrics

To retrieve an instance of the set of binary-class metrics you can 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 all sorts of binary metrics, including some relatively more obscure ones. If you want ALL the binary metrics we implemented you can use the following method:

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

I’ve created also another couple packages you might enjoy this other one, called extra_keras_utils that contains some commonly used code for Keras projects and plot_keras_history <https://github.com/LucaCappelletti94/plot_keras_history> which automatically plots a Keras training history.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extra_keras_metrics-2.0.4.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file extra_keras_metrics-2.0.4.tar.gz.

File metadata

  • Download URL: extra_keras_metrics-2.0.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10

File hashes

Hashes for extra_keras_metrics-2.0.4.tar.gz
Algorithm Hash digest
SHA256 a4f4466094bedb1a6f0f0063edfe801f0a47a6596fbe7a6b4765c0c5ec58e56e
MD5 885e5dd93eab6bedfa66b821a12a0a62
BLAKE2b-256 32929c9cdf1e201b6cfd1e57327e248e972c3522e505b7981029f7e594a36dd2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page