Metadata-Version: 2.5
Name: inertia-client
Version: 0.1.0
Summary: Submit labels to the inertia challenge, a scoreboard for k-means
Project-URL: Homepage, https://github.com/cakedev0/the-inertia-challenge
Project-URL: Issues, https://github.com/cakedev0/the-inertia-challenge/issues
Author: Arthur Lacote
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: benchmark,clustering,inertia,k-means
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: inertia-scorer>=0.1.0
Requires-Dist: numpy
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# inertia-client

Submit labels to [the inertia challenge](../../README.md): `inertia-client` and
the `inertia_client` Python package.

```bash
inertia-client login
inertia-client submit sift_128 sift_128.npz --time 100=23.21 --hardware "M2, 8 cores" --tag algorithm=Lloyd
inertia-client status <id> --wait
```

`login` identifies you with GitHub. It gives a code to enter on github.com and
keeps a token in `~/.config/the-inertia-challenge/github-token`. The token can
only tell who you are: it gives no access to your repositories.

`submit` checks the file as the server will, without the dataset, then asks
before sending it: the server takes one submission per day and per dataset.
`check` only does the check. An upload that was stopped resumes with
`inertia-client resume <id> FILE`, for 6 hours.

`--time`, `--hardware` and `--tag` are what you say about the submission. They
are shown on the scoreboard as you give them. The time is for one number of
clusters: give `--time` once for each of them.

`--submit-only-improvement` scores the labels on your side (with
`inertia-scorer`, so the dataset must be downloaded, see `--data-dir`) and
compares each number of clusters to your best published score on the
scoreboard. The numbers of clusters that do not improve on it are not sent, and
nothing is sent when none does. A number of clusters where you have no score yet
is sent. Your scores are the ones of your GitHub login, and only the scores that
the listener published count: the ones less than 10% above the best.

From Python:

```python
import inertia_client

inertia_client.submit(
    "sift_128", {100: labels}, time_s={100: 23.21}, hardware="M2, 8 cores"
)
# Only the numbers of clusters that beat your best score; None if none does.
inertia_client.submit("sift_128", {100: labels}, submit_only_improvement=True)
```
