LauraeML_utils.newlog: Laurae's Machine Learning Utility: new input logger

Description Usage Arguments Examples

Description

This function is a helper function to do the logging when a new input is existing for LauraeML during a training iteration of the optimizer. For each elements, the first element refers to the name, the second is for the value, the third for the number of digits, and the fourth for the number of decimals. It is assumed integer value when the decimal number is not specified.

Usage

1
LauraeML_utils.newlog(mobile, logging, x, y, maximize, score, error, params)

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.

maximize

Type: boolean. The maximize parameter passed from LauraeML (whether to maximize or not the metric).

score

Type: numeric. The score parameter passed from LauraeML training functions.

error

Type: vector. A vector formatted like c("RMSE", 23534.372, 6, 5) which is here RMSE = 23534.372 to print with 6 digits and 5 decimals => "023534.37200."

params

Type: list of vectors. A list of vectors formatted like list(c("alpha", 1.248, 2, 5), c("beta", 2.58, 2, 5), c("integer", 8, 2, -1)), which is here (alpha = 1.248 to print with 2 decimals and 5 digits => "01.24800") (beta = 2.58 to print with 2 digits and 5 decimals => "02.58000") (integer = 8 to print with 2 decimals => "08").

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
hi_score <- 1000
iters <- 10
y <- c(1, 0, 1, 0, 1)
best_params <- list(c("alpha", 1.248, 2, 5), c("beta", 2.58, 2, 5), c("integer", 8, 2))
best_error <- c("RMSE", 23534.372, 6, 5)
LauraeML_utils.newlog("whatever.txt", c(1,2,3,4), y, TRUE, 1000, best_error, best_params)

## End(Not run)

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