Git Product home page Git Product logo

Comments (3)

kdgutier avatar kdgutier commented on July 29, 2024

Hi Diogo,
It seems that the number of windows available for the model are zero, when that happened to me before it was that the output_size was too big for a series of your data, try to make sure that the series are long enough. Hope this helps.

from esrnn_torch.

diogoalvesderesende avatar diogoalvesderesende commented on July 29, 2024

Thanks for the prompt reply. The data has ~2.5k observations, around 7 years. I am sending my data on this link
and the code is below. Thank you for the support!

`# Python
import pandas as pd

#get data
data = pd.read_csv("DHS_Daily_Report.csv")

#transforming date variable
data["Date"] = pd.to_datetime(data["Date"], format = "%m/%d/%Y")
data["Date"] = data["Date"].dt.strftime("%Y-%m-%d")

#rename forecasting variable
data = data.rename(columns = {'Total Individuals in Shelter' : 'y'})
data = data.rename(columns = {'Date' : 'ds'})

#selecting variables
#selecting variables
dataset = data.loc[data["ds"] <= "2020-11-11", ["ds","y", "Easter",
                                   "Thanksgiving", "Christmas"]]
future = data.loc[data["ds"] >= "2020-11-12", ["ds","y", "Easter",
                                  "Thanksgiving", "Christmas"]]

#adding unique IDs
dataset.insert(0, 'unique_id', dataset.index)

#isolate Y and X
y_df = dataset.loc[:, ["unique_id", "ds", "y"]]
X_df = dataset.loc[:, ["unique_id", "ds", "Easter"]]
X_df = X_df.rename(columns = {'Easter' : 'x'})

#forecasting model
from ESRNN import ESRNN
model = ESRNN(max_epochs=25, 
              freq_of_test=5, 
              batch_size=4, learning_rate=1e-4,
              per_series_lr_multip=0.8, lr_scheduler_step_size=10,
              lr_decay=0.1, gradient_clipping_threshold=50,
              rnn_weight_decay=0.0, level_variability_penalty=100,
              testing_percentile=50, training_percentile=50,
              ensemble=False, max_periods=25, seasonality=[],
              input_size=4, output_size=6,
              cell_type='LSTM', state_hsize=40,
              dilations=[[1], [6]], add_nl_layer=False,
              random_seed=1, device='cpu')
model.fit(X_df, y_df)

from esrnn_torch.

kdgutier avatar kdgutier commented on July 29, 2024

The input_size and output_size might be just too big for a series in your panel to handle.
Check if your panel data is balanced and try to either avoid very short series or pad them.
Another thing I advice is to look at the package hyperopt (or similar) to tune the hyperparameters of the ESRNN, doing manually is time consuming.

from esrnn_torch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.