After training our model, we need to know at what level to send the alert. When training, setting the contamination (see the following code) determines the proportion of outliers in the data that are needed to trigger the alerting function:
AutoEncoder(epochs=30, contamination=0.2)
We could also change the regularizer, as in the following example. The regularizer is used to balance the bias and variance to prevent over and underfitting:
AutoEncoder(epochs=30, l2_regularizer=0.2)
We could also change the number of neurons, our loss function, or the optimizer. This is often referred to as changing or tuning the hyperparameters in data science. Tuning the hyperparameters allows us to affect our success metrics, thereby improving the model.