How to Get Started with Neural Forecasting using NeuralForecast

Mar 15, 2023 | Data Science

Welcome to the world of NeuralForecast, where cutting-edge neural forecasting models meet user-friendly implementation! Whether you are a data scientist, a statistician, or just someone keen to explore forecasting techniques, this guide will help you get started with this powerful library. Let’s dive into the process step-by-step!

Installation

Installing NeuralForecast is as easy as pie. You have two options at your disposal:

  • Using pip: python
  • Using conda: python conda install -c conda-forge neuralforecast

For further details, check out our Installation Guide.

Quick Start

Let’s look at a minimal example to kickstart your journey:

from neuralforecast import NeuralForecast
from neuralforecast.models import NBEATS
from neuralforecast.utils import AirPassengersDF

nf = NeuralForecast(
    models = [NBEATS(input_size=24, h=12, max_steps=100)],
    freq = 'M'
)
nf.fit(df=AirPassengersDF)
nf.predict()

In the above code, you can picture NeuralForecast like a chef in a kitchen, where:

  • NeuralForecast: The chef preparing a meal.
  • NBEATS: The special dish the chef is preparing, following a specific recipe (the model’s configuration).
  • AirPassengersDF: The fresh ingredients (the data) that the chef uses to create the dish.

This analogy highlights how NeuralForecast operates: it’s about selecting the right model and feeding it the right data to produce accurate forecasts!

Why NeuralForecast?

We believe that neural forecasting methods can significantly enhance the accuracy and efficiency of forecasting pipelines. Unfortunately, many existing implementations are either too complex or computationally heavy. Hence, NeuralForecast aims to simplify the usage of these advanced methods while maintaining high performance.

Features

  • Fast and accurate implementations of over 30 state-of-the-art models. Check out the entire collection here.
  • Support for exogenous variables and static covariates.
  • Interpretability methods for trend, seasonality, and exogenous components.
  • Probabilistic Forecasting with adapters for quantile losses and parametric distributions.
  • Automatic Model Selection with automatic hyperparameter tuning.
  • Familiar sklearn-like syntax for .fit and .predict.

Troubleshooting

If you encounter any issues while using NeuralForecast, here are some common troubleshooting steps:

  • Ensure you have installed the library correctly, using either pip or conda as instructed.
  • Check if your input data frame, like AirPassengersDF, is formatted correctly and contains no missing values.
  • Make sure you have the correct model setup with appropriate parameters.
  • If you receive an error message, try Googling it or checking our documentation.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

That’s it for our quick guide on NeuralForecast! Happy forecasting!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox