bqs_select | R Documentation |
Select solutions from a bqs
object based on specified rank and type of score.
bqs_select(bqs_sol, rank = 1, type = "smooth", rankby = NA, boot_na_share = 0.25)
bqs_sol |
An object of class |
rank |
An integer |
type |
A character string specifying the type of Quadratic Score. Possible values are |
rankby |
A character string specifying the criteria used to rank solutions in |
boot_na_share |
A numeric value between (0, 1). Clustering solutions in |
Even if the bqs_sol
object is not pre-ranked, the user may specify a ranking criterion to rank clustering solutions dynamically using the rankby
argument; this does not influence the bqs_sol
ranking. In these instances, the user can also specify boot_na_share
as in bqs_rank
to exclude solutions based on the proportion of unsuccessful bootstrap estimations. If rankby=NA
, the bqs_sol
must be pre-ranked.
A named list of all clustering solutions achieving a type
score of rank rank
when ranked according to rankby
criterion, or NULL
if no such solution is available in the bqs_sol
object. List names correspond to methods' names, and each named entry contains the corresponding clustering method in bqs_sol$methodlist
fit on bqs_sol$data
.
bqs
, bqs_rank
# Load data and set seet
set.seed(123)
data("banknote")
dat <- banknote[-1]
# set up kmeans, see help('mset_kmeans')
KM <- mset_kmeans(K = 2:5)
# set up Gaussian model-based clustering via gmix()
GMIX <- mset_gmix(K=2:5, erc=c(1, 50 , 100))
# combine tuned methods
mlist <- mbind(KM, GMIX)
# perform bootstrap
# se 'ncores' to the number of available physical cores
res <- bqs(dat, mlist, B = 20, type = "both", rankby=NA, ncores = 1,
oob = TRUE, savescores = TRUE, saveparams = FALSE)
# Methods are not ranked; this will raise an error
try(bqs_select(res, rank = 1))
# Rank method dynamically
ranked_res <- bqs_select(res, rank = 2, rankby = "lq", boot_na_share = 0.25)
names(ranked_res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.