Preprocess data for LSTM
Module for preparing LSTM input data from preprocessed features. Includes functionality for loading feature arrays, creating sequences, splitting the dataset, and saving the output for training and testing.
This module is intended for use with the Digital Twin of 5G Network project.
- lstm_preprocessing.create_sequences(X, y, seq_len)
Vytvorí sekvencie vstupných dát pre LSTM z kĺzavého okna.
- Parameters:
X (np.ndarray) – Vstupné dáta (features)
y (np.ndarray) – Cieľové hodnoty (triedy)
seq_len (int) – Dĺžka sekvencie pre LSTM
- Returns:
(X_seq, y_seq) ako ndarray
- Return type:
tuple
- lstm_preprocessing.load_data(X_path, Y_path, scaler_path, features_path, uc_map_path)
Loads the preprocessed data from specified paths.
- Args
X_path (str): Path to the input features (X)
Y_path (str): Path to the target labels (y)
scaler_path (str): Path to the scaler object
features_path (str): Path to the selected features JSON file
uc_map_path (str): Path to the UC map JSON file
- Returns
tuple: (X, y, scaler, selected_features, uc_map)
- lstm_preprocessing.split_and_save_data(X_seq, y_seq, output_dir='preprocessed_data')
Splits the dataset into training and testing sets and saves them to disk.
- Args
X_seq (np.ndarray): Input features in sequence format
y_seq (np.ndarray): Target labels in sequence format
output_dir (str): Directory to save the split data
- Returns
None