Micah Denver
12/09/2024, 11:04 PM# Use numeric values instead of storing entire dataframes
extended_train = X_train_val.copy() # Start with the training-validation set
predictions = []
true_values = []
for i in range(test_size):
# Select the current 1-hour step as a single row
current_window = X_test.iloc[[i]]
# Predict using the extended training data and extract the numeric value
prediction_value = nf.predict(extended_train)['AutoRNN'].iloc[0]
true_value = current_window['y'].iloc[0]
# Store the numeric values directly
predictions.append(prediction_value)
true_values.append(true_value)
# Add the current window to the extended training data
extended_train = pd.concat([extended_train, current_window])
# Compute Mean Absolute Error
mae = mean_absolute_error(true_values, predictions)
print("Mean Absolute Error (MAE):", mae)
José Morales
12/10/2024, 11:18 PMMicah Denver
12/12/2024, 9:09 PMMicah Denver
12/12/2024, 9:18 PMJosé Morales
12/12/2024, 9:49 PMMicah Denver
12/12/2024, 11:35 PMJosé Morales
12/13/2024, 3:12 PMMicah Denver
12/13/2024, 4:14 PM