get_data_feature_mat | R Documentation |
Given some features in the form "feature1=x1", "feature2=x2"..., this function will generate a matrix representation of which data are captured by which features.
get_data_feature_mat(data, featurenames)
data |
a data.frame representing the observations. |
featurenames |
a character vector representing the features in the form: "feature1=x1", "feature2=x2"... |
a binary matrix of size #observations-by-#featurenames
Hongyu Yang, Morris Chen, Cynthia Rudin, Margo Seltzer
data(tictactoe)
featurenames <- c("c1=b", "c1=o", "c1=x")
get_data_feature_mat(tictactoe, featurenames)
#it will generate a binary matrix representing which observations are captured by which features.
#clean up
rm(list = ls())
gc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.