Skip to contents

Calculate weights for each cluster member of all of the selected clusters.

Usage

getAllClustWeights(css_results, sel_clusters, weighting)

Arguments

css_results

An object of class "cssr" (the output of the function css).

sel_clusters

A named numeric vector containing the selection proportions for the selected clusters. The name of each entry is the name of the corresponding cluster.

weighting

Character; determines how to calculate the weights for individual features within the selected clusters. Only those features with nonzero weight within the selected clusters will be returned. Must be one of "sparse", "weighted_avg", or "simple_avg'. For "sparse", all the weight is put on the most frequently selected individual cluster member (or divided equally among all the clusters that are tied for the top selection proportion if there is a tie). For "weighted_avg", only the features within a selected cluster that were themselves selected on at least one subsample will have nonzero weight. For "simple_avg", each cluster member gets equal weight regardless of the individual feature selection proportions (that is, all cluster members within each selected cluster will be returned.). See Faletto and Bien (2022) for details.

Value

A named list of the same length as sel_clusters of numeric vectors. weights[j] is the weights to use for the jth selected cluster, and it has the same name as the cluster it corresponds to.

Author

Gregory Faletto, Jacob Bien