Updated Notebook comments
This commit is contained in:
parent
12c879f016
commit
633c4d12d3
5 changed files with 216 additions and 2413 deletions
|
@ -4,7 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Bayesian Optimisation of starting Gaussian Process hyperparameters"
|
||||
"# Gaussian Process Model Training and Performance Evaluation"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -213,7 +213,7 @@
|
|||
"id": "0aba0df5-b0e3-4738-bb61-1dad869d1ea3"
|
||||
},
|
||||
"source": [
|
||||
"## Load previously exported data"
|
||||
"## Load previously exported CARNOT 'experimental' data"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -226,6 +226,13 @@
|
|||
"dfs_test = []"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Separate into training and testing data sets:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
|
@ -249,6 +256,13 @@
|
|||
" dfs_test.append(pd.read_csv(f\"../Data/Good_CARNOT/{exp}_table.csv\").rename(columns = {'Power': 'SimulatedHeat'}))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Separate columns into exogenous inputs, controlled inputs and outputs:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
|
@ -262,6 +276,13 @@
|
|||
"y_cols = ['SimulatedTemp']"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Impose the autoregressive lags for each input group:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
|
@ -511,6 +532,13 @@
|
|||
" return df_gpr"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Merge all the training dataframes:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
|
@ -667,13 +695,19 @@
|
|||
"df_gpr_train.head()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Select all points in the training dataset:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"train_dataset_size = 15 * 96\n",
|
||||
"train_dataset_size = -1"
|
||||
]
|
||||
},
|
||||
|
@ -1401,6 +1435,13 @@
|
|||
"y_range = np.arange(1,6)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Iterate over all combination of lags and compute for each the RMSE, SMSE, LPD and MSLL errors:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
@ -1545,6 +1586,13 @@
|
|||
"## Multistep prediction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Select the dataset which will be used for multistep prediction:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 54,
|
||||
|
@ -1556,6 +1604,13 @@
|
|||
"df_output = dfs_gpr_test[test_dataset_idx][dict_cols['y'][1]]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Select the starting index in the test dataset and the number of consecutive points to simulate:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 55,
|
||||
|
@ -1617,26 +1672,6 @@
|
|||
"plt.title(f\"Multi step prediction over {N_pred} steps for Test dataset {test_dataset_idx}\")\n",
|
||||
"plt.savefig(f\"../Thesis/Plots/GP_{w_lags}{u_lags}{y_lags}_{train_dataset_size}pts_test_prediction_{N_pred}_steps.pdf\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 141,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"TensorShape([2612, 7])"
|
||||
]
|
||||
},
|
||||
"execution_count": 141,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"m.data[0].shape"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue