Techno Blender
Digitally Yours.

Time Series Forecasting made easy with Darts | by Satyam Kumar | Aug, 2022

0 75


An open-source package for time series preprocessing and forecasting with unified and user-friendly APIs

Image by Colin Behrens from Pixabay

Time series forecasting involves model building on historical time-stamped data to make scientific predictions and drive future strategic decision-making. Time series forecasting has many uses in various domains including:

  • Predict consumer demand for every product
  • Forecasting pandemic spread, diagnosis, medication, and planning in healthcare
  • Anomaly detection, cyber security, and predictive maintenance
  • Predict if the current infrastructure can handle traffic in the near and far future

and many more.

Time series forecasting is a bit different from traditional machine learning use-case, as it involves a temporal ordering of the data that must be considered during feature engineering and modeling.

Motivation:

For training a time-series forecasting model, you end up in a situation where you use Pandas for pre-processing, statsmodel for seasonality and statistical tests, scikit-learn or Facebook Prophet for forecasting, and custom code to implement backtesting and model selection.

End-to-end time series forecasting becomes a tedious task for data scientists as different libraries have different APIs and data types. For traditional machine learning use-cases, we have the scikit-learn package, which provides a consistent API for end-to-end machine learning modeling.

Darts attempts to be a scikit-learn for time series, and its primary goal is to simplify the whole time series forecasting approach. In this article, we will discuss the darts package and its implementation.

Darts is a Python library for easy manipulation and forecasting of time series. It offers implementations of a variety of models, from classics such as ARIMA to deep neural networks, that can be implemented the same way as scikit-learn models (using fit and predict APIs).

Some of the features of the Darts package are:

  • It’s built around the immutable TimeSeries class
  • It has a unified and user-friendly scikit-learn-like APIs interface like fit() and predict()
  • It offers a variety of models from classical models to state-of-the-art ML/DL approaches
  • It provides APIs for end-to-end time series forecasting use-cases including data discovery, data preprocessing, forecasting, and model selection and evaluation.
(Source), Overview of Dart package

Further, let’s discuss, explore and implement the fundamental capabilities of the Darts package for the Air Passengers Dataset (open-source) that has Monthly Air Passengers Dataset, from 1949 to 1960.

Read TimeSeries:

Read the Air Passenger dataset and split it into training and validation data, and further visualize it.

(Image by Author), Visualize the Training and Validation data

Forecasting:

Darts offers the implementation of various classical and advanced time-series modeling techniques including ARIMA, Theta, Exponential Smoothing, N-Beats, Facebook Prophet, etc.

Follow the darts.models documentation to know more about each of the implementation.

(Image by Author), Visualize the Training, Validation, and Predicted data

Evaluation and Tuning:

Darts offers implementation to compute the performance of your model, and tune the hyperparameters of the estimator to get an optimized model.

  • Along with classical time-series models, Darts also offers state-of-the-art modern ML/DL functionalities.
  • Probabilistic Forecasting
  • Training on multiple series and large datasets
  • Support for multi-dimensional series. N-Beats modeling can be performed on multiple dimensional time series data.
  • Include external past and future data. Past and future covariates data can be passed during model training to improve the model performance.


An open-source package for time series preprocessing and forecasting with unified and user-friendly APIs

Image by Colin Behrens from Pixabay

Time series forecasting involves model building on historical time-stamped data to make scientific predictions and drive future strategic decision-making. Time series forecasting has many uses in various domains including:

  • Predict consumer demand for every product
  • Forecasting pandemic spread, diagnosis, medication, and planning in healthcare
  • Anomaly detection, cyber security, and predictive maintenance
  • Predict if the current infrastructure can handle traffic in the near and far future

and many more.

Time series forecasting is a bit different from traditional machine learning use-case, as it involves a temporal ordering of the data that must be considered during feature engineering and modeling.

Motivation:

For training a time-series forecasting model, you end up in a situation where you use Pandas for pre-processing, statsmodel for seasonality and statistical tests, scikit-learn or Facebook Prophet for forecasting, and custom code to implement backtesting and model selection.

End-to-end time series forecasting becomes a tedious task for data scientists as different libraries have different APIs and data types. For traditional machine learning use-cases, we have the scikit-learn package, which provides a consistent API for end-to-end machine learning modeling.

Darts attempts to be a scikit-learn for time series, and its primary goal is to simplify the whole time series forecasting approach. In this article, we will discuss the darts package and its implementation.

Darts is a Python library for easy manipulation and forecasting of time series. It offers implementations of a variety of models, from classics such as ARIMA to deep neural networks, that can be implemented the same way as scikit-learn models (using fit and predict APIs).

Some of the features of the Darts package are:

  • It’s built around the immutable TimeSeries class
  • It has a unified and user-friendly scikit-learn-like APIs interface like fit() and predict()
  • It offers a variety of models from classical models to state-of-the-art ML/DL approaches
  • It provides APIs for end-to-end time series forecasting use-cases including data discovery, data preprocessing, forecasting, and model selection and evaluation.
(Source), Overview of Dart package

Further, let’s discuss, explore and implement the fundamental capabilities of the Darts package for the Air Passengers Dataset (open-source) that has Monthly Air Passengers Dataset, from 1949 to 1960.

Read TimeSeries:

Read the Air Passenger dataset and split it into training and validation data, and further visualize it.

(Image by Author), Visualize the Training and Validation data

Forecasting:

Darts offers the implementation of various classical and advanced time-series modeling techniques including ARIMA, Theta, Exponential Smoothing, N-Beats, Facebook Prophet, etc.

Follow the darts.models documentation to know more about each of the implementation.

(Image by Author), Visualize the Training, Validation, and Predicted data

Evaluation and Tuning:

Darts offers implementation to compute the performance of your model, and tune the hyperparameters of the estimator to get an optimized model.

  • Along with classical time-series models, Darts also offers state-of-the-art modern ML/DL functionalities.
  • Probabilistic Forecasting
  • Training on multiple series and large datasets
  • Support for multi-dimensional series. N-Beats modeling can be performed on multiple dimensional time series data.
  • Include external past and future data. Past and future covariates data can be passed during model training to improve the model performance.

FOLLOW US ON GOOGLE NEWS

Read original article here

Denial of responsibility! Techno Blender is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected]. The content will be deleted within 24 hours.
Leave a comment