gaitmap.data_transform.TrainableStandardScaler#
- class gaitmap.data_transform.TrainableStandardScaler(mean: float | None = None, std: float | None = None, ddof: int = 1)[source]#
Apply a standard scaling to the data.
The transformed data y is calculated as:
- Parameters:
- mean
The mean of the training data. The value can either be set manually or automatically calculated from the training data using
self_optimize.- std
The standard deviation of the training data. The value can either be set manually or automatically calculated from the training data using
self_optimize.- ddof
The degree of freedom used in the standard deviation calculation.
- Other Parameters:
- data
The data passed to the transform method.
- Attributes:
- transformed_data_
The transformed data.
Methods
clone()Create a new instance of the class with all parameters copied over.
from_json(json_str)Import an gaitmap object from its json representation.
get_params([deep])Get parameters for this algorithm.
self_optimize(data, **_)Learn the parameters of the transformer based on provided data.
set_params(**params)Set the parameters of this Algorithm.
to_json()Export the current object parameters as json.
transform(data, **_)Scale the data.
- 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
- classmethod from_json(json_str: str) Self[source]#
Import an gaitmap object from its json representation.
For details have a look at the this example.
You can use the
to_jsonmethod of a class to export it as a compatible json string.- Parameters:
- json_str
json formatted string
- 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.
- self_optimize(data: Sequence[DataFrame], **_) Self[source]#
Learn the parameters of the transformer based on provided data.
- Parameters:
- data
A sequence of dataframes, each representing single-sensor data.
- kwargs
Optional keword arguments
- Returns:
- self
The trained instance of the transformer
- set_params(**params: Any) Self[source]#
Set the parameters of this Algorithm.
To set parameters of nested objects use
nested_object_name__para_name=.