We trained our model.
Now let's evaluate the model performance.
Here we're going to create a new cell for plotting the training history.
So plot training history.
I'll start with a variable called history plot history.
And if we go back to here let me see the train.
The model history.
History is the trained model.
So let me scroll down and pass it to the plot history function.
Here I created a new function called plot history and passed the history as its parameter.
Okay.
Plot training and validation loss values.
Let's start with plt.
As we did before, PLT is used from the library that used for plotting and making diagrams 12 by two
figure size equals Matplot library and plt subplot.
1 to 1 plot historyhistory the last and make the label.
Set the label to training class.
Make another plot for the values.
Make the label for validation loss.
So this is for the validation loss and this is the loss.
And also set the X label to the apex Y label to the loss MSE.
Let's make it here MSE.
Make a legend and a title for this diagram.
Training and validation loss okay.
Also let me create another plot.
This is 1 to 1.
This is the left side for the left left diagram.
We talked about this library a lot in the previous videos.
Guys.
It's very simple.
I'm making x and y axis.
X axis is x.
X and y axis is the loss in MSE.
I am plotting the from the model that I trained called history loss and get the history of the history
model.
Get the loss from it.
Let me print the Ma and see the ma.
So plot subplot take the right diagram.
I get the Ma, make the history, the val, ma and validation ma set the x label to epics y label to
mean absolute error.
Ma get the legend and title for it.
Okay?
Make this plot tight layout and show the plot.
Let me run and call this function plot history.
Let me at first run all we get this error in plot history.
Let me see.
Unknown argument label.
Let me scroll up.
Oops.
Um.
Here the plot.
They a label with a small letter.
So let me see the label y label.
Okay, so there is no argument called capital letter L.
Label.
Small letter L.
Scroll down to here.
Label and label run again and here we go.
Congratulations guys.
This is our training and validation loss plots.
Okay so here we have the validation loss in orange.
The training loss in blue.
If we see for the last MSE as epochs increase the MSE drops down and decrease to around as table one.
And here, if the validation, the validation loss and training loss decreased and stable, then there
is no need to create more epochs.
For this we use the early access.
And by the way this is a good and this is a good visualization.
We uh, we end the previous videos, compared and analyzed the MSA and Maa in the data like those.
But we, uh, we plotted this in order to understand it better.
Also, this is true for the Maa.
As epochs increase, that decreased okay.
This is how we validate the data and how and how to evaluate the model performance.