{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Marco Peixeiro",
  "title_listed": "N-BEATS: Time-Series Forecasting with Neural Basis Expansion",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/n-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538/",
  "publish_date": "2022-06-01",
  "corpus_stage": "",
  "notes": "",
  "id": "1c0f790a1ada",
  "collected_at": "2026-10-02T08:55:16",
  "title": "N-BEATS : Time-Series Forecasting with Neural Basis Expansion | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# N-BEATS : Time-Series Forecasting with Neural Basis Expansion\nA Deep Learning model that provides accuracy and interpretability\n[Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\nNovember 25, 202212 min read\n# N-BEATS: Time-Series Forecasting with Neural Basis Expansion\n### A Deep Learning model for zero-shot time-series forecasting\n![Created with DALLE \\[1\\]](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1Yacgnk0WblMoYTvCTDpvJw.png)\nCreated with DALLE [1]\n**There's one thing that makes Time-Series Forecasting special.**\nIt was the only area of Data Science where Deep Learning and Transformers didn't decisively outperform the other models.\nLet's use the prestigious **Makridakis M-competitions** as a benchmark - a series of large-scale challenges that showcase the latest advances in the time-series forecasting area.\nIn the fourth iteration of the competition, known as **M4** , the winning solution was [ES-RNN [2]](https://eng.uber.com/m4-forecasting-competition/), a hybrid LSTM & Exponential Smoothing model developed by Uber. Interestingly, the 6 (out of 57) pure ML models performed so poorly, they barely surpassed the competition baseline.\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Machine Learning](https://roadmap.sh/machine-learning) and [Computer Science](https://roadmap.sh/computer-science) roadmaps.\nThat changed one year later. _Elemental AI_ (co-founded by **Yoshua Bengio**) published [**N-BEATS [3]**](https://arxiv.org/pdf/1905.10437.pdf)_**,**_ a pure Deep-Learning model that outperformed the winning ES-RNN model of M4 by 3%. But there's more.\nIn this article, we describe in depth:\n  1. **The architecture of** _**N-BEATS**_**, how the model works, and why is so powerful.**\n  2. **How** _**N-BEATS**_**produces interpretable forecasts.**\n  3. **How** _**N-BEATS**_**achieves unparallel zero-shot transfer learning.**\n  4. **Why** _**ARIMA**_**cannot natively support transfer learning.**\n\n\nLet's dive in.\n> I've launched [**AI Horizon Forecast**](https://aihorizonforecast.substack.com/)**,** a newsletter focusing on time-series and innovative AI research. Subscribe [here](https://aihorizonforecast.substack.com/) to broaden your horizons!\n## What is N-BEATS\n> N-BEATS is a fast, interpretable DL model that recreates the mechanisms of statistical models using double residual stacks of fully connected layers.\n**N-BEATS** stands for _**N**_ _eural_ _**B**_ _asis_ _**E**_ _xpansion_ _**A**_ _nalysis for_ _**T**_ _ime_ _**S**_ _eries,_ a revolutionary model created by **ElementAI.** This company was co-founded by **Yoshua Bengio** and was later acquired by [ServiceNow](https://en.wikipedia.org/wiki/ServiceNow).\n_N-BEATS_ **** is an interesting forecasting model because:\n  * It is the first pure Deep Learning model that outperformed all well-established statistical approaches.\n  * It provides interpretable forecasts.\n  * It sets the basis for **Transfer Learning** on time series.\n\n\nAround that time, **Amazon** published its novel time-series model, known as [**DeepAR [4]**](https://arxiv.org/pdf/1704.04110.pdf)**.** Although _DeepAR_ contains __ Deep Learning components, the model employs a few statistical concepts as well (maximum likelihood estimation).\n## N-BEATS - Overview\nLet's briefly discuss a few key traits of _N-BEATS_ :\n  * **Multiple time-series support** : _N-BEATS_ can be trained on multiple time series, each one representing a different distribution.\n  * **Fast Training:** The model does not contain any Recurrent or self-attention layers - thus, faster training & stable gradient flow.\n  * **Multi-horizon forecasting** : The model produces multi-step predictions.\n  * **Interpretability:** The authors developed 2 model versions, the _**generic**_ version, and the _**interpretable**_ version. The interpretable version can output interpretable predictions, regarding trend and seasonality.\n  * **Zero-shot Transfer Learning:** The model can transfer its knowledge to other time-series datasets with astounding success.\n\n\n> **Note:** The original N-BEATS implementation by ElementAI works on univariate time-series only. The Darts library has released an updated version that supports multivariate time-series and probabilistic outputs. In this article, we focus on the original version.\n## N-BEATS - Generic Architecture\nThe _N-BEATS_ architecture is deep, yet very simple. **Figure 1** displays the top-level view:\n![Figure 1: The top-level architecture of N-BEATS \\(Source\\)](../images/001.png)\n**Figure 1:** The top-level architecture of N-BEATS ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nNotice 3 things:\n  1. The _**block**_ (blue color) - the basic processing unit.\n  2. The _**stack**_ (orange color) - a collection of blocks.\n  3. The _**final model**_ (yellow color) - a collection of stacks.\n\n\nEvery neural network layer in the model is just a dense (fully-connected) layer.\nLet's start with the first component, the basic block:\n### 1. The Basic Block\nSuppose `H` is the forecasting horizon. In _N-BEATS_ , the lookback window is a multiple of the horizon `H` .\n**Figure 2** displays the architecture of the basic block:\n![Figure 2: The basic Block architecture \\(Source\\)](../images/002.png)\n**Figure 2:** The basic Block architecture ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nLet's take a look under the hood.\nIn **Figure 3,** we **** use the parameters of the paper's benchmark from the** Electricity dataset [5**]:\n![Figure 3: All operations inside the basic Block \\(Image by author\\)](../images/003.png)\n**Figure 3:** All operations inside the basic Block (Image by author)\nLet's see what happens here:\n  * The model looks back `3 days` = `72 hours` =`3 horizons` to predict the power usage of the next 24 hours.\n  * The block receives the lookback window input.\n  * The input then passes through a 4-layer neural network.\n  * The result of this computation is directed to 2 outputs. Here, the dense layers **Dense 5** estimate the theta parameters (`θ^b` and `θ^f`), which are called **expansion coefficients**.\n  * These parameters are then linearly projected into a new space using the **basis** layer transformations `g^b` and `g^f` to produce the _**backcast**_ and _**forecast**_ signals. This process is called \"**neural basis expansion** \".\n\n\n> So**,** how the backcast and forecast vectors are useful?\nThe **backcast** signal is the best-approximated vector that can optimally predict the **forecast** signal, given the `g^b` and `g^f` transformations. When `g^b` and `g^f` take specific forms, the backcast and forecast vectors become **interpretable** (more to that later).\n### 2. The Stack\nTo increase the effectiveness of the _neural expansion process,_ the authors stack many blocks together. This structure is displayed in **Figure 4:**\n![Figure 4: Stack of blocks \\(left\\) and stack of stacks \\(right\\) - \\(Source\\)](../images/004.png)\n**Figure 4:** Stack of blocks (left) and stack of stacks (right) - ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nOnly the first block receives the original sequence input. The downstream blocks receive the backcast signal `**x_l+1**`from the previous block (where`l` is the block index, i.e. `l_1` is the first block in the stack).\n![Figure 5: Operations inside the block \\(Image by author\\)](../images/005.png)\n**Figure 5:** Operations inside the block (Image by author)\nInside each stack, the backcast and forecast signals are organized into two branches: This topology is called **doubly residual stacking** and can be **** described by the following equations:\n![](../images/body-fa9170d519e70125af49.png)\nIn each block, the model removes the part of the backcast signal **`x̂** _l`from the input **`x**_l` that has approximated well. In other words:\n> The model at each block learns to optimally approximate a portion of the input signal, and sends the rest to be approximated by the downstream blocks.\nSince each block models only a portion of the input signal, the final forecast is the sum of all _forecast_ `ŷ` signals from all blocks.\nFinally, the stacks are also stacked (**Figure 4,** right). This architectural choice further increases the depth of the model and enhances its ability to learn complex time sequences.\nWe have seen how the generic version of _N-BEATS_ works. Next, we will describe the _interpretable_ version.\n## Are N-BEATS and ARIMA related?\nIf you are familiar with **ARIMA** , you might have noticed a few similarities with the _N-BEATS_ approach _._\n_ARIMA_ is modeled using the **Box-Jenkins** method, which is an iterative process. Specifically:\n  1. First, we guess the orders of the **AR()** and **MA()** functions the (`p` and `q` parameters).\n  2. Afterwards, we estimate the coefficients of these parameters using e.g. maximum likelihood estimation.\n  3. Then, we verify if the model's conditions hold. For instance, the model's residual errors should be normal and independent. If not, we return to step 1 and repeat the process. This time, we add new `p` and `q` degrees on top of the previous ones.\n\n\nIn other words, in each step of Box-Jenkins, we add more information to our model. Each iteration creates a better representation of the input, based on the model residuals.\nHence, we can conclude that:\n> In N-BEATS, each successive block models only the residual error due to the reconstruction of the backcast from the previous block and then updates the forecast based on that error. This process mimics the Box-Jenkins method when fitting ARIMA models.\nThe main difference between the 2 approaches is the target function of the residuals. _ARIMA_ focuses on the quality of the residuals, while _N-BEATS_ uses an arbitrary loss function.\nPlus, we don't manually adjust any equation with _N-BEATS_ — the basis transformations are automatically optimized with backpropagation. With _ARIMA_ however, we make heavy use of autocorrelation and partial autocorrelation plots to guess the order of `AR()` and `MA()` functions.\n> **Note:** Some ARIMA libraries implement the Box-Jenkins method with slight variations, depending on the programming language and the library. Here, we document the textbook implementation.\n## N-BEATS - Interpretable Architecture\nWith a few changes, the _N-BEATS_ model can become interpretable: These are:\n  * We use only 2 stacks, the **trend** and **seasonality** stacks. The generic architecture uses at least 30.\n  * Both trend and seasonality stacks contain 3 blocks. In the generic architecture, we have one block per stack.\n  * The **basis** layer weights of `g^b` and `g^f` are shared at the stack level.\n\n\nThe basic idea is that `g^b` and `g^f` basis take specific forms. Let's describe them in more detail.\n### **The Trend Block**\nOur goal is to restructure the `g^b` and `g^f` functions as monotonic that vary slowly across the forecast window.\nGiven a time vector t=[0,1,2,...,_H_ −2,_H_ −1] (`H` is the horizon), the thetas `θ` from the previous layer and the polynomial degree `p`, the trend model is defined as:\n![](../images/body-0dd6214d7fa3c29ec78b.png)\nIn other words, we use the architecture of **Figure 3** (the generic block) and swap the last linear layer with the above operation. The result is shown in **Figure 6:**\n![Figure 6: The Trend block \\(Image by author\\)](../images/006.png)\n**Figure 6:** The Trend block (Image by author)\nThe backcast equations are not described in the paper, but they can easily be derived from the project's implementation. Moreover, the trend and seasonality blocks (**Figure 6** and **Figure 7**) adopt the parameters from the [official project repo](https://github.com/ServiceNow/N-BEATS/blob/master/experiments/electricity/interpretable.gin):\nini\n\n```\ninterpretable.seasonality_layer_size = 2048\ninterpretable.seasonality_blocks = 3\ninterpretable.seasonality_layers = 4\ninterpretable.trend_layer_size = 256\ninterpretable.degree_of_polynomial = 3\ninterpretable.trend_blocks = 3\ninterpretable.trend_layers = 4\ninterpretable.num_of_harmonics = 1\n```\n\n### The Seasonality Block\nSimilarly, we swap the final layer with appropriate `g^b` and `g^f` functions that capture seasonality. An excellent candidate would be the Fourier series:\n![](../images/body-01759f556ce3b14b11ba.png)\nThen, the architecture becomes:\n![Figure 7: The Seasonality block \\(Image by author\\)](../images/007.png)\n**Figure 7:** The Seasonality block (Image by author)\nAgain, we stress that in all interpretable stacks, the `g^b` and `g^f` weights within the stack are shared.\n## Experimental Results\nFinally, the authors tested the performance of _N-BEATS_ in 3 popular time-series datasets - M3[6], M4[7], and Tourism[8].\n### Experimental Setup\nThe authors categorized all models into specific classes and compared _N-BEATS_ with the best model of each class. For example, the _DL/TS hybrid_ is the winning ES-RNN model on M4.\nSince all these datasets were used for data science competitions, all participants relied on ensembling to achieve maximum performance. Hence, the _N-BEATS_ authors relied on ensembling to be comparable. They used three variations: **N-BEATS-G** (generic)**, N-BEATS-I** (interpretable), **** an** d N-BEATS-I+**G (ensemble of all models from N-BEATS-G and N-BEATS-I).\nOn top of that, they created 6 different models with look back windows `2H, 3H .. 7H` for every horizon and variation. For extra details about the ensembling configurations,[ check the original paper](https://arxiv.org/pdf/1905.10437.pdf). In total, the authors ensembled 180 models to report the final results on the test set.\n### Results\nThe results for all datasets are shown in **Figure 8:**\n![Figure 8: Experimental results on M3, M4, and Tourism datasets \\(Source\\)](../images/008.png)\n**Figure 8:** Experimental results on M3, M4, and Tourism datasets ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nThe results are quite impressive.\nThe _N-BEATS_ outperforms the other implementations on all datasets, with _N-BEATS-I+G_ being the most successful.\nNote that in every dataset, the competitions use the MAPE, sMAPE, and OWA metrics (lower is better). These metrics are popular in time-series competitions.\n> **Note:** Contrary to the other approaches, N-BEATS does not require any hand-crafted feature engineering, or input scaling. Thus, N-BEATS is far more easier to use in different time-series tasks.\n## Zero-shot transfer learning\nThe main contribution of _N-BEATS_ is its ability to successfully implement transfer learning on time series.\n### Preliminaries\n**Transfer learning** is a more general term— it refers to how a model can transfer its knowledge across different datasets. This is already established on Computer Vision or NLP tasks: We can download a pretrained model and adjust it to our dataset with fine-tuning.\n**Meta-learning** (or few-shot-learning) is when the model can adapt to our dataset with little training/fine-tuning. The best scenario is _**zero-shot learning**_ , where the model is not trained on the target dataset.\n> Zero-shot learning is the model's ability to make predictions using unseen data, without having specifically trained on them. This learning method better reflects the human perception.\nBesides, this new paradigm shift towards meta-learning has been embraced by the latest AI research, such as OpenAI **—**[**CLIP [9]**](https://medium.com/towards-data-science/clip-the-most-influential-ai-model-from-openai-and-how-to-use-it-f8ee408958b1) and [**Whisper[10]**](https://medium.com/towards-data-science/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877) are a few of them.\n### Zero-Shot N-BEATS\n**Yoshua Bengio** (co-author of _N-BEATS_) has already established the theoretical foundation of transfer learning on forecasting tasks in his previous work [11].\nThe authors of _N-BEATS_ published a follow-up paper[12] where it summarizes most of this work, including what requirements a time-series forecasting model should meet to perform efficient transfer learning.\nLet's focus on _N-BEATS._\nThe authors state that _N-BEATS's_ meta-learning ability hinges on two procedures: i) the **inner learning** procedure and the **outer learning** procedure. They are shown in **Figure 9:**\n![Figure 9: Meta-learning procedures in N-BEATS \\(Source, edited by author\\)](../images/009.png)\n**Figure 9:** Meta-learning procedures in N-BEATS ([Source](https://arxiv.org/pdf/1905.10437.pdf), edited by author)\n**The inner loop** takes place inside each block and focuses on learning task-specific characteristics.\n**The outer loop** takes place at the stack level. Here, the model learns global characteristics across all tasks.\n> In other words, the inner loop learns local temporal traits, while the outer loop learns longer dependencies across all time-series.\nHowever, this begs the following section:\n### Why is ARIMA not suitable for Transfer Learning?\nIf an established paradigm dictates which criteria a forecasting model should meet to be appropriate for transfer learning, then why ARIMA is not?\nTo answer this question, we will again focus on the two learning procedures described by [12]\nWhen creating an ARIMA model, there are 2 challenges:\n  1. **Parameter estimation:** Parameters are estimated using a statistical technique like maximum likelihood. **This is the inner loop.**\n  2. **Model formulation:** This defines the form of the autoregressive equation. For example, if our model has a little trend, no seasonality, and normal residuals, we can decide that a Gaussian ETS will probably do the job. **This is the outer loop.**\n\n\nNotice that statistical models only pass the first criterion, the inner loop.\nThe parameter estimation part is straightforward once we have chosen our model. However, the model formulation part requires human intervention. Therefore, regarding the statistical approaches, **the role of the outer loop is not fulfilled.**\nThus, we conclude:\n> N-BEATS replaces the predefined set of rules for model parameter estimation of classical statistical models with a learnable parameter estimation strategy. This strategy allows N-BEATS to generalize well on multiple, unseen time sequences.\n### Zero-Shot learning results of N-BEATS\nIn this experimental analysis, the authors enrich the results of the previous benchmark (**Figure 8**) with some new models:\n  * **N-BEATS-M4:** The authors create a pretrained _N-BEATS_ models on the M4.\n  * **DeepAR-M4:** A pretrained _DeepAR_ model on the M4 is also added to the pool of models.\n\n\nThe total results are shown in **Figure 10** :\n![Figure 10: Comparison of zero-shot models \\(Source\\)](../images/body-83692bbb491c2b7b5d50.png)\n**Figure 10:** Comparison of zero-shot models ([Source)](https://arxiv.org/pdf/2002.02887.pdf)\nAgain, the results are very interesting.\n  * Zero-shot _**N-BEATS-M4**_ outperforms all the other models on M4 and Tourism datasets (including the winners), even though it was not trained on them.\n  * Zero-shot **DeepAR-M4** seems to perform poorly. This is expected since _DeepAR_ is not suitable for transfer learning.\n  * In every dataset, the zero-shot _N-BEATS_ model performs very well compared to the tailored-trained _N-BEATS_. It would have been interesting to see an effective-robustness vs overall-robustness plot that is found in other zero-shot models such as Whisper.\n\n\n## Closing Remarks\n_N-BEATS_ is a breakthrough Deep Learning forecasting model that has left a lasting impact on the time-series field.\nIn this article, we described the two main strengths of _N-BEATS_ : First, it's a powerful model that produces SOTA results. Secondly, _N-BEATS_ establishes a well-defined framework for implementing zero-shot transfer learning. To the best of my knowledge, this is the first model to achieve this successfully.\nIn our next articles, we will present a programming tutorial with _N-BEATS,_ and describe a newer paper, called _N-HiTS_.\n* * *\n## Thank you for reading!\n  * Follow me on [Linkedin](https://www.linkedin.com/in/nikos-kafritsas-b3699180/)!\n  * Subscribe to my [newsletter](https://aihorizonforecast.substack.com/welcome), AI Horizon Forecast!\n\n\n> [**AutoGluon-TimeSeries : Creating Powerful Ensemble Forecasts - Complete Tutorial**](https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful)\n## References\n[1] Created from DALLE with the text prompt \"a neon sinusoidal signal transmitting through space, concept art\", to rg\n[2] Slawek Smyl et al. [_M4 Forecasting Competition: Introducing a New Hybrid ES-RNN Model_](https://eng.uber.com/m4-forecasting-competition/)\n[3] Boris O. et al. [_N-BEATS: Neural Basis Expansion Analysis For Interpretable Time Series Forecasting_](https://arxiv.org/pdf/1905.10437.pdf) _,_ ICLR (2020)\n[4] D. Salinas et al. [_DeepAR: Probabilistic forecasting with autoregressive recurrent networks_](https://arxiv.org/pdf/1704.04110.pdf), International Journal of Forecasting (2019).\n[5] [ElectricityLoadDiagrams20112014](https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014) dataset by UCI, CC BY 4.0.\n[6] M3 Dataset <https://forecasters.org/resources/time-series-data/>, Public domain\n[7] M4 Dataset <https://forecasters.org/resources/time-series-data/>, Public domain\n[8] Tourism Dataset <https://www.kaggle.com/c/tourism1>, Public domain\n[9] Alec Radford et al. [_Learning Transferable Visual Models From Natural Language Supervision_](https://arxiv.org/pdf/2103.00020.pdf) _(Feb 2021)_\n[10] Alec Radford et al. [Robust Speech Recognition via Large-Scale Weak Supervision](https://cdn.openai.com/papers/whisper.pdf) _(September 2022)_\n[11] Yoshua Bengio et al. _Learning a synaptic learning rule_\n[12] Boris O. et al. [_Meta-learning framework with applications to zero-shot time-series forecasting_](https://arxiv.org/pdf/2002.02887.pdf)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-80a660d4ad923cabc0d5.jpeg)\nWritten By\n## [Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\n[See all from Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\n[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Deep Learning](https://towardsdatascience.com/tag/deep-learning/)[Science](https://towardsdatascience.com/tag/science/)[Time Series Forecasting](https://towardsdatascience.com/tag/time-series-forecasting/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&title=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&title=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&text=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/010.jpeg)](https://towardsdatascience.com/my-challenges-in-building-an-nlp-based-product-as-a-high-school-student-f0b8f2e85edc/)\n## [My challenges in building an NLP-based product as a high school student](https://towardsdatascience.com/my-challenges-in-building-an-nlp-based-product-as-a-high-school-student-f0b8f2e85edc/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAnd how I managed to solve them without spending a dime of my non-existent savings\n[Vagif Aliyev](https://towardsdatascience.com/author/vagifaliyev/)\nAugust 16, 20217 min read\n  * [![](../images/011.jpeg)](https://towardsdatascience.com/ai-feynman-2-0-learning-regression-equations-from-data-3232151bd929/)\n## [AI Feynman 2.0: Learning Regression Equations From Data](https://towardsdatascience.com/ai-feynman-2-0-learning-regression-equations-from-data-3232151bd929/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nLet's kick the tires on a brand new library\n[Daniel Shapiro, PhD](https://towardsdatascience.com/author/lemaysolutions/)\nJuly 1, 20209 min read\n  * [![](../images/012.jpg)](https://towardsdatascience.com/handling-missing-data-like-a-pro-part-1-deletion-methods-9f451b475429/)\n## [Handling \"Missing Data\" Like a Pro - Part 1 - Deletion Methods](https://towardsdatascience.com/handling-missing-data-like-a-pro-part-1-deletion-methods-9f451b475429/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nBasic and Advanced Techniques for the 21st Century Data Scientist\n[TheDataProf](https://towardsdatascience.com/author/francisadrianviernes/)\nJuly 7, 20216 min read\n  * [![](../images/013.jpg)](https://towardsdatascience.com/feature-selection-for-machine-learning-in-python-filter-methods-6071c5d267d5/)\n## [Feature Selection for Machine Learning in Python - Filter Methods](https://towardsdatascience.com/feature-selection-for-machine-learning-in-python-filter-methods-6071c5d267d5/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nHow to select the right predictors using statistical measures\n[Jack Tan](https://towardsdatascience.com/author/jackyeetan/)\nSeptember 13, 20200 min read\n  * [![](../images/014.jpg)](https://towardsdatascience.com/4-nlp-libraries-for-automatic-language-identification-of-text-data-in-python-cbc6bf664774/)\n## [4 NLP Libraries for Automatic Language Identification of Text Data In Python](https://towardsdatascience.com/4-nlp-libraries-for-automatic-language-identification-of-text-data-in-python-cbc6bf664774/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nComprehensive overview of open-source libraries for automatic language detection\n[Zoumana Keita](https://towardsdatascience.com/author/zoumanakeita/)\nFebruary 21, 20222 min read\n  * [![](../images/015.jpg)](https://towardsdatascience.com/is-ai-there-yet-ef57cd306555/)\n## [Is AI there yet?](https://towardsdatascience.com/is-ai-there-yet-ef57cd306555/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA quick summary through the problems faced by AI today!\n[Alexiei Dingli](https://towardsdatascience.com/author/alexieidingli/)\nApril 1, 202114 min read\n  * [![](../images/016.jpeg)](https://towardsdatascience.com/pump-it-up-with-catboost-828bf9eaac68/)\n## [Pump it Up with CatBoost](https://towardsdatascience.com/pump-it-up-with-catboost-828bf9eaac68/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nData Mining and a Simple Starter Model\n[Taras Baranyuk](https://towardsdatascience.com/author/taras-baranyuk/)\nFebruary 15, 20219 min read\n  * [![](../images/017.jpeg)](https://towardsdatascience.com/the-application-of-an-artificial-neuron-on-the-iris-dataset-in-python-9fb4275fadd/)\n## [The application of an Artificial Neuron on the Iris Dataset in Python](https://towardsdatascience.com/the-application-of-an-artificial-neuron-on-the-iris-dataset-in-python-9fb4275fadd/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nPredicting flowers' variety with a single layer neural network without a deep learning library\n[Giovanni Valdata](https://towardsdatascience.com/author/giovanni-valdata/)\nApril 5, 202210 min read\n  * [![](../images/018.jpg)](https://towardsdatascience.com/debugging-in-python-is-easy-with-with-assert-statements-ff333bfb3388/)\n## [Debugging in Python Is Easy With Assert Statements](https://towardsdatascience.com/debugging-in-python-is-easy-with-with-assert-statements-ff333bfb3388/)\n[Programming](https://towardsdatascience.com/category/programming/)\nA look into a tool that allows a pain-free troubleshooting experience\n[Aashish Nair](https://towardsdatascience.com/author/aashishnair/)\nSeptember 20, 20224 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "metadata": {
    "title": "N-BEATS : Time-Series Forecasting with Neural Basis Expansion | Towards Data Science",
    "description": "A Deep Learning model that provides accuracy and interpretability",
    "keywords": null,
    "author": "Nikos Kafritsas",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "N-BEATS : Time-Series Forecasting with Neural Basis Expansion",
    "og:description": "A Deep Learning model that provides accuracy and interpretability",
    "og:url": "https://towardsdatascience.com/n-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1Yacgnk0WblMoYTvCTDpvJw.png",
    "og:image:width": "1000",
    "og:image:height": "773",
    "og:image:type": "image/png",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Nikos Kafritsas",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "12 min read",
    "article:published_time": "2022-11-25T19:08:06.000Z",
    "article:modified_time": "2022-11-25T19:08:06.000Z",
    "article:author": "https://towardsdatascience.com/author/nikoskafritsas/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 202,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/1c0f790a1ada/code/block_000.txt",
      "chars": 291
    }
  ],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:59:01Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:59:01Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:59:01Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:59:01Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/nikoskafritsas/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/deep-learning/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/time-series-forecasting/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/my-challenges-in-building-an-nlp-based-product-as-a-high-school-student-f0b8f2e85edc/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/vagifaliyev/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/ai-feynman-2-0-learning-regression-equations-from-data-3232151bd929/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/lemaysolutions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/handling-missing-data-like-a-pro-part-1-deletion-methods-9f451b475429/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/francisadrianviernes/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://eng.uber.com/m4-forecasting-competition/"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-engineer"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/machine-learning"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/computer-science"
    },
    {
      "type": "external",
      "href": "https://arxiv.org/pdf/1905.10437.pdf"
    },
    {
      "type": "external",
      "href": "https://aihorizonforecast.substack.com/"
    },
    {
      "type": "external",
      "href": "https://en.wikipedia.org/wiki/ServiceNow"
    },
    {
      "type": "external",
      "href": "https://arxiv.org/pdf/1704.04110.pdf"
    },
    {
      "type": "external",
      "href": "https://github.com/ServiceNow/N-BEATS/blob/master/experiments/electricity/interpretable.gin"
    },
    {
      "type": "external",
      "href": "https://medium.com/towards-data-science/clip-the-most-influential-ai-model-from-openai-and-how-to-use-it-f8ee408958b1"
    },
    {
      "type": "external",
      "href": "https://medium.com/towards-data-science/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877"
    },
    {
      "type": "external",
      "href": "https://arxiv.org/pdf/2002.02887.pdf"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/in/nikos-kafritsas-b3699180/"
    },
    {
      "type": "external",
      "href": "https://aihorizonforecast.substack.com/welcome"
    },
    {
      "type": "external",
      "href": "https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful"
    },
    {
      "type": "external",
      "href": "https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:30:10Z",
  "source_url": "https://towardsdatascience.com/n-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# N-BEATS : Time-Series Forecasting with Neural Basis Expansion\nA Deep Learning model that provides accuracy and interpretability\n[Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\nNovember 25, 202212 min read\n# N-BEATS: Time-Series Forecasting with Neural Basis Expansion\n### A Deep Learning model for zero-shot time-series forecasting\n![Created with DALLE \\[1\\]](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1Yacgnk0WblMoYTvCTDpvJw.png)\nCreated with DALLE [1]\n**There's one thing that makes Time-Series Forecasting special.**\nIt was the only area of Data Science where Deep Learning and Transformers didn't decisively outperform the other models.\nLet's use the prestigious **Makridakis M-competitions** as a benchmark - a series of large-scale challenges that showcase the latest advances in the time-series forecasting area.\nIn the fourth iteration of the competition, known as **M4** , the winning solution was [ES-RNN [2]](https://eng.uber.com/m4-forecasting-competition/), a hybrid LSTM & Exponential Smoothing model developed by Uber. Interestingly, the 6 (out of 57) pure ML models performed so poorly, they barely surpassed the competition baseline.\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Machine Learning](https://roadmap.sh/machine-learning) and [Computer Science](https://roadmap.sh/computer-science) roadmaps.\nThat changed one year later. _Elemental AI_ (co-founded by **Yoshua Bengio**) published [**N-BEATS [3]**](https://arxiv.org/pdf/1905.10437.pdf)_**,**_ a pure Deep-Learning model that outperformed the winning ES-RNN model of M4 by 3%. But there's more.\nIn this article, we describe in depth:\n  1. **The architecture of** _**N-BEATS**_**, how the model works, and why is so powerful.**\n  2. **How** _**N-BEATS**_**produces interpretable forecasts.**\n  3. **How** _**N-BEATS**_**achieves unparallel zero-shot transfer learning.**\n  4. **Why** _**ARIMA**_**cannot natively support transfer learning.**\n\n\nLet's dive in.\n> I've launched [**AI Horizon Forecast**](https://aihorizonforecast.substack.com/)**,** a newsletter focusing on time-series and innovative AI research. Subscribe [here](https://aihorizonforecast.substack.com/) to broaden your horizons!\n## What is N-BEATS\n> N-BEATS is a fast, interpretable DL model that recreates the mechanisms of statistical models using double residual stacks of fully connected layers.\n**N-BEATS** stands for _**N**_ _eural_ _**B**_ _asis_ _**E**_ _xpansion_ _**A**_ _nalysis for_ _**T**_ _ime_ _**S**_ _eries,_ a revolutionary model created by **ElementAI.** This company was co-founded by **Yoshua Bengio** and was later acquired by [ServiceNow](https://en.wikipedia.org/wiki/ServiceNow).\n_N-BEATS_ **** is an interesting forecasting model because:\n  * It is the first pure Deep Learning model that outperformed all well-established statistical approaches.\n  * It provides interpretable forecasts.\n  * It sets the basis for **Transfer Learning** on time series.\n\n\nAround that time, **Amazon** published its novel time-series model, known as [**DeepAR [4]**](https://arxiv.org/pdf/1704.04110.pdf)**.** Although _DeepAR_ contains __ Deep Learning components, the model employs a few statistical concepts as well (maximum likelihood estimation).\n## N-BEATS - Overview\nLet's briefly discuss a few key traits of _N-BEATS_ :\n  * **Multiple time-series support** : _N-BEATS_ can be trained on multiple time series, each one representing a different distribution.\n  * **Fast Training:** The model does not contain any Recurrent or self-attention layers - thus, faster training & stable gradient flow.\n  * **Multi-horizon forecasting** : The model produces multi-step predictions.\n  * **Interpretability:** The authors developed 2 model versions, the _**generic**_ version, and the _**interpretable**_ version. The interpretable version can output interpretable predictions, regarding trend and seasonality.\n  * **Zero-shot Transfer Learning:** The model can transfer its knowledge to other time-series datasets with astounding success.\n\n\n> **Note:** The original N-BEATS implementation by ElementAI works on univariate time-series only. The Darts library has released an updated version that supports multivariate time-series and probabilistic outputs. In this article, we focus on the original version.\n## N-BEATS - Generic Architecture\nThe _N-BEATS_ architecture is deep, yet very simple. **Figure 1** displays the top-level view:\n![Figure 1: The top-level architecture of N-BEATS \\(Source\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1wgLibCLYo7cSyO6moaK2Hg.png)\n**Figure 1:** The top-level architecture of N-BEATS ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nNotice 3 things:\n  1. The _**block**_ (blue color) - the basic processing unit.\n  2. The _**stack**_ (orange color) - a collection of blocks.\n  3. The _**final model**_ (yellow color) - a collection of stacks.\n\n\nEvery neural network layer in the model is just a dense (fully-connected) layer.\nLet's start with the first component, the basic block:\n### 1. The Basic Block\nSuppose `H` is the forecasting horizon. In _N-BEATS_ , the lookback window is a multiple of the horizon `H` .\n**Figure 2** displays the architecture of the basic block:\n![Figure 2: The basic Block architecture \\(Source\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1vFtl3dMCKaKChXY1_f9Oxw.png)\n**Figure 2:** The basic Block architecture ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nLet's take a look under the hood.\nIn **Figure 3,** we **** use the parameters of the paper's benchmark from the** Electricity dataset [5**]:\n![Figure 3: All operations inside the basic Block \\(Image by author\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1qgr5wJMd5dfHLi0Fls-Zsw.png)\n**Figure 3:** All operations inside the basic Block (Image by author)\nLet's see what happens here:\n  * The model looks back `3 days` = `72 hours` =`3 horizons` to predict the power usage of the next 24 hours.\n  * The block receives the lookback window input.\n  * The input then passes through a 4-layer neural network.\n  * The result of this computation is directed to 2 outputs. Here, the dense layers **Dense 5** estimate the theta parameters (`θ^b` and `θ^f`), which are called **expansion coefficients**.\n  * These parameters are then linearly projected into a new space using the **basis** layer transformations `g^b` and `g^f` to produce the _**backcast**_ and _**forecast**_ signals. This process is called \"**neural basis expansion** \".\n\n\n> So**,** how the backcast and forecast vectors are useful?\nThe **backcast** signal is the best-approximated vector that can optimally predict the **forecast** signal, given the `g^b` and `g^f` transformations. When `g^b` and `g^f` take specific forms, the backcast and forecast vectors become **interpretable** (more to that later).\n### 2. The Stack\nTo increase the effectiveness of the _neural expansion process,_ the authors stack many blocks together. This structure is displayed in **Figure 4:**\n![Figure 4: Stack of blocks \\(left\\) and stack of stacks \\(right\\) - \\(Source\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1yY7WxZUwKXzpf_jZVC6f7A.png)\n**Figure 4:** Stack of blocks (left) and stack of stacks (right) - ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nOnly the first block receives the original sequence input. The downstream blocks receive the backcast signal `**x_l+1**`from the previous block (where`l` is the block index, i.e. `l_1` is the first block in the stack).\n![Figure 5: Operations inside the block \\(Image by author\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1a_CeIE0dA1VcwyGi15FxNQ.png)\n**Figure 5:** Operations inside the block (Image by author)\nInside each stack, the backcast and forecast signals are organized into two branches: This topology is called **doubly residual stacking** and can be **** described by the following equations:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1Itp_psm_L_KQ_Y1_FvgNiA.png)\nIn each block, the model removes the part of the backcast signal **`x̂** _l`from the input **`x**_l` that has approximated well. In other words:\n> The model at each block learns to optimally approximate a portion of the input signal, and sends the rest to be approximated by the downstream blocks.\nSince each block models only a portion of the input signal, the final forecast is the sum of all _forecast_ `ŷ` signals from all blocks.\nFinally, the stacks are also stacked (**Figure 4,** right). This architectural choice further increases the depth of the model and enhances its ability to learn complex time sequences.\nWe have seen how the generic version of _N-BEATS_ works. Next, we will describe the _interpretable_ version.\n## Are N-BEATS and ARIMA related?\nIf you are familiar with **ARIMA** , you might have noticed a few similarities with the _N-BEATS_ approach _._\n_ARIMA_ is modeled using the **Box-Jenkins** method, which is an iterative process. Specifically:\n  1. First, we guess the orders of the **AR()** and **MA()** functions the (`p` and `q` parameters).\n  2. Afterwards, we estimate the coefficients of these parameters using e.g. maximum likelihood estimation.\n  3. Then, we verify if the model's conditions hold. For instance, the model's residual errors should be normal and independent. If not, we return to step 1 and repeat the process. This time, we add new `p` and `q` degrees on top of the previous ones.\n\n\nIn other words, in each step of Box-Jenkins, we add more information to our model. Each iteration creates a better representation of the input, based on the model residuals.\nHence, we can conclude that:\n> In N-BEATS, each successive block models only the residual error due to the reconstruction of the backcast from the previous block and then updates the forecast based on that error. This process mimics the Box-Jenkins method when fitting ARIMA models.\nThe main difference between the 2 approaches is the target function of the residuals. _ARIMA_ focuses on the quality of the residuals, while _N-BEATS_ uses an arbitrary loss function.\nPlus, we don't manually adjust any equation with _N-BEATS_ — the basis transformations are automatically optimized with backpropagation. With _ARIMA_ however, we make heavy use of autocorrelation and partial autocorrelation plots to guess the order of `AR()` and `MA()` functions.\n> **Note:** Some ARIMA libraries implement the Box-Jenkins method with slight variations, depending on the programming language and the library. Here, we document the textbook implementation.\n## N-BEATS - Interpretable Architecture\nWith a few changes, the _N-BEATS_ model can become interpretable: These are:\n  * We use only 2 stacks, the **trend** and **seasonality** stacks. The generic architecture uses at least 30.\n  * Both trend and seasonality stacks contain 3 blocks. In the generic architecture, we have one block per stack.\n  * The **basis** layer weights of `g^b` and `g^f` are shared at the stack level.\n\n\nThe basic idea is that `g^b` and `g^f` basis take specific forms. Let's describe them in more detail.\n### **The Trend Block**\nOur goal is to restructure the `g^b` and `g^f` functions as monotonic that vary slowly across the forecast window.\nGiven a time vector t=[0,1,2,...,_H_ −2,_H_ −1] (`H` is the horizon), the thetas `θ` from the previous layer and the polynomial degree `p`, the trend model is defined as:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/11fEyKnCGBuw3j3wCdrjGig.png)\nIn other words, we use the architecture of **Figure 3** (the generic block) and swap the last linear layer with the above operation. The result is shown in **Figure 6:**\n![Figure 6: The Trend block \\(Image by author\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1e9DBrgNZXqxwVuYvz5mDTg.png)\n**Figure 6:** The Trend block (Image by author)\nThe backcast equations are not described in the paper, but they can easily be derived from the project's implementation. Moreover, the trend and seasonality blocks (**Figure 6** and **Figure 7**) adopt the parameters from the [official project repo](https://github.com/ServiceNow/N-BEATS/blob/master/experiments/electricity/interpretable.gin):\nini\n\n```\ninterpretable.seasonality_layer_size = 2048\ninterpretable.seasonality_blocks = 3\ninterpretable.seasonality_layers = 4\ninterpretable.trend_layer_size = 256\ninterpretable.degree_of_polynomial = 3\ninterpretable.trend_blocks = 3\ninterpretable.trend_layers = 4\ninterpretable.num_of_harmonics = 1\n```\n\n### The Seasonality Block\nSimilarly, we swap the final layer with appropriate `g^b` and `g^f` functions that capture seasonality. An excellent candidate would be the Fourier series:\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1v1pQbx2pQLBUffvn-4x_uQ.png)\nThen, the architecture becomes:\n![Figure 7: The Seasonality block \\(Image by author\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1ZNSHEkR8rQ8PWcWkpX6Flg.png)\n**Figure 7:** The Seasonality block (Image by author)\nAgain, we stress that in all interpretable stacks, the `g^b` and `g^f` weights within the stack are shared.\n## Experimental Results\nFinally, the authors tested the performance of _N-BEATS_ in 3 popular time-series datasets - M3[6], M4[7], and Tourism[8].\n### Experimental Setup\nThe authors categorized all models into specific classes and compared _N-BEATS_ with the best model of each class. For example, the _DL/TS hybrid_ is the winning ES-RNN model on M4.\nSince all these datasets were used for data science competitions, all participants relied on ensembling to achieve maximum performance. Hence, the _N-BEATS_ authors relied on ensembling to be comparable. They used three variations: **N-BEATS-G** (generic)**, N-BEATS-I** (interpretable), **** an** d N-BEATS-I+**G (ensemble of all models from N-BEATS-G and N-BEATS-I).\nOn top of that, they created 6 different models with look back windows `2H, 3H .. 7H` for every horizon and variation. For extra details about the ensembling configurations,[ check the original paper](https://arxiv.org/pdf/1905.10437.pdf). In total, the authors ensembled 180 models to report the final results on the test set.\n### Results\nThe results for all datasets are shown in **Figure 8:**\n![Figure 8: Experimental results on M3, M4, and Tourism datasets \\(Source\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1pXY95UmKctKYx-Nvm_Lidg.png)\n**Figure 8:** Experimental results on M3, M4, and Tourism datasets ([Source](https://arxiv.org/pdf/1905.10437.pdf))\nThe results are quite impressive.\nThe _N-BEATS_ outperforms the other implementations on all datasets, with _N-BEATS-I+G_ being the most successful.\nNote that in every dataset, the competitions use the MAPE, sMAPE, and OWA metrics (lower is better). These metrics are popular in time-series competitions.\n> **Note:** Contrary to the other approaches, N-BEATS does not require any hand-crafted feature engineering, or input scaling. Thus, N-BEATS is far more easier to use in different time-series tasks.\n## Zero-shot transfer learning\nThe main contribution of _N-BEATS_ is its ability to successfully implement transfer learning on time series.\n### Preliminaries\n**Transfer learning** is a more general term— it refers to how a model can transfer its knowledge across different datasets. This is already established on Computer Vision or NLP tasks: We can download a pretrained model and adjust it to our dataset with fine-tuning.\n**Meta-learning** (or few-shot-learning) is when the model can adapt to our dataset with little training/fine-tuning. The best scenario is _**zero-shot learning**_ , where the model is not trained on the target dataset.\n> Zero-shot learning is the model's ability to make predictions using unseen data, without having specifically trained on them. This learning method better reflects the human perception.\nBesides, this new paradigm shift towards meta-learning has been embraced by the latest AI research, such as OpenAI **—**[**CLIP [9]**](https://medium.com/towards-data-science/clip-the-most-influential-ai-model-from-openai-and-how-to-use-it-f8ee408958b1) and [**Whisper[10]**](https://medium.com/towards-data-science/whisper-transcribe-translate-audio-files-with-human-level-performance-df044499877) are a few of them.\n### Zero-Shot N-BEATS\n**Yoshua Bengio** (co-author of _N-BEATS_) has already established the theoretical foundation of transfer learning on forecasting tasks in his previous work [11].\nThe authors of _N-BEATS_ published a follow-up paper[12] where it summarizes most of this work, including what requirements a time-series forecasting model should meet to perform efficient transfer learning.\nLet's focus on _N-BEATS._\nThe authors state that _N-BEATS's_ meta-learning ability hinges on two procedures: i) the **inner learning** procedure and the **outer learning** procedure. They are shown in **Figure 9:**\n![Figure 9: Meta-learning procedures in N-BEATS \\(Source, edited by author\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1VICF6tL0_v2H19FBB1-mAg.png)\n**Figure 9:** Meta-learning procedures in N-BEATS ([Source](https://arxiv.org/pdf/1905.10437.pdf), edited by author)\n**The inner loop** takes place inside each block and focuses on learning task-specific characteristics.\n**The outer loop** takes place at the stack level. Here, the model learns global characteristics across all tasks.\n> In other words, the inner loop learns local temporal traits, while the outer loop learns longer dependencies across all time-series.\nHowever, this begs the following section:\n### Why is ARIMA not suitable for Transfer Learning?\nIf an established paradigm dictates which criteria a forecasting model should meet to be appropriate for transfer learning, then why ARIMA is not?\nTo answer this question, we will again focus on the two learning procedures described by [12]\nWhen creating an ARIMA model, there are 2 challenges:\n  1. **Parameter estimation:** Parameters are estimated using a statistical technique like maximum likelihood. **This is the inner loop.**\n  2. **Model formulation:** This defines the form of the autoregressive equation. For example, if our model has a little trend, no seasonality, and normal residuals, we can decide that a Gaussian ETS will probably do the job. **This is the outer loop.**\n\n\nNotice that statistical models only pass the first criterion, the inner loop.\nThe parameter estimation part is straightforward once we have chosen our model. However, the model formulation part requires human intervention. Therefore, regarding the statistical approaches, **the role of the outer loop is not fulfilled.**\nThus, we conclude:\n> N-BEATS replaces the predefined set of rules for model parameter estimation of classical statistical models with a learnable parameter estimation strategy. This strategy allows N-BEATS to generalize well on multiple, unseen time sequences.\n### Zero-Shot learning results of N-BEATS\nIn this experimental analysis, the authors enrich the results of the previous benchmark (**Figure 8**) with some new models:\n  * **N-BEATS-M4:** The authors create a pretrained _N-BEATS_ models on the M4.\n  * **DeepAR-M4:** A pretrained _DeepAR_ model on the M4 is also added to the pool of models.\n\n\nThe total results are shown in **Figure 10** :\n![Figure 10: Comparison of zero-shot models \\(Source\\)](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/1CdT_-mP12KoV-7JtpVcIvA.png)\n**Figure 10:** Comparison of zero-shot models ([Source)](https://arxiv.org/pdf/2002.02887.pdf)\nAgain, the results are very interesting.\n  * Zero-shot _**N-BEATS-M4**_ outperforms all the other models on M4 and Tourism datasets (including the winners), even though it was not trained on them.\n  * Zero-shot **DeepAR-M4** seems to perform poorly. This is expected since _DeepAR_ is not suitable for transfer learning.\n  * In every dataset, the zero-shot _N-BEATS_ model performs very well compared to the tailored-trained _N-BEATS_. It would have been interesting to see an effective-robustness vs overall-robustness plot that is found in other zero-shot models such as Whisper.\n\n\n## Closing Remarks\n_N-BEATS_ is a breakthrough Deep Learning forecasting model that has left a lasting impact on the time-series field.\nIn this article, we described the two main strengths of _N-BEATS_ : First, it's a powerful model that produces SOTA results. Secondly, _N-BEATS_ establishes a well-defined framework for implementing zero-shot transfer learning. To the best of my knowledge, this is the first model to achieve this successfully.\nIn our next articles, we will present a programming tutorial with _N-BEATS,_ and describe a newer paper, called _N-HiTS_.\n* * *\n## Thank you for reading!\n  * Follow me on [Linkedin](https://www.linkedin.com/in/nikos-kafritsas-b3699180/)!\n  * Subscribe to my [newsletter](https://aihorizonforecast.substack.com/welcome), AI Horizon Forecast!\n\n\n> [**AutoGluon-TimeSeries : Creating Powerful Ensemble Forecasts - Complete Tutorial**](https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful)\n## References\n[1] Created from DALLE with the text prompt \"a neon sinusoidal signal transmitting through space, concept art\", to rg\n[2] Slawek Smyl et al. [_M4 Forecasting Competition: Introducing a New Hybrid ES-RNN Model_](https://eng.uber.com/m4-forecasting-competition/)\n[3] Boris O. et al. [_N-BEATS: Neural Basis Expansion Analysis For Interpretable Time Series Forecasting_](https://arxiv.org/pdf/1905.10437.pdf) _,_ ICLR (2020)\n[4] D. Salinas et al. [_DeepAR: Probabilistic forecasting with autoregressive recurrent networks_](https://arxiv.org/pdf/1704.04110.pdf), International Journal of Forecasting (2019).\n[5] [ElectricityLoadDiagrams20112014](https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014) dataset by UCI, CC BY 4.0.\n[6] M3 Dataset <https://forecasters.org/resources/time-series-data/>, Public domain\n[7] M4 Dataset <https://forecasters.org/resources/time-series-data/>, Public domain\n[8] Tourism Dataset <https://www.kaggle.com/c/tourism1>, Public domain\n[9] Alec Radford et al. [_Learning Transferable Visual Models From Natural Language Supervision_](https://arxiv.org/pdf/2103.00020.pdf) _(Feb 2021)_\n[10] Alec Radford et al. [Robust Speech Recognition via Large-Scale Weak Supervision](https://cdn.openai.com/papers/whisper.pdf) _(September 2022)_\n[11] Yoshua Bengio et al. _Learning a synaptic learning rule_\n[12] Boris O. et al. [_Meta-learning framework with applications to zero-shot time-series forecasting_](https://arxiv.org/pdf/2002.02887.pdf)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657498919_dpu9mi.jpeg)\nWritten By\n## [Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\n[See all from Nikos Kafritsas](https://towardsdatascience.com/author/nikoskafritsas/)\n[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Deep Learning](https://towardsdatascience.com/tag/deep-learning/)[Science](https://towardsdatascience.com/tag/science/)[Time Series Forecasting](https://towardsdatascience.com/tag/time-series-forecasting/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&title=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&title=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fn-beats-time-series-forecasting-with-neural-basis-expansion-af09ea39f538%2F&text=N-BEATS%C2%A0%3A%20Time-Series%20Forecasting%20with%20Neural%20Basis%20Expansion)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/08/1KxBDL1EJTSMg1WzpeRmDyg-scaled.jpeg)](https://towardsdatascience.com/my-challenges-in-building-an-nlp-based-product-as-a-high-school-student-f0b8f2e85edc/)\n## [My challenges in building an NLP-based product as a high school student](https://towardsdatascience.com/my-challenges-in-building-an-nlp-based-product-as-a-high-school-student-f0b8f2e85edc/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAnd how I managed to solve them without spending a dime of my non-existent savings\n[Vagif Aliyev](https://towardsdatascience.com/author/vagifaliyev/)\nAugust 16, 20217 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/07/17TKUsulm29UzEwb0V6tAoA.jpeg)](https://towardsdatascience.com/ai-feynman-2-0-learning-regression-equations-from-data-3232151bd929/)\n## [AI Feynman 2.0: Learning Regression Equations From Data](https://towardsdatascience.com/ai-feynman-2-0-learning-regression-equations-from-data-3232151bd929/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nLet's kick the tires on a brand new library\n[Daniel Shapiro, PhD](https://towardsdatascience.com/author/lemaysolutions/)\nJuly 1, 20209 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/07/0DbR_2AhcZVXD_tUQ-scaled.jpg)](https://towardsdatascience.com/handling-missing-data-like-a-pro-part-1-deletion-methods-9f451b475429/)\n## [Handling \"Missing Data\" Like a Pro - Part 1 - Deletion Methods](https://towardsdatascience.com/handling-missing-data-like-a-pro-part-1-deletion-methods-9f451b475429/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nBasic and Advanced Techniques for the 21st Century Data Scientist\n[TheDataProf](https://towardsdatascience.com/author/francisadrianviernes/)\nJuly 7, 20216 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/09/0QAJuA_dPiduExxrG-scaled.jpg)](https://towardsdatascience.com/feature-selection-for-machine-learning-in-python-filter-methods-6071c5d267d5/)\n## [Feature Selection for Machine Learning in Python - Filter Methods](https://towardsdatascience.com/feature-selection-for-machine-learning-in-python-filter-methods-6071c5d267d5/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nHow to select the right predictors using statistical measures\n[Jack Tan](https://towardsdatascience.com/author/jackyeetan/)\nSeptember 13, 20200 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/02/0ZDtuoCEjNHy-z5dU.jpg)](https://towardsdatascience.com/4-nlp-libraries-for-automatic-language-identification-of-text-data-in-python-cbc6bf664774/)\n## [4 NLP Libraries for Automatic Language Identification of Text Data In Python](https://towardsdatascience.com/4-nlp-libraries-for-automatic-language-identification-of-text-data-in-python-cbc6bf664774/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nComprehensive overview of open-source libraries for automatic language detection\n[Zoumana Keita](https://towardsdatascience.com/author/zoumanakeita/)\nFebruary 21, 20222 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/04/0HAp1-ehLO2q3kAxS-scaled.jpg)](https://towardsdatascience.com/is-ai-there-yet-ef57cd306555/)\n## [Is AI there yet?](https://towardsdatascience.com/is-ai-there-yet-ef57cd306555/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA quick summary through the problems faced by AI today!\n[Alexiei Dingli](https://towardsdatascience.com/author/alexieidingli/)\nApril 1, 202114 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/02/1MV_KZ9zETC7UwS0eoSMn-g-scaled.jpeg)](https://towardsdatascience.com/pump-it-up-with-catboost-828bf9eaac68/)\n## [Pump it Up with CatBoost](https://towardsdatascience.com/pump-it-up-with-catboost-828bf9eaac68/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nData Mining and a Simple Starter Model\n[Taras Baranyuk](https://towardsdatascience.com/author/taras-baranyuk/)\nFebruary 15, 20219 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/04/11Wp9dBdh3iMmlRvu4djscQ-scaled.jpeg)](https://towardsdatascience.com/the-application-of-an-artificial-neuron-on-the-iris-dataset-in-python-9fb4275fadd/)\n## [The application of an Artificial Neuron on the Iris Dataset in Python](https://towardsdatascience.com/the-application-of-an-artificial-neuron-on-the-iris-dataset-in-python-9fb4275fadd/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nPredicting flowers' variety with a single layer neural network without a deep learning library\n[Giovanni Valdata](https://towardsdatascience.com/author/giovanni-valdata/)\nApril 5, 202210 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/09/0q0E7DzAjNozaGO5p.jpg)](https://towardsdatascience.com/debugging-in-python-is-easy-with-with-assert-statements-ff333bfb3388/)\n## [Debugging in Python Is Easy With Assert Statements](https://towardsdatascience.com/debugging-in-python-is-easy-with-with-assert-statements-ff333bfb3388/)\n[Programming](https://towardsdatascience.com/category/programming/)\nA look into a tool that allows a pain-free troubleshooting experience\n[Aashish Nair](https://towardsdatascience.com/author/aashishnair/)\nSeptember 20, 20224 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4970/image?etag=1780565225463&width=500&height=500) Productivity Tips, Data Career Insights, and Other Recent Must-Reads ](https://towardsdatascience.com/productivity-tips-data-career-insights-and-other-recent-must-reads-5c47eb7a2fe0/ \"Productivity Tips, Data Career Insights, and Other Recent Must-Reads\")\n\n\n",
  "body_base_path": "attachments/1c0f790a1ada/pages/",
  "body_markdown_path": "attachments/1c0f790a1ada/pages/archived-body.md",
  "local_html": "attachments/1c0f790a1ada/pages/archived-body.html",
  "body_source": "prior_capture"
}