Skip to main content

My equations (myeq)

Some simple useful math equations.

Distance

Equation to measure distances between values.

Inverse normalized sigmoid

from myeq.distance import inv_norm_sigmoid

def inv_norm_sigmoid(x: float, s: float = 0.3, t: float = 0.88, p: float = 3.3, adjust: bool = False) -> float:

This function is used to normalize a value that represents a distance using an inverted sigmoid function as following:

Inverse Normalized Sigmoid

I usually use this function to normalize the Levenshtein or another edition distance that is not normalized. This way, when the distance is small, the value is very close to 1, in the middle the value decreases very fast, but far away the velocity of decrease goes slower with the limit to 0. In the Levenshtein algorithm, this means that when the difference is small, the similarity value is very close to 1. But it quickly decreases when there are more text editions.

You can adjust the function parameters using the Inverse Normalized Sigmoid Demos web page.

Examples of usage:

from myeq.distance import inv_norm_sigmoid

print(inv_norm_sigmoid(0))  # Almost 1: 0.9999853027487737)
print(inv_norm_sigmoid(1))  # Close to 1: 0.9999910856079368)
print(inv_norm_sigmoid(3))  # Start to reduce quickly: 0.7633315491944042)
print(inv_norm_sigmoid(5))  # Very low: 0.12000003643145052)        

The adjust parameter is to force the value 1 when the distance is 0, for example:

from myeq.distance import inv_norm_sigmoid

print(inv_norm_sigmoid(0, adjust=True))  # Exactly 1.0)

Metadata

Release files for myeq 0.0.4

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

Source distribution (sdist)

Source distribution for myeq 0.0.4
File Size Uploaded Provenance Actions
myeq-0.0.4.tar.gz 2.7 kB Without provenance Details for myeq-0.0.4.tar.gz

Release files / myeq-0.0.4.tar.gz

Download URL myeq-0.0.4.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6ecec7cbb572946535557ddcfcc6d625783ea146b1497122b1c8a72ba6a7b829
BLAKE2b-256 checksum
How to use checksums
1e776f850fc11dd89e76a9aa8d15ae45114ad97b1fa80129aabc4eb5e51445df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.3

Security for myeq 0.0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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