GsdEvaluation#

class mobgap.gait_sequences.evaluation.GsdEvaluation(
dataset: ~mobgap.data.base.BaseGaitDatasetWithReference,
scoring: ~typing.Callable | None = <function gsd_evaluation_scorer>,
*,
validate_paras: dict | None = None,
)[source]#

Evaluation challenge for Gait Sequence Detection (GSD) algorithms.

This challenge applies the GSD algorithm wrapped in a GsdEmulationPipeline to each datapoint in a dataset with reference information using validate. For each datapoint the provided scoring function is called and performance results are aggregated.

This is a suitable approach, when you want to evaluate and compare algorithms that are not “trainable” in any way. For example, traditional algorithms or pre-trained models. Note, that if you are planning to compare algorithms that are trainable with non-trainable algorithms, you should use the GsdEvaluationCV for all of them.

Parameters:
dataset

A gait dataset with reference information. Evaluation is performed across all datapoints within the dataset.

scoring

A scoring function that evaluates the performance of the algorithm on a single datapoint. It should take a pipeline and a datapoint as input, run the pipeline on the datapoint and return a dictionary of performance metrics. These performance metrics are then aggregated across all datapoints.

validate_paras

Dictionary with further parameters that are directly passed to validate. This can overwrite all parameters except pipeline, dataset, scoring. Typical usecase is to set n_jobs to activate multiprocessing.

Other Parameters:
pipeline

The pipeline passed to the run method.

Attributes:
results_

Dictionary with all results of the validation. The results are returned by validate. You can control what information is provided via validate_paras

start_datetime_utc_timestamp_

The start time of the evaluation as UTC timestamp.

start_datetime_

The start time of the evaluation as human readable string.

end_datetime_utc_timestamp_

The end time of the evaluation as UTC timestamp.

end_datetime_

The end time of the evaluation as human readable string.

runtime_s_

The runtime of the evaluation in seconds. Note, that the runtime might not be exactly the difference between the start and the end time. The runtime is independently calculated using time.perf_timer.

Methods

clone()

Create a new instance of the class with all parameters copied over.

get_params([deep])

Get parameters for this algorithm.

run(pipeline)

Run the evaluation challenge.

set_params(**params)

Set the parameters of this Algorithm.

__init__(
dataset: ~mobgap.data.base.BaseGaitDatasetWithReference,
scoring: ~typing.Callable | None = <function gsd_evaluation_scorer>,
*,
validate_paras: dict | None = None,
) None[source]#
clone() Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

get_params(deep: bool = True) dict[str, Any][source]#

Get parameters for this algorithm.

Parameters:
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns:
params

Parameter names mapped to their values.

run(
pipeline: GsdEmulationPipeline,
) Self[source]#

Run the evaluation challenge.

This will call the pipeline for each datapoint in the dataset and evaluate the performance using the provided scoring function.

Parameters:
pipeline

A valid pipeline that wraps a GSD algorithm that is compatible with the provided dataset and scorer. Usually that should be a GsdEmulationPipeline.

Returns:
self

The instance of the class with the results_ attribute set to the results of the validation.

set_params(**params: Any) Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.

Examples using mobgap.gait_sequences.evaluation.GsdEvaluation#

GSD Evaluation Challenges

GSD Evaluation Challenges