{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "e7e09770", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import xarray as xr\n", "from sklearn.model_selection import train_test_split\n", "import matplotlib.pyplot as plt\n", "from tensorflow.keras import layers\n", "from tensorflow import keras\n", "import keras_tuner as kt\n", "from pathlib import Path" ] }, { "cell_type": "code", "execution_count": 3, "id": "797deb25", "metadata": {}, "outputs": [], "source": [ "file_path = Path.cwd().parent / 'finalprojectdata' / 'conv_train_allimages.nc'\n", "data = xr.open_dataset(file_path)" ] }, { "cell_type": "code", "execution_count": 5, "id": "399483a9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray 'labels' (sample: 148505)> Size: 1MB\n",
"[148505 values with dtype=float64]\n",
"Coordinates:\n",
" * sample (sample) int32 594kB 0 1 2 3 4 ... 148501 148502 148503 148504<xarray.Dataset> Size: 2GB\n",
"Dimensions: (sample: 148505, x: 27, y: 27)\n",
"Coordinates:\n",
" * sample (sample) int32 594kB 0 1 2 3 4 ... 148501 148502 148503 148504\n",
" * x (x) int32 108B 0 1 2 3 4 5 6 7 8 ... 18 19 20 21 22 23 24 25 26\n",
" * y (y) int32 108B 0 1 2 3 4 5 6 7 8 ... 18 19 20 21 22 23 24 25 26\n",
"Data variables: (12/16)\n",
" z_images (sample, x, y) float32 433MB ...\n",
" v_images (sample, x, y) float32 433MB ...\n",
" smb_images (sample, x, y) float32 433MB ...\n",
" temp_images (sample, x, y) float64 866MB ...\n",
" labels (sample) float64 1MB ...\n",
" EAST (sample) float64 1MB ...\n",
" ... ...\n",
" smb (sample) float64 1MB ...\n",
" z (sample) float64 1MB ...\n",
" s (sample) float64 1MB ...\n",
" temp (sample) float64 1MB ...\n",
" ith_bm (sample) float64 1MB ...\n",
" gridCellId (sample) float64 1MB ...\n",
"Attributes:\n",
" description: CNN data with averaged scalar features and one image per pi...