Skip to main content

PERMETRICS


GitHub release PyPI version PyPI - Python Version PyPI - Status PyPI - Downloads Downloads Tests & Publishes to PyPI GitHub Release Date Documentation Status Chat DOI JOSS License: GPL v3

PerMetrics is a python library for performance metrics of machine learning models. We aim to implement all performance metrics for problems such as regression, classification, clustering, ... problems. Helping users in all field access metrics as fast as possible. The number of available metrics include 112 (48 regression metrics, 20 classification metrics, 44 clustering metrics)

Citation Request

Please include these citations if you plan to use this library:

  • LaTeX:

    @article{Thieu_PerMetrics_A_Framework_2024,
     author = {Thieu, Nguyen Van},
     doi = {10.21105/joss.06143},
     journal = {Journal of Open Source Software},
     month = mar,
     number = {95},
     pages = {6143},
     title = {{PerMetrics: A Framework of Performance Metrics for Machine Learning Models}},
     url = {https://joss.theoj.org/papers/10.21105/joss.06143},
     volume = {9},
     year = {2024}
    }
    
  • APA:

    Thieu, N. V. (2024). PerMetrics: A Framework of Performance Metrics for Machine Learning Models. Journal of Open Source Software, 9(95), 6143. https://doi.org/10.21105/joss.06143

Installation

Install the current PyPI release:

$ pip install permetrics

After installation, you can import Permetrics as any other Python module:

$ python
>>> import permetrics
>>> permetrics.__version__

Example

Below is the most efficient and effective way to use this library compared to other libraries. The example below returns the values of metrics such as root mean squared error, mean absolute error...

from permetrics import RegressionMetric

y_true = [3, -0.5, 2, 7]
y_pred = [2.5, 0.0, 2, 8]

evaluator = RegressionMetric(y_true, y_pred)
results = evaluator.get_metrics_by_list_names(["RMSE", "MAE", "MAPE", "R2", "NSE", "KGE"])
print(results["RMSE"])
print(results["KGE"])

In case your y_true and y_pred data have multiple columns, and you want to return multiple outputs, something that other libraries cannot do, you can do it in Permetrics as follows:

import numpy as np
from permetrics import RegressionMetric

y_true = np.array([[0.5, 1], [-1, 1], [7, -6]])
y_pred = np.array([[0, 2], [-1, 2], [8, -5]])

evaluator = RegressionMetric(y_true, y_pred)

## The 1st way
results = evaluator.get_metrics_by_dict({
  "RMSE": {"multi_output": "raw_values"},
  "MAE": {"multi_output": "raw_values"},
  "MAPE": {"multi_output": "raw_values"},
})

## The 2nd way
results = evaluator.get_metrics_by_list_names(
  list_metric_names=["RMSE", "MAE", "MAPE", "R2", "NSE", "KGE"],
  list_paras=[{"multi_output": "raw_values"},] * 6
)

## The 3rd way
result01 = evaluator.RMSE(multi_output="raw_values")
result02 = evaluator.MAE(multi_output="raw_values")

The more complicated cases in the folder: examples. You can also read the documentation for more detailed installation instructions, explanations, and examples.

Contributing

There are lots of ways how you can contribute to Permetrics's development, and you are welcome to join in! For example, you can report problems or make feature requests on the issues pages. To facilitate contributions, please check for the guidelines in the CONTRIBUTING.md file.

Official channels

Note

  • Currently, there is a huge misunderstanding among frameworks around the world about the notation of R, R2, and R^2.

  • Please read the file R-R2-Rsquared.docx to understand the differences between them and why there is such confusion.

  • My recommendation is to denote the Coefficient of Determination as COD or R2, while the squared Pearson's Correlation Coefficient should be denoted as R^2 or RSQ (as in Excel software).


Developed by: Thieu @ 2023

Release files for permetrics 2.1.0

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

Source distribution (sdist)

Source distribution for permetrics 2.1.0
File Size Uploaded
permetrics-2.1.0.tar.gz 61.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for permetrics 2.1.0
File Interpreter ABI Platform
permetrics-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 118.7 kB

Release files / permetrics-2.1.0.tar.gz

Download URL permetrics-2.1.0.tar.gz
Size 61.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c0b5456d78169cf48e939356197743ac962a54c439472e9a8cd6ef564da57471
BLAKE2b-256 checksum
How to use checksums
3ba6df8e15c34b199e363358ffbdc5cebe273f937f4f9069004f44f37a464110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release files / permetrics-2.1.0-py3-none-any.whl

Download URL permetrics-2.1.0-py3-none-any.whl
Size 57.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e18f3ada1ab3af114e1b5f8be9214e59925f4887b0fc8e561bd45df62b59a2a
BLAKE2b-256 checksum
How to use checksums
829ece265b3ef8d022ceefe2e673a611f29fc800fad0587f1f600ee24bf83dc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.5.0

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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