Learn R Programming

obfuscatoR (version 0.2.2)

print_entropy: Prints the entropy of the different actions

Description

The function prints the vector of entropies for each possible action. Depending on printing options, additional information about the probability calculations can be provided.

Usage

print_entropy(entropy, digits = 3, print_all = FALSE)

Arguments

entropy

The entropy measure from calculate_entropy

digits

The number of digits to round to. Default 3.

print_all

If TRUE will print all information on intermediary calculations

Examples

Run this code
design <- matrix(c(-1, -1, -1, -1,  1,
                   -1,  0,  0, -1,  0,
                   -1,  0, -1,  0,  0,
                    0,  0, -1,  0, -1), nrow = 4, byrow = TRUE)

entropy <- calculate_entropy(design)

print_entropy(entropy)
print_entropy(entropy, digits = 4)
print_entropy(entropy, print_all = TRUE)

Run the code above in your browser using DataLab