Skip to main content

N-Beats

Project description

N-BEATS: Neural basis expansion analysis for interpretable time series forecasting


N-Beats at the beginning of the training

Trust me, after a few more steps, the green curve (predictions) matches the ground truth exactly :-)

Installation

From PyPI

Install Keras: pip install nbeats-keras.

Install Pytorch: pip install nbeats-pytorch.

From the sources

Installation is based on a MakeFile. Make sure you are in a virtualenv and have python3 installed.

Command to install N-Beats with Keras: make install-keras

Command to install N-Beats with Pytorch: make install-pytorch

Example

Jupyter notebook: NBeats.ipynb: make run-jupyter.

Model

Pytorch and Keras have the same model arguments:

class NBeatsNet:
    def __init__(self,
                 stack_types=[TREND_BLOCK, SEASONALITY_BLOCK],
                 nb_blocks_per_stack=3,
                 forecast_length=2,
                 backcast_length=10,
                 thetas_dim=[2, 8],
                 share_weights_in_stack=False,
                 hidden_layer_units=128):
        pass                

Which would translate in this model:

--- Model ---
| N-Beats
| --  Stack Trend (#0) (share_weights_in_stack=False)
     | -- TrendBlock(units=128, thetas_dim=2, backcast_length=50, forecast_length=10, share_thetas=True) at @4500902576
     | -- TrendBlock(units=128, thetas_dim=2, backcast_length=50, forecast_length=10, share_thetas=True) at @4779951944
     | -- TrendBlock(units=128, thetas_dim=2, backcast_length=50, forecast_length=10, share_thetas=True) at @4779952280
| --  Stack Seasonality (#1) (share_weights_in_stack=False)
     | -- SeasonalityBlock(units=128, thetas_dim=8, backcast_length=50, forecast_length=10, share_thetas=True) at @4779952616
     | -- SeasonalityBlock(units=128, thetas_dim=8, backcast_length=50, forecast_length=10, share_thetas=True) at @4779952952
     | -- SeasonalityBlock(units=128, thetas_dim=8, backcast_length=50, forecast_length=10, share_thetas=True) at @4779953288

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbeats-keras-1.3.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbeats_keras-1.3.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file nbeats-keras-1.3.1.tar.gz.

File metadata

  • Download URL: nbeats-keras-1.3.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for nbeats-keras-1.3.1.tar.gz
Algorithm Hash digest
SHA256 bde25ee60be1767c1a0bf4a4e30f82e1f1a58fd4705933a353bedf51965a4eff
MD5 f6e8786014e9710297f23753a14e4605
BLAKE2b-256 f3db8251b042d502de12ee2e859d6216461d43eb968c9e07b4acaf4a72acb8ce

See more details on using hashes here.

File details

Details for the file nbeats_keras-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: nbeats_keras-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for nbeats_keras-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fae732ae6a75c3203d7c59b0833e8bbf8d38e63fd7db52d157416248fd55110
MD5 0044f181f732d0fbdd4f2aa9c1f869a0
BLAKE2b-256 22e4504dbd222906e86de865cc28a9aafcf09d7c5364cd8083014e48a0351c6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page