{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "from tensorflow import keras\n", "from sklearn.model_selection import train_test_split\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from sklearn.preprocessing import StandardScaler\n", "import tensorflow as tf" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "energy_df = pd.read_csv(\"../data/extended_energy_data.csv\")\n", "energy_df.bfill(inplace=True)\n", "energy_df.set_index(\"date\", inplace=True)\n", "energy_df.index = pd.to_datetime(energy_df.index)\n", "energy_df = energy_df.resample(\"h\").sum()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
26305 rows × 7 columns
Model: \"sequential\"\n", "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓\n", "┃ Layer (type) ┃ Output Shape ┃ Param # ┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩\n", "│ lstm (LSTM) │ (None, 168, 50) │ 11,000 │\n", "├─────────────────────────────────┼────────────────────────┼───────────────┤\n", "│ lstm_1 (LSTM) │ (None, 50) │ 20,200 │\n", "├─────────────────────────────────┼────────────────────────┼───────────────┤\n", "│ dense (Dense) │ (None, 1) │ 51 │\n", "└─────────────────────────────────┴────────────────────────┴───────────────┘\n", "
Total params: 31,251 (122.07 KB)\n", "
Trainable params: 31,251 (122.07 KB)\n", "
Non-trainable params: 0 (0.00 B)\n", "