Scikit-learn
human-activity-recognition
wearable
wrist
time-series
cpu
scikit-learn
WISP / src /wisp /cli.py
Zipeng365's picture
wisp-har 0.3.0: scikit-learn interface, recipe catalog, Optuna search, cost-accuracy figures
4731b11 verified
Raw History Blame Contribute Delete
1.15 kB
"""``wisp`` command line: the 0.2.0 commands plus ``wisp recipes``.
``wisp list``, ``inventory``, ``predict``, ``evaluate``, ``family-fit``, ``select-fit`` and
``search`` are the 0.2.0 commands of ``wisp_release.cli`` (unchanged). ``wisp recipes``
prints the recipe catalog as JSON lines.
"""
from __future__ import annotations
import json
import sys
def _recipes(argv):
import argparse
from wisp import recipes
parser = argparse.ArgumentParser(prog="wisp recipes", description="Print the recipe catalog")
parser.add_argument("--source", choices=("fixed", "cis_subset", "search_best"))
args = parser.parse_args(argv)
for rid, recipe in recipes._catalog().items():
if args.source is None or recipe.source == args.source:
print(json.dumps(recipe.describe(), sort_keys=True))
return 0
def main(argv: list[str] | None = None) -> int:
argv = list(sys.argv[1:] if argv is None else argv)
if argv and argv[0] == "recipes":
return _recipes(argv[1:])
from wisp_release.cli import main as release_main
return release_main(argv)
if __name__ == "__main__":
raise SystemExit(main())