Technical requirements
Creating a new Python environment for this chapter when installing new libraries such as TensorFlow or PyTorch is highly recommended. If you need a quick refresher on creating a virtual Python environment, check out the Development environment setup recipe from Chapter 0 on GitHub. The chapter covers two methods: using conda and venv.
The following libraries will be used throughout the chapter: TensorFlow, Darts, and NeuralForecast. You can install them with pip, as follows:
pip install tensorflow
pip install darts
pip install neuralforecast
When you install darts, it will install additional libraries such as torch, pytorch-lightning, and statsforecast, to name a few.
In the first recipe, you will be using the Monthly Energy Consumption dataset used in Chapter 11.
Start by loading the dataset and libraries that are frequently used throughout:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path...