normalize_cols | R Documentation |
A convenience function for a frequent operation of normalizing the columns of a matrix. The typical application in document modeling is to to ensure that the columns sum to one (L1 normalization). Sometimes it is convenient instead to set the columns to have a unit Euclidean norm (L2 normalization).
normalize_cols(x, norm = "L1", stopzero = FALSE)
x |
a matrix or Matrix |
norm |
Either |
stopzero |
If FALSE (the default), columns with norm zero are left as-is. If this is TRUE, an error will be thrown instead. |
the column-normalized matrix (except for any zero columns)
normalize_cols
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.