{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial - Time series forecasting\n", "\n", "## Introduction\n", "\n", "Time series are an ubiquitous type of data in all types of processes. Producing forecasts for them can be highly valuable in domains like retail or industrial manufacture, among many others.\n", "\n", "Lightwood supports time series forecasting (both univariate and multivariate inputs), handling many of the pain points commonly associated with setting up a manual time series predictive pipeline. \n", "\n", "In this tutorial, we will train a lightwood predictor and analyze its forecasts for the task of counting sunspots in monthly intervals.\n", "\n", "## Load data\n", "\n", "Let's begin by loading the dataset and looking at it:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-05-07T17:15:14.342783Z", "iopub.status.busy": "2024-05-07T17:15:14.342325Z", "iopub.status.idle": "2024-05-07T17:15:14.884075Z", "shell.execute_reply": "2024-05-07T17:15:14.883399Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | Month | \n", "Sunspots | \n", "
---|---|---|
0 | \n", "1749-01 | \n", "58.0 | \n", "
1 | \n", "1749-02 | \n", "62.6 | \n", "
2 | \n", "1749-03 | \n", "70.0 | \n", "
3 | \n", "1749-04 | \n", "55.7 | \n", "
4 | \n", "1749-05 | \n", "85.0 | \n", "
... | \n", "... | \n", "... | \n", "
2815 | \n", "1983-08 | \n", "71.8 | \n", "
2816 | \n", "1983-09 | \n", "50.3 | \n", "
2817 | \n", "1983-10 | \n", "55.8 | \n", "
2818 | \n", "1983-11 | \n", "33.3 | \n", "
2819 | \n", "1983-12 | \n", "33.4 | \n", "
2820 rows × 2 columns
\n", "\n", " | original_index | \n", "prediction | \n", "order_Month | \n", "confidence | \n", "lower | \n", "upper | \n", "anomaly | \n", "prediction_sum | \n", "lower_sum | \n", "upper_sum | \n", "confidence_mean | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
10 | \n", "10 | \n", "[50.51358374451768, 53.78975402923053, 51.0303... | \n", "[-273628800.0, -270950400.0, -268272000.0, -26... | \n", "[0.79, 0.02, 0.9991, 0.9991, 0.9991, 0.9991] | \n", "[30.14139795091352, 32.97332333016865, 0.0, 0.... | \n", "[70.88576953812185, 74.60618472829242, 137.289... | \n", "False | \n", "294.494088 | \n", "0.0 | \n", "209.075865 | \n", "0.801067 | \n", "