.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/gait_sequences/_05_tvs_evaluation_no_exc.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_gait_sequences__05_tvs_evaluation_no_exc.py: GSD TVS Evaluation ================== This script shows the actual performance evaluation that is run to benchmark the GSD algorithms on the TVS dataset. As this is run on the TVS dataset and has a long runtime, this example needs to be downloaded and run locally. .. GENERATED FROM PYTHON SOURCE LINES 7-30 .. code-block:: default import os from pathlib import Path from joblib import Memory from mobgap import PACKAGE_ROOT from mobgap.data import TVSFreeLivingDataset if "MOBGAP_TVS_DATASET_PATH" not in os.environ: raise ValueError( "Please set the environmental variable MOBGAP_TVS_DATASET_PATH to the path of the TVS dataset." ) dataset_path = Path(os.getenv("MOBGAP_TVS_DATASET_PATH")) n_jobs = os.environ.get("MOBGAP_N_JOBS", 1) free_living_data = TVSFreeLivingDataset( dataset_path, reference_system="INDIP", memory=Memory(PACKAGE_ROOT.parent / ".cache"), missing_reference_error_type="skip", ).get_subset(recording="Recording4") .. GENERATED FROM PYTHON SOURCE LINES 31-32 Run the non-CV evaluation for all implemented algorithms .. GENERATED FROM PYTHON SOURCE LINES 32-49 .. code-block:: default from mobgap.gait_sequences import GsdAdaptiveIonescu, GsdIluz, GsdIonescu from mobgap.gait_sequences.pipeline import ( GsdEmulationPipeline, GsdEvaluation, gsd_evaluation_scorer, ) results = {} for algo in (GsdIluz(), GsdIonescu(), GsdAdaptiveIonescu()): print(f"Running evaluation for {algo.__class__.__name__}") pipe = GsdEmulationPipeline(algo) eval_pipe = GsdEvaluation( free_living_data, scoring=gsd_evaluation_scorer, validate_paras={"n_jobs": n_jobs}, ).run(pipe) results[algo.__class__.__name__] = eval_pipe.results_ .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) **Estimated memory usage:** 0 MB .. _sphx_glr_download_auto_examples_gait_sequences__05_tvs_evaluation_no_exc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: _05_tvs_evaluation_no_exc.py <_05_tvs_evaluation_no_exc.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: _05_tvs_evaluation_no_exc.ipynb <_05_tvs_evaluation_no_exc.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_