i have following code to load my trained models i have 4 trained models and 4 equal y…
- User
i have following code to load my trained models i have 4 trained models and 4 equal y parameters(each has 3 values to be predicted) complete the code so predict each y with each mmodel and then validate predicted result based on mae :
Placeholder for storing the data frames
data_frames = []
x_scaler = joblib.load('snn_all_1142_x_scaler.sav') x_scaler = joblib.load('snn_all_1142_yhlp1_scaler.sav') x_scaler = joblib.load('snn_all_1142_yhlp2_scaler.sav') x_scaler = joblib.load('snn_all_1142_yhlp3_scaler.sav') x_scaler = joblib.load('snn_all_1142_yhlp5_scaler.sav')
model_y1 = load_model('snn_1142_hlp1_sec_5m_relu_trainloss09_mae17_valloss22_mae22.h5') model_y1 = load_model('snn_1142_hlp2_sec_5m_relu_trainloss07_mae15_valloss36_mae19.h5') model_y1 = load_model('snn_1142_hlp3_sec_5m_relu_trainloss05_mae13_valloss17_mae17.h5') model_y1 = load_model('snn_1142_hlp5_5m_relu_trainloss05_mae12_valloss12_mae14.h5')
Loop over the list of csv files
for csv_file in csv_files: # Read the CSV file file_path = os.path.join(csv_directory, csv_file) df = pd.read_csv(file_path) # Assuming ‘df’ is your DataFrame and ‘Label’ is the target column X = df.drop(['y_High_1d', 'y_Low_1d', 'y_Priority_1d', 'y_High_2d', 'y_Low_2d', 'y_Priority_2d', 'y_High_3d', 'y_Low_3d', 'y_Priority_3d', 'y_High_5d', 'y_Low_5d', 'y_Priority_5d'], axis=1).values Y1 = df[['y_High_1d', 'y_Low_1d', 'y_Priority_1d']].values Y2 = df[['y_High_2d', 'y_Low_2d', 'y_Priority_2d']].values Y3 = df[['y_High_3d', 'y_Low_3d', 'y_Priority_3d']].values Y5 = df[['y_High_5d', 'y_Low_5d', 'y_Priority_5d']].values # Y = to_categorical(y) # Convert labels to one-hot encoding
- Assistant
- User
each of Y_actual's has 3 colums that are being predicted by model i want the mae calculated separatly for each column of each y
- Assistant
- User
instead of printig the mae's ,i want to generate a csv file that for each file has the values of mae's that calcuated for each column of each y
- Assistant