[FEAT] Feat Include Undamaged Node Classification #98

Merged
nuluh merged 15 commits from feat/53-feat-include-undamaged-node-classification into dev 2025-06-18 02:06:04 +00:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit a7d8f1ef56 - Show all commits

View File

@@ -25,9 +25,9 @@ def create_ready_data(
"""
ready_data = []
for file in os.listdir(stft_data_path):
ready_data.append(pd.read_csv(os.path.join(stft_data_path, file)))
ready_data.append(pd.read_csv(os.path.join(stft_data_path, file), skiprows=1))
y_data = [i for i in range(len(ready_data))]
y_data = [i for i in range(len(ready_data))] # TODO: Should be replaced with actual desired labels
# Combine all dataframes in ready_data into a single dataframe
if ready_data: # Check if the list is not empty

View File

@@ -6,7 +6,7 @@ import glob
import multiprocessing # Added import for multiprocessing
# Define the base directory where DAMAGE_X folders are located
damage_base_path = 'D:/thesis/data/converted/raw'
damage_base_path = 'D:/thesis/data/converted/raw_B'
# Define output directories for each sensor
output_dirs = {
@@ -105,6 +105,8 @@ def process_damage_case(damage_num):
)
# Save the aggregated STFT to CSV
with open(output_file, 'w') as file:
file.write('sep=,\n')
df_aggregated.to_csv(output_file, index=False)
print(f"Saved aggregated STFT for Sensor {sensor_num}, Damage {damage_num} to {output_file}")
else:
@@ -112,4 +114,4 @@ def process_damage_case(damage_num):
if __name__ == "__main__": # Added main guard for multiprocessing
with multiprocessing.Pool() as pool:
pool.map(process_damage_case, range(1, num_damage_cases + 1))
pool.map(process_damage_case, range(0, num_damage_cases + 1))