calc_criterion {biogram}R Documentation

Calculate value of criterion

Description

Computes a chosen statistical criterion for each feature versus target vector.

Usage

calc_criterion(target, features, criterion_function)

Arguments

target

integer vector with target information (e.g. class labels).

features

integer matrix of features with number of rows equal to the length of the target vector.

criterion_function

a function calculating criterion. For a full list, see test_features.

Details

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.

Value

a integer vector of length equal to the number of features containing computed information gain values.

Note

Both target and features must be binary, i.e. contain only 0 and 1 values.

See Also

test_features.

Examples

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)

[Package biogram version 1.6.3 Index]