train_model: Define, compile, and train a Keras model.

train_modelR Documentation

Define, compile, and train a Keras model.

Description

Define, compile, and train a Keras model on the training dataset.

Usage

train_model(
  recipe,
  units1 = 16,
  units2 = 16,
  act1 = "relu",
  act2 = "relu",
  act3 = "sigmoid"
)

Arguments

recipe

A recipe object from prepare_recipe().

units1

Number of neurons in the first layer.

units2

Number of neurons in the second layer.

act1

Activation function for layer 1.

act2

Activation function for layer 2.

act3

Activation function for layer 3.

Details

The first time you run Keras in an R session, TensorFlow usually prints verbose ouput such as "Your CPU supports instructions that this TensorFlow binary was not compiled to use:" and "OMP: Info #171: KMP_AFFINITY:". You can safely ignore these messages.

Value

A trained Keras model.


D-Se/ML documentation built on April 1, 2022, 10:53 p.m.