Skip to main content
# Example Usage
```
import numpy as np
from nn_error_metrics import (
mean_absolute_percentage_error,
mean_absolute_error,
mean_squared_error,
root_mean_squared_error,
binary_cross_entropy,
categorical_correntropy,
sparse_categorical_crossentropy
)

actual = np.array([10, 20, 30, 40, 50])
predicted = np.array([12, 18, 28, 41, 48])

print("Mean Absolute Percentage Error (MAPE):", mean_absolute_percentage_error(actual, predicted))
print("Mean Absolute Error (MAE):", mean_absolute_error(actual, predicted))
print("Mean Squared Error (MSE):", mean_squared_error(actual, predicted))
print("Root Mean Squared Error (RMSE):", root_mean_squared_error(actual, predicted))

actual = np.array([1, 0, 1, 1, 0])
predicted = np.array([0.9, 0.2, 0.8, 0.6, 0.3])
print("Binary Cross Entropy (BCE):", binary_cross_entropy(actual, predicted))

actual = np.array([[0, 1], [1, 0], [0, 1], [0, 1], [1, 0]])
predicted = np.array([[0.1, 0.9], [0.8, 0.2], [0.3, 0.7], [0.6, 0.4], [0.9, 0.1]])
print("Categorical Correntropy (CC):", categorical_correntropy(actual, predicted))

actual = np.array([1, 0, 1, 1, 0])
predicted = np.array([[0.1, 0.9], [0.8, 0.2], [0.3, 0.7], [0.6, 0.4], [0.9, 0.1]])
print("Sparse Categorical Correntropy (SCC):", sparse_categorical_crossentropy(actual, predicted))

```

Metadata

Release files for nn-error-metrics 1.0.1

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

Source distribution (sdist)

Source distribution for nn-error-metrics 1.0.1
File Size Uploaded
nn_error_metrics-1.0.1.tar.gz 2.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nn-error-metrics 1.0.1
File Interpreter ABI Platform
nn_error_metrics-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.9 kB

Release files / nn_error_metrics-1.0.1.tar.gz

Download URL nn_error_metrics-1.0.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9239bedd1e65913d6c93e116a6dd6b34812049a7fa614cc2e7b3fe96315c647a
BLAKE2b-256 checksum
How to use checksums
c667934812fb976f37f6e25cd1c7d2fbed56a79bf3d37097f5ab6545f1c6a910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release files / nn_error_metrics-1.0.1-py3-none-any.whl

Download URL nn_error_metrics-1.0.1-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aab54ca0a09ef59a99dcbf7e204d9014bd588ef940583f475b0c4f360b5aab52
BLAKE2b-256 checksum
How to use checksums
27cc3eb392132c5c3817906cbd4e2208729844b010de013da82fb4770c95ffcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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