Skip to main content

A framework of PERformance METRICS (PerMetrics) for artificial intelligence models

Project description

A framework of PERformance METRICS (PerMetrics) for artificial intelligence models

GitHub release Documentation Status Wheel PyPI version DOI License


"Knowledge is power, sharing it is the premise of progress in life. It seems like a burden to someone, but it is the only way to achieve immortality." --- Thieu Nguyen


Introduction

  • PerMetrics is a python library for performance metrics of artificial intelligence models.

  • The goals of this framework are:

    • Combine all metrics for regression, classification and clustering models
    • Helping users in all field access to metrics as fast as possible
    • Perform Qualitative Analysis of models.
    • Perform Quantitative Analysis of models.
  • Metrics

Problem STT Metric Metric Fullname Characteristics
Regression 1 EVS Explained Variance Score Larger is better (Best = 1)
2 ME Max Error Smaller is better (Best = 0)
3 MAE Mean Absolute Error Smaller is better (Best = 0)
4 MSE Mean Squared Error Smaller is better (Best = 0)
5 RMSE Root Mean Squared Error Smaller is better (Best = 0)
6 MSLE Mean Squared Log Error Smaller is better (Best = 0)
7 MedAE Median Absolute Error Smaller is better (Best = 0)
8 MRE Mean Relative Error Smaller is better (Best = 0)
9 MAPE Mean Absolute Percentage Error Smaller is better (Best = 0)
10 SMAPE Symmetric Mean Absolute Percentage Error Smaller is better (Best = 0)
11 MAAPE Mean Arctangent Absolute Percentage Error Smaller is better (Best = 0)
12 MASE Mean Absolute Scaled Error Smaller is better (Best = 0)
13 NSE Nash-Sutcliffe Efficiency Coefficient Larger is better (Best = 1)
14 WI Willmott Index Larger is better (Best = 1)
15 R Pearson’s Correlation Index Larger is better (Best = 1)
16 CI Confidence Index Larger is better (Best = 1)
17 R2 Coefficient of Determination Larger is better (Best = 1)
18 R2s (Pearson’s Correlation Index) ^ 2 Larger is better (Best = 1)
19 DRV Deviation of Runoff Volume Smaller is better (Best = 0)
20 KGE Kling-Gupta Efficiency Larger is better (Best = 1)
Classification 1
Clustering 1

Dependencies

  • Python (>= 3.6)
  • Numpy (>= 1.15.1)

User installation

Install the current PyPI release:

pip install permetrics

Or install the development version from GitHub:

pip install git+https://github.com/thieu1995/permetrics

Example

  • All you need to do is: (Make sure your y_true and y_pred is a numpy array)
* Simple example:

## For example with RMSE:

    from numpy import array
    from permetrics.regression import Metrics

    ## For 1-D array
    y_true = array([3, -0.5, 2, 7])
    y_pred = array([2.5, 0.0, 2, 8])

    obj1 = Metrics(y_true, y_pred)
    print(obj1.rmse_func(clean=True, decimal=5))

    ## For > 1-D array
    y_true = array([[0.5, 1], [-1, 1], [7, -6]])
    y_pred = array([[0, 2], [-1, 2], [8, -5]])

    multi_outputs = [None, "raw_values", [0.3, 1.2], array([0.5, 0.2]), (0.1, 0.9)]
    obj2 = Metrics(y_true, y_pred)
    for multi_output in multi_outputs:
        print(obj2.rmse_func(clean=False, multi_output=multi_output, decimal=5))

* Or run the simple:
    python examples/RMSE.py

* The more complicated tests in the folder: examples

The documentation includes more detailed installation instructions and explanations.

Changelog

  • See the ChangeLog.md for a history of notable changes to permetrics.

Important links

Contributions

Citation

  • If you use permetrics in your project, please cite my works:
@software{thieu_nguyen_2020_3951205,
  author       = {Thieu Nguyen},
  title        = {A framework of PERformance METRICS (PerMetrics) for artificial intelligence models},
  month        = jul,
  year         = 2020,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.3951205},
  url          = {https://doi.org/10.5281/zenodo.3951205}
}

@article{nguyen2019efficient,
  title={Efficient Time-Series Forecasting Using Neural Network and Opposition-Based Coral Reefs Optimization},
  author={Nguyen, Thieu and Nguyen, Tu and Nguyen, Binh Minh and Nguyen, Giang},
  journal={International Journal of Computational Intelligence Systems},
  volume={12},
  number={2},
  pages={1144--1161},
  year={2019},
  publisher={Atlantis Press}
}

Download files

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

Source Distribution

permetrics-1.0.3.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

permetrics-1.0.3-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file permetrics-1.0.3.tar.gz.

File metadata

  • Download URL: permetrics-1.0.3.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for permetrics-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6b5523df3602297602a61ab7a907c736f7da7938c462d519303c3050b1af5973
MD5 391e28088f09c9e35410d3d99d9e48b0
BLAKE2b-256 6af1261e9a936254f10469e662ff767560f0816fc2d43e53969b86572e1aa3bf

See more details on using hashes here.

File details

Details for the file permetrics-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: permetrics-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for permetrics-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea1938b2298c551febf716448eff119acd99e7becd5e5bea48a568faff0d17b1
MD5 e634010cca500e5b5d7bb13e980f65c9
BLAKE2b-256 eccd8de77b15dfa12b3d7bcd15ab8042fb6c864b392659ce2a81acc20e14adea

See more details on using hashes here.

Supported by

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