# How to know the predicted values on training data

How to know the predicted values of the model on training data? I just see the standard metrics such as RMSE and R-squared after run train () function.

• What software are you using? – Upper_Case Dec 1 '17 at 17:51
• Just apply the model to your training data as if it were test data – HEITZ Dec 1 '17 at 21:27

Hey there are multiple ways to evaluate the train data, say

(1) Principle Component Analysis

(2) Ridge Regression

(3) Lasso

(4) Partial Least Square

and so on. Each gives a different estimate of the predicted values and different RMSE and R-square for the train data.

• I am known. But my mean is how to recognize the predicted values of the model on the training data with those RMSE and R-squared? – Hoang Nguyen Dec 1 '17 at 17:16
• If you ran PCA on training data, how can you evaluate the prinicipal components on the data, say if you want to use the top 5 PCs or the top X principal components? Because if you exclude some PCs then the test data has a different number of variables. – guy Dec 1 '17 at 17:56

The exact method will vary depending on what software you are using, but in general you would feed your training data through the model to obtain the predicted outputs. Applying the model to the input data is the only method I can imagine that would produce the model-predicted output; you cannot reverse-engineer it from a model-level summary like RMSE or R-squared.

• I am using R. I used train() function for some algorithms and comparing these performances through RMSE and R-squared on the training data. Then, I use validation data to predict the models and calculate RMSE and R-squared on the validation data. Finally, I evaluate and select the best model based on the RMSE and R-squared on both of training and validation datasets. But if I want to make regression graph between real and predicted values of training data and validation data, I don't know the predicted values of the selected model on training data to build regression graph. – Hoang Nguyen Dec 2 '17 at 4:03