introduction to machine learning and deep learning we can evaluate the model on the unseen data using the rmse metric we can also compute the rmse metric on the training data figure - plots the actual and predicted valuesand listing - shows the source code for generating the model listing - function to build model with parameterized number of co-efficients #create function to build regression model with parameterized degree of independent coefficients def create_model(x_train,degree)degree+= x_train np column_stack([np power(x_train,ifor in range( ,degree)]model np dot(np dot(np linalg inv(np dot(x_train transpose(),x_train)),x_train transpose()),y_trainplt plot( , ,' 'plt xlabel(" "plt ylabel(" "predicted np dot(model[np power( ,ifor in range( ,degree)]plt plot(xpredicted,' 'plt legend(["actual""predicted"]loc plt title("model with degree = "train_rmse np sqrt(np sum(np dot( [ : predicted[ : ]y_train predicted[ : ]))test_rmse np sqrt(np sum(np dot( [ :predicted[ :] [ :predicted[ :]))print("train rmse(degree "+str(degree)+"):"round(train_ rmse , )print("test rmse (degree "+str(degree)+"):"round(test_ rmse , )plt show(