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