accessors_cbass: Get Clustering Results for 'CBASS'

Description Usage Arguments Details Examples

Description

get_cluster_labels returns a factor vector of cluster labels. get_cluster_centroids returns a k1-by-k2 matrix with the estimated centroid of the k1-th row cluster and the k2-th column cluster. get_clustered_data returns a matrix (with the same dimensions and names as the original data), but with the values for each row replaced by its "estimated" value (i.e., the appropriate cluster centroid).

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'CBASS'
get_cluster_labels(x, ..., percent, k.row, k.col, type = c("row", "col"))

## S3 method for class 'CBASS'
get_cluster_centroids(x, ..., percent, k.row, k.col, refit = TRUE)

## S3 method for class 'CBASS'
get_clustered_data(x, ..., percent, k.row, k.col, refit = TRUE)

Arguments

x

An object of class CARP as produced by CBASS

...

Additional arguments - if any are provided, an error is signalled.

percent

A number between 0 and 1, giving the regularization level (as a fraction of the final regularization level used) at which to get cluster labels.

k.row

The desired number of row clusters

k.col

The desired number of column clusters

type

For get_cluster_labels, which set of labels to return - row (observation) or column (feature)

refit

Should "naive" centroids (TRUE) or the actual centroids estimated by convex clustering be used? The default (refit = TRUE) centroids returned are actual centroids (mean) of all elements assigned to that cluster; if refit = FALSE, the \hat{U} from the convex biclustering problem is used. Due to the global shrinkage imposed, these clusters are more "shrunk together" than the naive clusters.

Details

get_clustered_data returns centroids on the original scale of the data, independent of any pre-processing flags passed to CBASS. Note that exactly one of percent, k.row, k.col must be supplied and that that k.row (if suppplied) will be used even if type = "col" and vice versa.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
cbass_fit <- CBASS(presidential_speech)

# Get row clustering results from 50% along the path
get_cluster_labels(cbass_fit, percent = 0.5)

# Get column clustering corresponding to the 3 cluster solution
get_cluster_labels(cbass_fit, k.col = 3, type = "col")

# Get row clustering corresponding to the 3 column clusters
get_cluster_labels(cbass_fit, k.col = 3, type = "row")

# Get cluster centroids partially down the path
get_cluster_centroids(cbass_fit, percent = 0.5)

# Get clustered data
image(get_clustered_data(cbass_fit, k.row = 2))

jjn13/clustRviz documentation built on Sept. 1, 2020, 7:53 a.m.