BaseMobilisedPipeline#

class mobgap.pipeline.base.BaseMobilisedPipeline[source]#

Base typing interface for Mobilised Pipelines.

This only defines the main attributes and methods, we expect the pipeline to have. For the actual implementation of the pipeline, see GenericMobilisedPipeline.

Attributes:
%(primary_results)s
%(perf_)s

See also

mobgap.pipeline.GenericMobilisedPipeline

The generic pipeline without predefined algorithms.

mobgap.pipeline.MobilisedPipelineHealthy

A predefined pipeline for healthy/mildly impaired walking.

mobgap.pipeline.MobilisedPipelineImpaired

A predefined pipeline for impaired walking.

Methods

clone()

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

get_params([deep])

Get parameters for this algorithm.

get_recommended_cohorts()

Get the recommended cohorts for this pipeline.

run(datapoint)

Run the pipeline.

safe_run(datapoint)

Run the pipeline with some additional checks.

set_params(**params)

Set the parameters of this Algorithm.

__init__(*args, **kwargs)#
clone() Self#

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]#

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.

Get the recommended cohorts for this pipeline.

Returns:
recommended_cohorts

The recommended cohorts for this pipeline or None

run(datapoint: DatasetT) Self#

Run the pipeline.

Note

It is usually preferred to use safe_run on custom pipelines instead of run, as safe_run can catch certain implementation errors of the run method.

Parameters:
datapoint

An instance of a tpcp.Dataset containing only a single datapoint. The structure of the data will depend on the dataset.

Returns:
self

The class instance with all result attributes populated

safe_run(
datapoint: DatasetT,
) Self#

Run the pipeline with some additional checks.

It is preferred to use this method over run, as it can catch some simple implementation errors of custom pipelines.

The following things are checked:

  • The run method must return self (or at least an instance of the pipeline)

  • The run method must set result attributes on the pipeline

  • All result attributes must have a trailing _ in their name

  • The run method must not modify the input parameters of the pipeline

Parameters:
datapoint

An instance of a tpcp.Dataset containing only a single datapoint. The structure of the data will depend on the dataset.

Returns:
self

The class instance with all result attributes populated

set_params(**params: Any) Self#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.

Examples using mobgap.pipeline.base.BaseMobilisedPipeline#

Custom Data and Datasets

Custom Data and Datasets

The Mobilise-D pipeline: Step-by-Step Breakdown

The Mobilise-D pipeline: Step-by-Step Breakdown

Preconfigured Mobilised Pipelines

Preconfigured Mobilised Pipelines

Revalidation of the Mobilise-D algorithm pipeline for cadence, stride length and walking speed estimation

Revalidation of the Mobilise-D algorithm pipeline for cadence, stride length and walking speed estimation

Performance of the gait sequences algorithm on the TVS dataset

Performance of the gait sequences algorithm on the TVS dataset

Performance of the cadence algorithms on the TVS dataset

Performance of the cadence algorithms on the TVS dataset