calc_criterion | R Documentation |
Computes a chosen statistical criterion for each feature versus target vector.
calc_criterion(target, features, criterion_function)
target |
|
features |
|
criterion_function |
a function calculating criterion. For a full list, see
|
The permutation test implemented in biogram
uses several criterions to filter
important features. Each can be used by test_features
by specifying the
criterion
parameter.
a integer
vector of length equal to the number of features
containing computed information gain values.
Both target
and features
must be binary, i.e. contain only 0
and 1 values.
test_features
.
tar <- sample(0L:1, 100, replace = TRUE)
feats <- matrix(sample(0L:1, 400, replace = TRUE), ncol = 4)
# Information Gain
calc_criterion(tar, feats, calc_ig)
# hi-squared-based measure
calc_criterion(tar, feats, calc_cs)
# Kullback-Leibler divergence
calc_criterion(tar, feats, calc_kl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.