Learn R Programming

Laurae (version 0.0.0.9001)

print_multi: Print appropriately formatted hyperparameters and error

Description

This function is a helper function to print the hyperparameters and error appropriately in a simple call. 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. Specify the last parameter as -1 in order to pass the value as integer.

Usage

print_multi(params)

Arguments

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").

Value

The formatted double precision value.

Examples

Run this code
best_params <- list(c("alpha", 1.248, 2, 5), c("beta", 2.58, 2, 5), c("integer", 8, 2, -1))
print_multi(best_params) # "alpha=01.24800, beta=02.58000, integer=08"

Run the code above in your browser using DataLab