Distances and divergences between distributions implemented in python.
Project description
Distances and divergences between distributions implemented in python.
How do I install this package?
As usual, just download it using pip:
pip install dictances
Tests Coverage
Since some software handling coverages sometime get slightly different results, here’s three of them:
Available metrics
A number of distances and divergences are available:
Distances |
Methods |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Usage example
from dictances import cosine
cosine(my_first_dictionary, my_second_dictionary)
Handling nested dictionaries
If you need to compute the distance between two nested dictionaries you can use deflate_dict as follows:
from dictances import cosine
from deflate_dict import deflate
my_first_dictionary = {
"a": 8,
"b": {
"c": 3,
"d": 6
}
}
my_second_dictionary = {
"b": {
"c": 8,
"d": 1
},
"y": 3,
}
cosine(deflate(my_first_dictionary), deflate(my_second_dictionary))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file dictances-1.5.3.tar.gz
.
File metadata
- Download URL: dictances-1.5.3.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53afa67d5b361e3f8264960b8eba40d921f42a2e1cf7d02c5a7a6a9bc15f3c78 |
|
MD5 | 9f9bb5f9df579456f8553f1f972f8336 |
|
BLAKE2b-256 | bc22853350c297c53072229c2f94560464ec898fe5fc1fc708423ecbc9107bc7 |