No project description provided
Project description
landmark
landmark
is a Python package that constructs landmarks $L^\ast \subset X$ from a point set $X \subset \mathbb{R}^d$ or a metric space $(X, d_X)$ that approximate the metric k-center problem (also known k-center clustering problem):
$$ L^\ast \triangleq \mathop{\mathrm{argmin}}\limits_{\substack{L \subseteq X : \lvert L \rvert = k}} \ \max_{x \in X} d_X(x, L)$$
Metric $k$-center is a classic NP-hard problem intrinsically similar to other classical problems, such as geometric set cover and facility location; its output is also related to other geometric constructions, like r-nets and well-separated pair decompositions.
Below is an example a data set $X$ (blue points), some sample landmarks $L$ (red), along with the coverage (yellow) and packing (orange) properties they obey.
Installation
Clone and use:
python -m pip install < landmark-py location >
Warning: this package is very early-stage, e.g. does not offer wheels on PyPI. Use with care.
Usage
Given a point cloud $X \in \mathbb{R}^{n \times d}$ represented as a numpy matrix with $n$ points in $d$ dimensions, the indices of the landmarks can be found with the landmarks
function:
from landmark import landmarks
ind = landmarks(X, k = 25) ## Finds the indices of 25 landmarks
print(ind)
# [0, 32, 45, 16, ...]
The first $k$-indices of ind
are equivalent to the $k$-th prefix of the greedy permutation. You can get their covering radii by specifying radii = True
:
from landmark import landmarks
ind, radii = landmarks(X, k = 25, radii = True) ## Finds the indices of 25 landmarks
print(ind, radii)
# [0, 32, 45, 16, ...]
# [inf 31.6024 28.4495 20.3045 ...]
For more examples, see notebook example.
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
Built Distributions
Hashes for scikit_landmark-0.0.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb2462b7a842577775bcfc2256848f68661c364d48b839d927f1b16a1eb7a1bb |
|
MD5 | bfba864c222f0c293db2ff1b69795d91 |
|
BLAKE2b-256 | 9295380de444ab3033ba40ed2cae7e691d234cd42c72c65c2bb1f28dc282ffdc |
Hashes for scikit_landmark-0.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f418c1305e89e45937019a1d24d1a996f5bdc55d29966c3f2ff436f2e2b63df1 |
|
MD5 | 03ea9ec6b392ac848aee2307467a1214 |
|
BLAKE2b-256 | 0fc1de6a321d2b51b2c7342c43153d8e7a1054f692413a9849da613f21e6cbef |
Hashes for scikit_landmark-0.0.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95de4fe2cb169355b81e776819d4434371ee75b0e7f2c7e4187628a194be2790 |
|
MD5 | 10d7cc67ea0000f88d81a4daa33fe40d |
|
BLAKE2b-256 | 948eebff805714f5ccfc1e1ac8bea111b6804fa4dd24a415cd935642b72047f7 |
Hashes for scikit_landmark-0.0.5-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8289766305bf0a8dd661504b5017fd10f2383441f71e413a121d71f078fdb4fb |
|
MD5 | af3f7b921722be65f5ba70948171e99f |
|
BLAKE2b-256 | cbd1b5a56656df03d1f1f6167549b91d3b5b9e206f54387514338cbdac01be57 |
Hashes for scikit_landmark-0.0.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbfb730d623207ae769c15f3b3f4493af541a29d711cba26e0366932b2283bf7 |
|
MD5 | 97148d4e39f68ce7bddb8dc17d18a55c |
|
BLAKE2b-256 | 7729198605ce907c6b2a7d19232e4a145b8b6930d9fe592ecea0cd5627cb9d8b |
Hashes for scikit_landmark-0.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a84cf6241db9fb7d55053ca55e3e4fb347d5fb36ab1a82ccf7505e74efa2e1 |
|
MD5 | 841283236dcb1485e25a17f06d5eba2d |
|
BLAKE2b-256 | 905bff5a73eacf4381ec51424700a74b1e7b9099471d3b1dfc27d080f65f76c3 |
Hashes for scikit_landmark-0.0.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad9dc4408eec86042a0772fb8f033b4d6467d1a3137133fb55f5875d5485028 |
|
MD5 | 5102c64e4bbffd82213d8090e82031f3 |
|
BLAKE2b-256 | d7dd32047f6bd3b9a6dc65429b866c04daa5ecfb0079d480be3767c9b2c4d224 |
Hashes for scikit_landmark-0.0.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5a1933d85c47b4d8543e606d6830a42f114b39d1b32998786ed35f0d60a0b0 |
|
MD5 | e7a36437bf4dbd3715d8ee863b549507 |
|
BLAKE2b-256 | a7234e50c262bd5941a6943088cdbd5116c606be99c04cc1943e26f8e1011147 |
Hashes for scikit_landmark-0.0.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 797c75299555f7ca707d5b335a0f4287ae308739bbb726d90e43bc9f0eac4653 |
|
MD5 | 6c634a813269a30c1b537e0ee790e5fb |
|
BLAKE2b-256 | 9fcd51e50b10e35370fa6005e0c67e4e1b06f15431b0fd238e16febc4ee6dd58 |
Hashes for scikit_landmark-0.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6826038f07fffeeb9a47191e1b69fa206e8dce328d9364365798a334d411723 |
|
MD5 | 48a8a88c8458011b30c019ea3a6663d2 |
|
BLAKE2b-256 | 8b4bbdbfc242eb443a09281f52a0b20ad8edde7d8349d4da4acab9a6410ae9f3 |
Hashes for scikit_landmark-0.0.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e77491b048e7353068086803752ae67efbf258401bcb9278d885c25dc09793f |
|
MD5 | 7bb0350a45f2f9479fd0cb6b758f1059 |
|
BLAKE2b-256 | 4a94ea0a5534d2d004840de0eb161f84665f0612b51e47a565b6738968a003f3 |
Hashes for scikit_landmark-0.0.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc26f64bf255e24aa3b03d5dd157742984ec420a83b480e49327b58b2bb7f59a |
|
MD5 | 0cb8217fc00111be6844e59a902c7a0b |
|
BLAKE2b-256 | 62d8e2d483fdeef90f9628a4b4837340a034d7b76b1474541a671f9ab77b2d28 |
Hashes for scikit_landmark-0.0.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98ff520f36562a69e817b8c860a19d01f3579a28fa369958e1e14ff4277de0b1 |
|
MD5 | 9fdea237f08b71aab55df64ffc4a2722 |
|
BLAKE2b-256 | 3d3dc38ab262ba683573b293c78e9686eee18423f6200d7b53f820def2efc994 |
Hashes for scikit_landmark-0.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a2b6f463af05612111b8adb6ef4b671d13649181b4720b21f1a92121b41e3d |
|
MD5 | 26a6194c244b8418b1adbe9f73ad89ed |
|
BLAKE2b-256 | 06805ebb5a8a42bc69a6459eb3ffb35493ff7f069b7abb5bb368cf32162e7ab3 |
Hashes for scikit_landmark-0.0.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3a2169f8af0d3285f2d6be808882c60a795dd84ae3e55cbf72ef948e5f8363e |
|
MD5 | 68dd23c708f19ba07d7020a319bd86b4 |
|
BLAKE2b-256 | 8883348cb848fafb2b558471322a7a4faeb9d3f35c00e22213e1db513db51df6 |
Hashes for scikit_landmark-0.0.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc7172c360217a4c73323bb6874dae12d1e7a96907e9190baf0d20650d1d574 |
|
MD5 | e73cebe1854933ebea1cc7d688f194a9 |
|
BLAKE2b-256 | 340718c00ca980c9e7cec87147e19592303258d2a8a5637412b514121695786e |
Hashes for scikit_landmark-0.0.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4cccc0480bfaa58b5dfb21947c51b6dd2ffc5506a7bd28df39b6c9d66347aaf |
|
MD5 | 36a39417c7307bf07f90fa2688e31c27 |
|
BLAKE2b-256 | d839c53abc45a642e90086d6760bec6b6cedea50b43ac55558d2ee7ae1618a05 |
Hashes for scikit_landmark-0.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5350544e8bd65c9df265c324e7aca012ddb5043c105eabbf4c6b2f03f7f277a |
|
MD5 | 099d9eca5ab976704702592568439115 |
|
BLAKE2b-256 | 7866af3f8bcecb04911ab3663fbdcddfbe702ecb78e32ac349be9dfbd5eb3bb5 |
Hashes for scikit_landmark-0.0.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4731533d0acf636b26243d95a07e1e3433b614796a78d632af15330da268d75d |
|
MD5 | 8141d1049d0a59da7d95cd0860a75d76 |
|
BLAKE2b-256 | c270b949521bb10db19a7589a631d46fc4f9d6b0dcc1b88f8fb233f30d2d8ec6 |
Hashes for scikit_landmark-0.0.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a08cf97276119a102d0a4c35d011389be9432faada3419d2180ba22e83ec8be7 |
|
MD5 | 058fd933d1a8b7cef4d9ee58a85216a2 |
|
BLAKE2b-256 | 18c807a73c51c748c232d7ccaf0320eaee6dfd41fe6bba59faf50a9edd050e6e |