f1=f1_score(y_test,y_test_pred,average='macro')# Use 'macro' averaging for multi-class classification
print("F1 Score:",f1)
# Load the testing data
test_data=pd.read_csv('TestingDataMulti.csv')
# Make predictions on the testing data
y_test_pred=rf_classifier.predict(test_data)
# Add the predicted labels as a new column named "marker"
test_data['marker']=y_test_pred
# Save the updated testing data to a new CSV file
#test_data.to_csv('C:\\Users\\97061\\Documents\\Southampton\\Modules\\Semester2\\COMP3217 Security for CPS\\Assignment\\Assignment2\\Testoutputfile\\TestingResultsMulti.csv', index=False)