import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler
from keras.models import Sequential from keras.layers import Dense from keras.optimizers import SGD
SEED = 2017
Load the dataset:
data = pd.read_csv('Data/winequality-red.csv', sep=';') y = data['quality'] X = data.drop(['quality'], axis=1)
Split the dataset into training and testing:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=SEED)
We should focus on the validation accuracy and use early stopping to stop the training after around 450 epochs. This results in the highest validation accuracy. in the sections Improving generalization with regularization and A`dding dropout to prevent overfitting, we will introduce techniques to prevent overfitting. By using these techniques, we can create deeper models without overfitting on the training data.