METRIC-PY
A python wrapper for METRIC library (https://panda.technology/de/metric)
Installation
You need Python 3.6+
Linux & OS X
python -m pip install metric-py -i https://test.pypi.org/simple/
Windows (x64 only)
You will need to install any BLAS implementation. The easiest way is by using Miniconda:
conda config --add channels conda-forge
conda update -n base conda -y
conda install -c conda-forge libopenblas openblas -y
Then you can use pip to install
python -m pip install metric-py -i https://test.pypi.org/simple/
Build from the source
git clone --recurse-submodules https://github.com/panda-official/metric
Download and extract Boost (1.67+). For Windows there are pre-build binaries available.
Install Prerequisites
Ubuntu
sudo apt-get install cmake
sudo apt-get install libboost-all-dev
sudo apt-get install libopenblas-dev
Windows
Install Miniconda. In Conda CLI initialize your virtual environment with desired Python version:
conda create --name my_env -y python=3.8
conda activate my_env
Install OpenBLAS from alternative repo
conda config --add channels conda-forge
conda update -n base conda -y
conda install -c conda-forge libopenblas openblas -y
Build package
At least 2GB of RAM is required
python setup.py bdist_wheel
to limit memory usage during build add MAKE="make -j1":
MAKE="make -j1" python3 setup.py bdist_wheel
Install module
python -m pip install dist/*
Examples
import numpy
from metric.correlation import Entropy
from metric.distance import Euclidean, P_norm, Manhatten
aent = numpy.float_([
[5.0, 5.0],
[2.0, 2.0],
[3.0, 3.0],
[5.0, 1.0],
])
print("Entropies:")
for metric in (Euclidean, P_norm, Manhatten):
res = Entropy(metric=metric(), p=3, k=2)(aent)
print(f'using {metric}: {res:.5f}')
res = Entropy(p=3, k=2)(aent)
print(f'using Default: {res:.5f}')
for more examples please check examples/ folder
Metadata
Release files for metric-py 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| metric_py-0.0.6-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details |
| metric_py-0.0.6-cp38-cp38-manylinux2014_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.17+ x86-64 | Details |
| metric_py-0.0.6-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details |
| metric_py-0.0.6-cp37-cp37m-manylinux2014_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.17+ x86-64 | Details |
| metric_py-0.0.6-cp36-cp36m-win_amd64.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-64 | Details |
| metric_py-0.0.6-cp36-cp36m-manylinux2014_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.17+ x86-64 | Details |
Total release size: 43.2 MB
Release files / metric_py-0.0.6-cp38-cp38-win_amd64.whl
| Download URL | metric_py-0.0.6-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
29ad6a7617068ece99d786dcdc941bd2fb22ee04a4e2b9f28e1e7417b210ccf8
|
|
BLAKE2b-256 checksum How to use checksums |
4f322adf80843a4fbb65ded2c33e0dd09da8b53a808dac96ce937ae5f3aeae2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / metric_py-0.0.6-cp38-cp38-manylinux2014_x86_64.whl
| Download URL | metric_py-0.0.6-cp38-cp38-manylinux2014_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
23183069ebaf6d319ec3596f0dd29db4725b610538d8a4a9e40f637242a41971
|
|
BLAKE2b-256 checksum How to use checksums |
485aef2c545233218c5992aeb83b65c2d124aa4814721c53168f13b3062493e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/2.7.12
|
Release files / metric_py-0.0.6-cp37-cp37m-win_amd64.whl
| Download URL | metric_py-0.0.6-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9f6e312a112ebf923cf7ccf5b507a90f755623c4f1550216ecfd13483f48101c
|
|
BLAKE2b-256 checksum How to use checksums |
b4fc772ec71252477bc4bfbcd45ec4bc39e9849dbb0d68f3aeb64ae0e786d7bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6
|
Release files / metric_py-0.0.6-cp37-cp37m-manylinux2014_x86_64.whl
| Download URL | metric_py-0.0.6-cp37-cp37m-manylinux2014_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e1e9e3d30d2ab8900452e1deb72f0bbd0f4f41e7fc24f498eec7faa2d13bad6d
|
|
BLAKE2b-256 checksum How to use checksums |
a653c0425a0cfa759fcbd0ce8f1c32d389d01d87c1005306f88f377262ad5474
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/2.7.12
|
Release files / metric_py-0.0.6-cp36-cp36m-win_amd64.whl
| Download URL | metric_py-0.0.6-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c89bf8a5f02bf866974507b381c5b75091d8a50d50c08646ba15931fddc93816
|
|
BLAKE2b-256 checksum How to use checksums |
375470b65ac4e122c4826011f87ee7e525780bfd589e1950b8c6a4c0d9e43073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0.post20200511 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
|
Release files / metric_py-0.0.6-cp36-cp36m-manylinux2014_x86_64.whl
| Download URL | metric_py-0.0.6-cp36-cp36m-manylinux2014_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5e6958f1e10790aef5b48eb0850758ae935cdfc2028235e84c21f03b08add986
|
|
BLAKE2b-256 checksum How to use checksums |
e29f8bdbb0176c1c2f1cff8f86e9ab49c73968e1be609a4f15f3c456f1b3074a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/2.7.12
|