weights_graph: Weights Graph Adjacency Matrix

Description Usage Arguments Examples

Description

Constructs the adjacency matrix of the weights graph. This is useful to determine the connectivity of the weights graph.

Usage

1

Arguments

w

Weights vector

n

Number of points being clustered

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Clusterpaths for Mammal Dentition
data(mammals)
X <- as.matrix(mammals[,-1])
X <- t(scale(X,center=TRUE,scale=FALSE))
n <- ncol(X)

## Pick some weights and a sequence of regularization parameters.
k <- 5
phi <- 0.5
w <- kernel_weights(X,phi)
w <- knn_weights(w,k,n)

A <- weights_graph(w,n)
find_clusters(A)

## Visualize Cluster Assignment
G <- graph.adjacency(A, mode = 'upper')
plot(G,vertex.label=as.character(mammals[,1]),vertex.label.cex=0.65,vertex.label.font=2)

cvxclustr documentation built on May 2, 2019, 3:44 p.m.