Description Usage Arguments Details Value Examples
SoftClassMatrix
converts a classification response matrix into a sparse matrix that can be used for inputs
into the SoftRandomForest
function.
1 | SoftClassMatrix(responses, classes = NA)
|
responses |
A vector of classification responses. |
classes |
A vector of possible classifications with a manually specified order. Must contain all elements in the responses vector. |
SoftClassMatrix
runs through each line of a classification vector and creates a sparse matrix where each column represents
an individual classification. The output matrix has number of rows equal to the number of rows of the input vector and number of columns
equal to the number of unique entries in the input vector. The order is determined by the order they appear in the vector.
Adjust this afterwards if another order is desired.
A matrix where 1
indicates that observation was classified as that column's response and 0
if not.
1 2 | Input = c("A", "C", "B", "B", "A", "B")
SoftClassMatrix(Input, classes = c("A", "B", "C", "D"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.