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,
Evaluation challenge for Gait Sequence Detection (GSD) algorithms.
This challenge applies the GSD algorithm wrapped in a
GsdEmulationPipelineto each datapoint in a dataset with reference information usingvalidate. 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
GsdEvaluationCVfor 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 exceptpipeline,dataset,scoring. Typical usecase is to setn_jobsto 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 viavalidate_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,
- 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,
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.