5
$\begingroup$

I am processing some data using a feedforward neural network in Keras. I have noticed that if I log transform the data, the model trains better, however the error metric on the transformed data doesn't necessarily reflect very well what's going on with the original dataset.

At the moment I am using Mean Average Percentage Error metric (mape), and a CV error of 3.8% on log transformed data set corresponds to about 25% when I reverse-transform the predictions and check against the original outputs.

Is there a better choice of cost/objective function for situations like this?

$\endgroup$
2
$\begingroup$

I am assuming that when you say log transforming the data, it is log transformation of outcome variable. In such case, you may want to check root means squared logarithmic error.

$\endgroup$
0
$\begingroup$

This actually makes sense since the magnitude of the data is much smaller when you fit Log(y) = model(X).

$log error = \frac{1}{n} \sum_{t=1}^{n} abs( \frac{log(y_{t})-model(X_{t})}{log(y_{t})})$

$error = \frac{1}{n} \sum_{t=1}^{n} abs(\frac{y_{t}- exp(model(X_{t}))}{y_{t}})$

also, MAPE, is Mean Absolute Percentage Error.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.