LauraeML_utils.badlog: Laurae's Machine Learning Utility: bad input logger

Description Usage Arguments Examples

Description

This function is a helper function to do the logging when a bad input is existing for LauraeML during a training iteration of the optimizer, specifically used when you have no features during training.

Usage

1
LauraeML_utils.badlog(mobile, logging, x, y, score = NA)

Arguments

mobile

Type: environment. The environment passed from LauraeML.

logging

Type: character. The logging parameter passed from LauraeML (where to store log file).

x

Type: vector (numeric). The hyperparameters to use passed from the trainer.

y

Type: vector (numeric). The features to use, as binary format (0 for not using, 1 for using) passed from the trainer.

score

Type: numeric. The score to optimize.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# What if we have no feature selected?
if (sum(y) == 0) {

  # Logging specific
  LauraeML_utils.badlog(logging, x, y, score = NA)
  
  # Last, we return an absurd score which is so high
  # you would rather have a random model than this 0-feature model
  # 
  # This iteration will be ignored by the optimizer if
  # it does not belong to the elite proportion of the optimization iteration
  # which should be obviously true
  return(LauraeML_utils.badinput(maximize,
                                 score = 9999999))
}

## End(Not run)

Laurae2/Laurae documentation built on May 8, 2019, 7:59 p.m.