 Welcome back to the classification videos. In this particular video, we're going to continue with our interpretation, but here we're going to specifically look at how the number of trees can influence the resulting accuracy. So the first step is to store the training logs. So we say model.makeinspector, open and close parenthesis.traininglogs. And so if we look at these logs, it sort of gives us all of these options here, which are not like we can see the accuracy in them, but there's not much that we can do there. But eventually we want to plot these. So we need to turn them into a data frame. So we say PD, data frame. And in particular, I'm interested in the number of trees and the accuracy. Now we need to extract both of these values from this logs dataset. So I'm actually going to create a for loop in a single line. So we say log.num trees. So this is our dataset. And we say for every log in logs, print this data and store it in num trees. And so the important part is that this log matches that. So we could say x, we could say i, we could say number, but here we're saying log. So for every element in our logs dataset up here, store.numTrees here. And then we're going to do that exact same thing here, but we're going to change numTrees to evaluation.accuracy. And then if we come down here and print logsDF, we can see that it's now got this nice data frame where we've got the number of trees and the accuracy. And so then we want to plot that data. So we're going to use ggplot. And so we're going to plot logsDF and we're just going to do a basic line plot where our x data is numTrees and our y data is accuracy. And so we can see here that as the number of trees increases, so does the accuracy, but eventually it starts to sort of even out. And that sort of point where the accuracy starts to plateau is sort of the optimal number of trees. So the more trees you add to a model, the longer it's going to take to run, but also the greater chance that you have of overfitting the data, but if you have to view trees, well, then the accuracy is going to be worse because there's not enough trees there to give it that accuracy. So there's always the sweet spot and normally we look at where that is here. And so maybe you could argue that 30 trees, but somewhere maybe 31 might be the optimal, but at 50, we're probably okay because we haven't had too many additional trees beyond that analysis, but we certainly wouldn't want to go back and add more. And so this is a way that while you are running your own random forest models, go in and see if maybe there's an opportunity for you to improve the accuracy by changing the number of trees, which we specified all the way up here in our model definition.