test_model: Benchmark a Keras model.

test_modelR Documentation

Benchmark a Keras model.

Description

Define, compile, and train a Keras model on the training dataset. Then, benchmark it on the test dataset and return summaries.

Usage

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

Arguments

data

a matrix.

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 data frame with one row and the following columns:

  • accuracy: classification accuracy on the test dataset.

  • units1: number of neurons in layer 1.

  • units2: number of neurons in layer 2.

  • act1: number of neurons in layer 1.

  • act2: number of neurons in layer 2.

  • act3: number of neurons in layer 3.


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