In the previous session, we looked at training optimization.
In this section we shall be diving into performance measurement.
In this section, we shall define a metric which will permit us to evaluate how well the model is performing.
This kind of information is especially important when you have, for example, several models or let's
say you have two models A and B.
So if you have model A, then with A with a given metric, you could evaluate and see how well model
A performs with the metric.
And then uh, for model B you could also evaluate how well it performs with that model.
And then now compare the two models that model A and model B.
In our case we shall be making use of the root mean square error.
And again with TensorFlow is very easy.
You just need to have uh you just need to import the root mean square error.
So you have Keras metrics and then you import um root mean squared error.
So that's fine.
So once you have this imported you get uh to model compilation which is just below here.
And then you include that um, metrics.
And then you have your um metrics.
You have root mean squared error.
So once you include this um, root mean square error in your model compilation and then you, um, restart
the training, you will notice that apart from the loss, you also have the root mean square error.
So now we have the loss and the root mean square error values which have been printed out.
Then you could go ahead and plot the root mean square error out.
So let's copy this and just paste it out.
Here we have a perform loss.
We have the root mean squared and error.
There we go.
Here we have models um model performance um root mean square error.
Close that.
And that's it.
So here we have Rmse E then epoch and train.
So let's run this and then see what we get.
We get we have this error root mean square error.
Let's add this.
Ah run that again.
And that's fine.
So you see the root mean square error tool is dropping.
And then another special method which is used um in TensorFlow to evaluate a model is actually the evaluate
method.
So you do model evaluate and then you pass in X and you pass in y.
So run that again and you see it evaluates the model and gives you the root mean squared error.
So here we have the loss value.
And then you have the root mean squared error.
So this is the loss this is the root mean squared error.
And note that this is uh at the end of the training.
So it tells you how well the model is performing at the end of training.
You could check this out here.
332 869 and 308 096.
That's exactly what we have here.
That's it for this section on performance measurement.
We shall now dive into validation and testing.