Description Usage Arguments Examples
Normalize to sum to one, sum to zero, or as a proportion of max value, etc...
1 |
x |
scalar or vector of numeric values |
type |
character of the type of normalization to perform. Defaults to "minmax" |
na.rm |
remove NAs before normalizing. Otherwise will return all NAs if any exist |
1 2 3 4 5 6 7 8 | x <- c(-14, -10, -2, 0, NA, 1, 5, 6)
normalize(x, "minmax") # all values compressed within the range of 0 to 1 (default)
normalize(x, "s0") # all values will sum to zero with a range of -1 to 1.
normalize(x, "s1") # all values will sum to one with a range of -1 to 1.
normalize(x, "l1") # all values as a proportion of the largest absolute value
normalize(x, "l2") # all values as a proportion of the largest squared value
normalize(x, "simplex") # all values will sum to one and are within the range of 0 to 1.
normalize(x, "softmax") # all values will sum to one and are greater than zero and less than one. One hot vector
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.