Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicting X_t as X_{t-1} Gives MSE 0.07 #13

Open
burakbayramli opened this issue Jan 24, 2017 · 0 comments
Open

Predicting X_t as X_{t-1} Gives MSE 0.07 #13

burakbayramli opened this issue Jan 24, 2017 · 0 comments

Comments

@burakbayramli
Copy link

burakbayramli commented Jan 24, 2017

Thanks for making your LSTM time series code available; it reported MSE of 0.07. I tried to create a baseline for comparison, simply taking X_t as X_{t-1}. This also gives me MSE of 0.07. Is this odd, or maybe LSTM generalizes better, or my MSE computation is faulty?

Thanks,

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.read_csv('household_power_consumption.txt', sep=';')
df = df[['Global_active_power']]
df = df[df.Global_active_power != '?']
df['G2'] = df['Global_active_power'].shift(1)
print df.head()
df = df.astype(float)
df['err'] = df['G2']-df['Global_active_power']
df['err'] = np.power(df['err'],2)
print df.err.sum() / len(df)
#print np.sqrt(df['err'].sum()) / len(df)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant