How to creat a plot for the accuracy of a model
Your context is different than the one provided in the link. There, the author has made a neural network in Keras and has plotted the accuracy against the number of epochs. One epoch is when an entire dataset is passed both forward and backward through the neural network once. So, he is calculating accuracy after every epoch while the weights vary to fit data based on the loss function. (Thus, the accuracy increases as the number of epochs increases.)

In your case, you are performing a linear regression which fits the data and generates an equation. There is no feedback system. Accuracy here can be defined based on your need. In this case (Predicting sons height based on their father's), you can define accuracy as how accurate your predictions were. Take an error function like MAE (Mean absolute error). Lesser the error rate is more accurate is your model. MAE is an accuracy measure here.


For general classification tasks, accuracy is the number of instances you predicted correctly divided by the total number of instances. (In the link, author used default keras accuracy metric defined somewhat like this)