{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Time-Series Forecasting with LSTM & Prophet\n",
        "Xenors practice notebook. Run each cell and compare the output with the tutorial page.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Use walk-forward splits\n",
        "Time-series validation must preserve chronology.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "series=list(range(12))\n",
        "for cut in [6,8,10]:\n",
        "    train=series[:cut]; test=series[cut:cut+2]\n",
        "    print(len(train),test)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Expected/checkpoint**\n",
        "```text\n6 [6, 7]\n8 [8, 9]\n10 [10, 11]\n```\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Compare against a naive baseline\n",
        "Complex models should beat simple persistence or seasonal baselines.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "y=[101,103,102,106]\n",
        "pred=[100,101,103,102]\n",
        "mae=sum(abs(a-b) for a,b in zip(y,pred))/len(y)\n",
        "print('MAE',mae)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "**Expected/checkpoint**\n",
        "```text\nMAE 2.0\n```\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.x"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}