Step 6 - Unsupervised pre-training using autoencoder

As described earlier, we will be using Scala with the h2o encoder. Now it's time to start the unsupervised autoencoder training. Since the training is unsupervised, it means we need to exclude the response column from the unsupervised training set:

val response = "Class"val features = train_unsupervised.names.filterNot(_ == response)

The next task is to define the hyperparameters, such as the number of hidden layers with neurons, seeds for the reproducibility, the number of training epochs and the activation function for the deep learning model. For the unsupervised pre-training, just set the autoencoder parameter to true:

var dlParams = new DeepLearningParameters() dlParams._ignored_columns ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.