question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Predicting Nan with Stock Data (regardless of model)

See original GitHub issue

Hi there,

running into trouble with predicting Nan Values. Initially thought that this could be from using a weekday timeseries (working with stock data). I saw the post about changing Freq=‘B’ for a business day time index. Even with doing this, the prediction array still has Nan values. I tried using this data with NBEATs as well as RNN model - both have yielded the same results. Would love some help!

Below is the data I’m using as well as the prediction array readout.

 close
timestamp             
1999-11-19  142.500000
1999-11-22  142.468704
1999-11-23  141.218704
1999-11-24  141.968704
1999-11-26  141.437500
1999-11-29  140.937500
1999-11-30  139.281204
1999-12-01  140.406204
1999-12-02  141.250000
1999-12-03  143.843704

[5589 rows x 1 columns]
100%|██████████| 100/100 [27:40<00:00, 16.60s/it]
100%|██████████| 229/229 [00:09<00:00, 24.62it/s]
<TimeSeries (DataArray) (time: 229, component: 1, sample: 1)>
array([[[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

...

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]],

       [[nan]]])
Coordinates:
  * time       (time) datetime64[ns] 2017-09-11 2017-09-18 ... 2022-01-24
  * component  (component) <U1 '0'
Dimensions without coordinates: sample

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MRV1N2commented, Feb 12, 2022

Hello orthosku, I’ve also been dealing with darts for a few days to predict Stock Prices, would you like to exchange experience, my Discord name is MRV1N#1905

0reactions
orthoskucommented, Feb 10, 2022

Makes sense, thank you! So in this use case, weekday holidays would marked as Nan by the ts object; these values would be interpolated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tensorflow model predicting Nans - python - Stack Overflow
No matter how I change the learning rate and batch size, the result does not change, and the loss is always 'nan', and...
Read more >
Predicting Returns with Fundamental Data and Machine ...
Regardless, the models have shown that fundamental data do contain predictive power for performance, and further research is warranted.
Read more >
machine learning - Dealing with NaN for predictive models
What i do is check whether sum of all Nans in a column is more than 70% .Also we can substitute it with...
Read more >
Predicting Stock Prices in Python - YouTube
In today's video we learn how to predict stock prices in Python using recurrent neural network and machine learning.
Read more >
NaN in the prediction array · Issue #2967 · keras-team/keras
Does anyone have an idea of how a NaN can rise in the prediction array, that is in the return value of predict()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found