calc_criterion: Calculate value of criterion

Description Usage Arguments Details Value Note See Also Examples

View source: R/criterions.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

biogram documentation built on March 31, 2020, 5:14 p.m.