Plot training and validation accuracy and loss

Viewed 62

I am new to Python and trying to plot the training and validation accuracy and loss for my MLP Regressor, however, I am getting the following error, what am I doing wrong?

TypeError: fit() got an unexpected keyword argument 'validation_split'

mlp_new = MLPRegressor(hidden_layer_sizes=(18, 18,18),
                       max_iter = 10000000000,activation = 'relu',
                       solver = 'adam', learning_rate='constant', 
                       alpha=0.05,validation_fraction=0.2,random_state=0,early_stopping=True)

mlp_new.fit(X_train, y_train)
mlp_new_y_predict = mlp_new.predict((X_test))
mlp_new_y_predict

import keras
from matplotlib import pyplot as plt
history = mlp_new.fit(X_train, y_train, validation_split = 0.1, epochs=50, batch_size=4)
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'val'], loc='upper left')
plt.show()
1 Answers
Related