I have to get a regression model for a dataset, and it seems that the best fit is a log-linear model, so that I simply applied the least squares on the trasformed response vector.
$ log(\hat{Y}) = f(X) = \hat\beta_0 + \bf{\hat\beta}^TX$
This means that the values $\hat{z}_i$ I predict from the test set through my model will be the natural logarithms of the target values.
$\hat{z}_i =log(\hat{y}_i)$
Now, how am I supposed to compute the mean squared error and the $R^2$?
Is it correct to consider $MSE = \frac1n{\sum{(y_i - \hat{y}_i)^2}} = \frac1n{\sum{(y_i - e^{\hat{z}_i})^2}}$
or $MSE = exp(\frac1n\sum{(log(y_i)-\hat{z}_i)^2})$ ?
Same question for the $R^2$.
Thanks