SugiharaLab/pyEDM

PYEDM FORECASTING PROBLEM

vishnu020 opened this issue · 1 comments

multivariate_out = Multiview(dataFrame=df1, lib='1 56', pred='57 112', E=3, Tp=3,
showPlot=True,
columns='''retail_food_sales_vol_bil_ch_usd__Month_MA2
retail_sales_food_services_bil_usd
change_private_inv_minus_retail_trade_bil_ch_usd__Month_MA2
total_sales''',
target="total_sales")
Screenshot (48)
this model is predicting null values as lib data has target column and i am using it for training and datset 57 to112 is using for prediction doesnot contain the total sales can you clear my doubt

Perhaps your target (Observations) are NaN ? This is what it looks like in the screenshot. If the target is NaN, a prediction can not be made as the target state space point must be found in the state space library.

If a library vector contains NaN, any prediction based on that state space library vector (neighbor) will also be NaN.

Here is a demonstration:

from pyEDM import *
pyEDM.__version__
'1.15.3.0'
df = sampleData["block_3sp"].copy()

df.shape
(198, 10)
df.columns
Index(['time', 'x_t', 'x_t-1', 'x_t-2', 'y_t', 'y_t-1', 'y_t-2', 'z_t',
       'z_t-1', 'z_t-2'],
      dtype='object')
MV = Multiview( dataFrame = df, lib = "1 99", pred = "105 190",  E = 3, 
                columns = "x_t y_t z_t", target = "x_t" )

MV['Predictions'].head()
  time  Observations  Predictions
0  107     -0.212900          NaN
1  108      1.140320     0.851125
2  109     -1.152276    -1.330832
3  110      0.585776     0.556128
4  111      0.022673     0.052843
from numpy import nan
df.loc[:100,'x_t'] = nan

MV2 = Multiview( dataFrame = df, lib = "1 99", pred = "105 190",  E = 3, 
                 columns = "x_t y_t z_t", target = "x_t" )

MV2['Predictions'].head()
  time  Observations  Predictions
0  107     -0.212900          NaN
1  108      1.140320          NaN
2  109     -1.152276          NaN
3  110      0.585776          NaN
4  111      0.022673          NaN
MV3 = Multiview( dataFrame = df, lib = "1 99", pred = "80 100",  
                 E = 3, columns = "x_t y_t z_t", target = "x_t" )

MV3['Predictions'].head()
  time  Observations  Predictions
0   82           NaN          NaN
1   83           NaN          NaN
2   84           NaN          NaN
3   85           NaN          NaN
4   86           NaN          NaN