select_features | R Documentation |
Given a feature_selection
specification object and a dataset, returns the set of selected features as a binary vector.
select_features(obj, X, Y, ...)
## S3 method for class 'catscore'
select_features(obj, X, Y, ranking.score = c("entropy", "avg", "max"), ...)
## S3 method for class 'FTest'
select_features(obj, X, Y, ...)
obj |
The |
X |
The dataset containing the training features. This can be a matrix or a |
Y |
The dependent variable as a factor or numeric variable. |
... |
Additional arguments to be passed to the method-specific function. |
ranking.score |
The feature score to use. Supported scores are "entropy", "avg", or "max". Default is "entropy". |
A logical vector indicating the columns of X
matrix that were selected.
fsel <- feature_selector("FTest", "top_k", 2)
coords <- rbind(c(1,1,1), c(2,2,2), c(3,3,3))
space <- neuroim2::NeuroSpace(c(10,10,10))
roi_data <- matrix(rnorm(100*3), 100, 3)
ROI <- neuroim2::ROIVec(space, coords=coords, roi_data)
Y <- factor(rep(c("a", "b"), each=50))
featureMask <- select_features(fsel, neuroim2::values(ROI), Y)
sum(featureMask) == 2
fsel2 <- feature_selector("FTest", "top_p", .1)
featureMask <- select_features(fsel2, neuroim2::values(ROI), Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.