evaluate_dl: Evaluate deep learning model performance

Description Usage Arguments Value Examples

View source: R/evaluate_dl.r

Description

A function to evaluate a deep learning model.

Usage

1
evaluate_dl(model_keras, input_data)

Arguments

model_keras

Keras deep learning model.

input_data

A dataframe containing occurrence data parsed for deep learning using the prepare_dl_data function.

Value

A tibble containing the model estimates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
# download benchmarking data
benchmarking_data <- get_benchmarking_data("Lynx lynx",
                                           limit = 1500)

# transform benchmarking data into a format suitable for deep learning
# if you have previously used a partitioning method you should specify it here
benchmarking_data_dl <- prepare_dl_data(input_data = benchmarking_data$df_data,
                                       partitioning_type = "default")

# perform sanity checks on the transformed data
# for the training set
head(benchmarking_data_dl$train_tbl)
table(benchmarking_data_dl$y_train_vec)

# for the test set
head(benchmarking_data_dl$test_tbl)
table(benchmarking_data_dl$y_test_vec)

# train neural network
keras_results <- train_dl(benchmarking_data_dl)

# inspect training results
keras_results$history

# you can also plot them
plot(keras_results$history)

# create evaluation tibble containing training results
keras_evaluation <- evaluate_dl(keras_results$model, benchmarking_data_dl)
head(keras_evaluation)

## End(Not run)

boyanangelov/sdmbench documentation built on Dec. 14, 2020, 1:08 a.m.