energy_fault_detector.data_preprocessing.angle_transformer

class AngleTransformer(angles=None, trust_bad_angles=False)

Bases: DataTransformer

Transforms features containing angles to their sine and cosine values. Currently, assumes all angles are in degrees.

angles

List of feature names (str) which are angles that need to be transformed.

trust_bad_angles

If True angle features that neither suit the value range (-180, 180) nor (0, 360) will be transformed the same way as valid angles. If False, out of range angle features will be dropped.

fit(x, y=None)

Sets feature names in and out and detects value ranges of angle features.

Return type:

AngleTransformer

get_feature_names_out(input_features=None)

Returns the list of feature names output by the angle transformation step.

Return type:

List[str]

inverse_transform(x)

Get the angles based on their sine values and drop the sine/cosine values. NOTE: if sine/cosine values are out of possible range (-1, 1), values below -1 are set to -1 and values above 1 to 1.

Return type:

DataFrame

transform(x)

Transforms the angle angles to sine and cosine values.

Return type:

DataFrame