How to do it...

Let's move on to training our models using the algorithms we mentioned earlier in this chapter. We'll start by training our generalized linear model (GLM) models. We'll build three GLM models:

  • A GLM model with default values for the parameters
  • A GLM model with Lambda search (regularization)
  • A GLM model with grid search

Now we will start with training our models in the following section.

  1. Let's train our first model:
GLM_default_settings = H2OGeneralizedLinearEstimator(family='binomial', \                                            model_id='GLM_default',nfolds = 10, \                                            fold_assignment = "Modulo", \                                            keep_cross_validation_predictions = True)

H2OGeneralizedLinearEstimator fits a generalized linear model. It takes in a response variable and a set of predictor variables.  ...

Get Ensemble Machine Learning Cookbook 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.