Metrics for Keras model evaluation
Project description
Keras Metrics
This package provides metrics for evaluation of Keras classification models. The metrics are safe to use for batch-based model evaluation.
Installation
To install the package from the PyPi repository you can execute the following command:
pip install keras-metrics
Usage
The usage of the package is simple:
import keras
import keras_metrics
model = models.Sequential()
model.add(keras.layers.Dense(1, activation="sigmoid", input_dim=2))
model.add(keras.layers.Dense(1, activation="softmax"))
model.compile(optimizer="sgd",
loss="binary_crossentropy",
metrics=[keras_metrics.precision(), keras_metrics.recall()])
Similar configuration for multi-label binary crossentropy:
import keras
import keras_metrics
model = models.Sequential()
model.add(keras.layers.Dense(1, activation="sigmoid", input_dim=2))
model.add(keras.layers.Dense(2, activation="softmax"))
# Calculate precision for the second label.
precision = keras_metrics.precision(label=1)
# Calculate recall for the first label.
recall = keras_metrics.precision(label=0)
model.compile(optimizer="sgd",
loss="binary_crossentropy",
metrics=[precision, recall])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
keras-metrics-0.0.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for keras_metrics-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ee3885e16e7dc475f05531905f9c9bb36b0ee5ae0f6ca2e17c0d1494711d6c |
|
MD5 | fe18ac2a8495362a95658f76c4b20d1d |
|
BLAKE2b-256 | b94ad0712f64b9763689f5b579fb95430e53f773b600fb4f1bbd2771924e4b41 |