Learn R Programming

FeaLect (version 1.20)

compute.balanced: Balances between negative and positive samples by oversampling.

Description

If negative samples are less than positive ones, more copies of the negative cases are added and vice versa.

Usage

compute.balanced(F_, L_)

Arguments

F_

The feature matrix, each column is a feature.

L_

The vector of labels named according to the rows of F.

Value

Returns a list of:

F_

The feature matrix, each column is a feature.

L_

The vector of labels named according to the rows of F.

Details

Considerably unbalanced classes may be probabilistic for fitting some models.

References

"Statistical Analysis of Overfitting Features", manuscript in preparation.

See Also

FeaLect, train.doctor, doctor.validate, random.subset, compute.balanced,compute.logistic.score, ignore.redundant, input.check.FeaLect

Examples

Run this code
# NOT RUN {
library(FeaLect)
data(mcl_sll)
F <- as.matrix(mcl_sll[ ,-1])	# The Feature matrix
L <- as.numeric(mcl_sll[ ,1])	# The labels
names(L) <- rownames(F)
message(L)

balanced <- compute.balanced(F_=F, L_=L)
message(balanced$L_)

# }

Run the code above in your browser using DataLab