# 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))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/arif-x/nn-error_metrics",
"name": "nn-error-metrics",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "nn neural-network metrics nn-error_metrics",
"author": "Ariffudin",
"author_email": "sudo.ariffudin@email.com",
"download_url": "https://files.pythonhosted.org/packages/c6/67/934812fb976f37f6e25cd1c7d2fbed56a79bf3d37097f5ab6545f1c6a910/nn_error_metrics-1.0.1.tar.gz",
"platform": null,
"description": "# Example Usage\n```\nimport numpy as np\nfrom nn_error_metrics import (\n mean_absolute_percentage_error,\n mean_absolute_error,\n mean_squared_error,\n root_mean_squared_error,\n binary_cross_entropy,\n categorical_correntropy,\n sparse_categorical_crossentropy\n)\n\nactual = np.array([10, 20, 30, 40, 50])\npredicted = np.array([12, 18, 28, 41, 48])\n\nprint(\"Mean Absolute Percentage Error (MAPE):\", mean_absolute_percentage_error(actual, predicted))\nprint(\"Mean Absolute Error (MAE):\", mean_absolute_error(actual, predicted))\nprint(\"Mean Squared Error (MSE):\", mean_squared_error(actual, predicted))\nprint(\"Root Mean Squared Error (RMSE):\", root_mean_squared_error(actual, predicted))\n\nactual = np.array([1, 0, 1, 1, 0])\npredicted = np.array([0.9, 0.2, 0.8, 0.6, 0.3])\nprint(\"Binary Cross Entropy (BCE):\", binary_cross_entropy(actual, predicted))\n\nactual = np.array([[0, 1], [1, 0], [0, 1], [0, 1], [1, 0]])\npredicted = np.array([[0.1, 0.9], [0.8, 0.2], [0.3, 0.7], [0.6, 0.4], [0.9, 0.1]])\nprint(\"Categorical Correntropy (CC):\", categorical_correntropy(actual, predicted))\n\nactual = np.array([1, 0, 1, 1, 0])\npredicted = np.array([[0.1, 0.9], [0.8, 0.2], [0.3, 0.7], [0.6, 0.4], [0.9, 0.1]])\nprint(\"Sparse Categorical Correntropy (SCC):\", sparse_categorical_crossentropy(actual, predicted))\n\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A collection of neural network machine learning error metrics.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/arif-x/nn-error_metrics",
"Source": "https://github.com/arif-x/nn-error_metrics",
"Source Code": "https://github.com/arif-x/nn-error_metrics"
},
"split_keywords": [
"nn",
"neural-network",
"metrics",
"nn-error_metrics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "27cc3eb392132c5c3817906cbd4e2208729844b010de013da82fb4770c95ffcd",
"md5": "54cde295baf3dcbdfe48eb85d70422c2",
"sha256": "aab54ca0a09ef59a99dcbf7e204d9014bd588ef940583f475b0c4f360b5aab52"
},
"downloads": -1,
"filename": "nn_error_metrics-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "54cde295baf3dcbdfe48eb85d70422c2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2828,
"upload_time": "2024-03-29T15:16:06",
"upload_time_iso_8601": "2024-03-29T15:16:06.250799Z",
"url": "https://files.pythonhosted.org/packages/27/cc/3eb392132c5c3817906cbd4e2208729844b010de013da82fb4770c95ffcd/nn_error_metrics-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c667934812fb976f37f6e25cd1c7d2fbed56a79bf3d37097f5ab6545f1c6a910",
"md5": "58c391d2ab691f2d48e17b2f8b0faf0f",
"sha256": "9239bedd1e65913d6c93e116a6dd6b34812049a7fa614cc2e7b3fe96315c647a"
},
"downloads": -1,
"filename": "nn_error_metrics-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "58c391d2ab691f2d48e17b2f8b0faf0f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2108,
"upload_time": "2024-03-29T15:16:08",
"upload_time_iso_8601": "2024-03-29T15:16:08.369304Z",
"url": "https://files.pythonhosted.org/packages/c6/67/934812fb976f37f6e25cd1c7d2fbed56a79bf3d37097f5ab6545f1c6a910/nn_error_metrics-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-29 15:16:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "arif-x",
"github_project": "nn-error_metrics",
"github_not_found": true,
"lcname": "nn-error-metrics"
}