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, taken directly from Tensorflow

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 sometime get slightly different results, here’s three of them:

Coveralls Coverage SonarCloud Coverage Code Climate Coverate

How do I use this package?

Just by importing it you will be able to access all the non-parametric metrics, such as “auprc” and “auroc”:

import extra_keras_metrics

model = my_keras_model()
model.compile(
    optimizer="sgd",
    loss="binary_crossentropy",
    metrics=["auroc", "auprc"]
)

For the parametric metrics, such as “average_precision_at_k”, you will need to import them, such as:

from extra_keras_metrics import average_precision_at_k

model = my_keras_model()
model.compile(
    optimizer="sgd",
    loss="binary_crossentropy",
    metrics=[average_precision_at_k(1), average_precision_at_k(2)]
)

This way in the history of the model you will find both the metrics indexed as “average_precision_at_k_1” and “average_precision_at_k_2” respectively.

Which metrics do I get?

You will get all the following metrics taken directly from Tensorflow. At the time of writing, the ones available are the following:

The non-parametric ones are (tested against their conterpart from sklearn):

  • auprc

  • auroc

  • false_negatives

  • false_positives

  • mean_absolute_error

  • mean_squared_error

  • precision

  • recall

  • root_mean_squared_error

  • true_negatives

  • true_positives

The parametric ones are (only execution is tested, no baseline in sklearn was available):

  • average_precision_at_k

  • precision_at_k

  • recall_at_k

  • sensitivity_at_specificity

  • specificity_at_sensitivity

Extras

I’ve created also another couple packages you might enjoy: one, called extra_keras_utils that contains some commonly used code for Keras projects and 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-1.3.0.tar.gz (7.2 kB view hashes)

Uploaded Source

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