TransWikia.com

How to reconsider MSE metric when doing target engineering through a logarithm?

Data Science Asked on December 4, 2020

I am a user of Keras with Python, if I know some mathematics I am not very good about algebraic transformation.

The context is the following.
I am trying to reproduce the performances from a paper. In this paper, each individual has his own model: a neural network with the pattern 8-5-7-1. All these models reached a MSE of 100.
In my work, I do not use the same variables, so I found a different pattern.
I considered 3 individuals (3 models). I have remarked models (of the same pattern) learn better when the skewness of the target is lower. /! The target is not transformed at all at this moment.
In concrete terms:

  1. Model 1: skewness 0.41 manage to learn until 100 MSE (reached the goal)
  2. Model 2: skewness 0.66 manage to learn until 200 MSE not less (do not reached the goal)
  3. Model 3: skewness 0.31 manage to learn until 80 MSE (beyond the reached goal)

So this is why I am thinking about making a target engineering by using the logarithm of any base (while it reduces the skewness it is ok). Nevertheless, it transforms the reached metric: 100 MSE as maximum threshold. And I am pretty sure I cannot just compute log(MSE).
I searched the formula, of course: $ MSE = frac{1}{n}sum_{i=1}^{n}(y_{i}-bar{y}_i)^{2} $

But I am not able with my limited skills to reconsider it correctly. I need help.
So MSE is dependent of the n observations of the dataset, more the logarithm transformation on y. How can I implement a function that will allow to transform the new form of MSE obtained through a logarithmic transformation in order to compare it with the previous goal: 100 MSE on a non-transformed target ?

One Answer

You have a $Y_{true}$
Then you calculated $Y^{log}_{true}$


So, your predictions are $Y^{log}_{pred}$
Then you can calculate the $MSE^{log}$ but it can't be compared with 100 MSE.
So, you can do a - $base^{MSE^{log}}$
to make it comparabale to 100 MSE.

A better intuitive approach will be to convert back your $Y^{log}_{pred}$
i.e. $base^{Y^{log}_{pred}}$
Then calculate the MSE

The inverse of log is just about using power to the base

import numpy as np
input = np.array([100, 1000])
log_out = np.log10(input)

input_re = 10**(log_out)
input_re

Answered by 10xAI on December 4, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP