Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antononcube/raku-math-distancefunctions
Raku package for the computation of various distance functions.
https://github.com/antononcube/raku-math-distancefunctions
bray-curtis-distance canberra-distance cosine-distance distance-functions euclidean-distance hamming-distance manhattan-distance raku
Last synced: about 2 months ago
JSON representation
Raku package for the computation of various distance functions.
- Host: GitHub
- URL: https://github.com/antononcube/raku-math-distancefunctions
- Owner: antononcube
- License: artistic-2.0
- Created: 2024-05-31T21:49:34.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-25T18:54:06.000Z (2 months ago)
- Last Synced: 2024-11-25T19:41:28.063Z (2 months ago)
- Topics: bray-curtis-distance, canberra-distance, cosine-distance, distance-functions, euclidean-distance, hamming-distance, manhattan-distance, raku
- Language: Raku
- Homepage: https://raku.land/zef:antononcube/Math::DistanceFunctions
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-work.md
- License: LICENSE
Awesome Lists containing this project
README
# Math::DistanceFunctions
Raku package with a collection of mathematical distance functions and a corresponding role.
The content of this package was "factored out" from
["ML::Clustering"](https://raku.land/zef:antononcube/ML::Clustering), [AAp1].Faster versions of these functions are implemented in
["Math::DistanceFunctions::Native"](https://github.com/antononcube/Raku-Math-DistanceFunctions-Native), [AAp2].A special package has the "edit distance" (aka Damerau-Levenshtein distance) -- see
["Math::DistanceFunctions::Edit"](https://github.com/antononcube/Raku-Math-DistanceFunctions-Edit), [AAp3].------
## Installation
From Zef ecosystem:
```
zef install Math::DistanceFunctions
```From GitHub:
```
zef install https://github.com/antononcube/Raku-Math-DistanceFunctions.git
```-----
## Usage examples
```perl6
use Math::DistanceFunctions;my @v1 = 10.rand xx 10;
my @v2 = 2.rand xx 10;my @funcs = [
:&bray-curtis-distance,
:&canberra-distance,
:&chessboard-distance,
:&cosine-distance,
:&dot-product,
:&euclidean-distance,
:&hamming-distance,
:&manhattan-distance,
:&squared-euclidean-distance
];for @funcs -> $p {
say "{$p.key} : {$p.value.(@v1, @v2)}";
}
```-----
## References
[AAp1] Anton Antonov, [ML:Clustering Raku package](https://github.com/antononcube/Raku-ML-Clustering), (2022), [GitHub/antononcube](https://github.com/antononcube).
[AAp2] Anton Antonov,
[Math::DistanceFunctions::Edit Raku package](https://github.com/antononcube/Raku-Math-DistanceFunctions-Edit),
(2024),
[GitHub/antononcube](https://github.com/antononcube).[AAp3] Anton Antonov,
[Math::DistanceFunctions::Native Raku package](https://github.com/antononcube/Raku-Math-DistanceFunctions-Native),
(2024),
[GitHub/antononcube](https://github.com/antononcube).