Feature Extraction Module¶
This module contains functions for generating new features from the telemetry dataset to improve model performance.
Feature extraction methods for telemetry analysis.
This module defines functions to compute relevant features from preprocessed telemetry data.
- telemetry_anomdet.feature_extraction.features.pivot_wide(df: DataFrame, *, variables=None) DataFrame[source]¶
Convert long form telemetry data to wide format.
- Parameters:
df (pd.DataFrame) – Long-form data with [‘timestamp’,’variable’,’value’].
variables (list[str], optional) – Specific variables to include; all by default.
- Returns:
Wide table (timestamp index, variables as columns).
- Return type:
pd.DataFrame
- telemetry_anomdet.feature_extraction.features.windowify(wide_df: DataFrame, *, window_size: int = 50, step: int = 10) ndarray[source]¶
Slice wide form telemetry data into overlapping windows.
- Parameters:
wide_df (pd.DataFrame) – Wide telemetry table.
window_size (int) – Number of samples per window.
step (int) – Step size between consecutive windows.
- Returns:
Array with shape (n_windows, window_size, n_features).
- Return type:
np.ndarray
- telemetry_anomdet.feature_extraction.features.features_stat(X3d: ndarray) ndarray[source]¶
Generate a 2D feature table from windowed telemetry.
- Parameters:
X3d (np.ndarray) – Windowed telemetry tensor with shape (n_windows, window_size, n_features), typically produced by make_feature_table().
- Returns:
Shape (n_windows, n_features * 4). For each window and each variable, this function computes simple statistical features (mean, standard deviation, min, and max) along the time axis and concatenates them into a flat feature vector ready for downstream modeling.
- Return type:
np.ndarray
- telemetry_anomdet.feature_extraction.features.make_feature_table(df: DataFrame, *, variables=None, window_size=50, step=10) ndarray[source]¶
Generate a complete feature table from preprocessed telemetry.
- Parameters:
df (pd.DataFrame) – Preprocessed long-form telemetry data.
variables (list[str], optional) – Subset of sensors to include.
window_size (int) – Window length (default 50 samples).
step (int) – Step size between windows.
- Returns:
Shape (n_windows, window_size, n_features). Ready for downstream modeling or for passing into a future features_stat() to get a 2D feature table.
- Return type:
np.ndarray