Select Features
select_features.Rd
Given a feature_selection
specification object and a dataset, returns the set of selected features as a binary vector.
Arguments
- obj
The
feature_selection
object specifying the feature selection method and its parameters.- X
The dataset containing the training features. This can be a matrix or a
ROIVolume
orROISurface
object.- Y
The dependent variable as a factor or numeric variable.
- ...
Additional arguments to be passed to the method-specific function.
Examples
fsel <- feature_selector("FTest", "top_k", 2)
coords <- rbind(c(1,1,1), c(2,2,2), c(3,3,3))
ROI <- neuroim2::ROIVec(neuroim2::NeuroSpace(c(10,10,10)), coords=coords, matrix(rnorm(100*3), 100, 3))
Y <- factor(rep(c("a", "b"), each=50))
featureMask <- select_features(fsel, neuroim2::values(ROI), Y)
#> Error in UseMethod("select_features"): no applicable method for 'select_features' applied to an object of class "c('FTest', 'feature_selector', 'list')"
sum(featureMask) == 2
#> Error: object 'featureMask' not found
fsel2 <- feature_selector("FTest", "top_p", .1)
featureMask <- select_features(fsel2, neuroim2::values(ROI), Y)
#> Error in UseMethod("select_features"): no applicable method for 'select_features' applied to an object of class "c('FTest', 'feature_selector', 'list')"