KSeedsClusters: KSeedsClusters

Description Usage Arguments Value Examples

View source: R/VariousFunctions.R

Description

Function Implementing KSeeds. K-Seeds, firstly randomly chooses a number of drugs (renamed Seeds) equal to the number of clusters desired. Then, the other drugs are assigned to a cluster with respect to Hamming Distance between the drug and the seed of a certain cluster. Cluster seeds are not recomputed at each iteration. This allows a speed up in terms of computational complexity and the algorithm terminates when all the drugs have been assigned.

Usage

1
KSeedsClusters(train, num_clusters, Seed, s)

Arguments

train

train matrix of features

num_clusters

number of clusters desired

Seed

subset of drugs features matrix, with just the Seeds as rows

s

the seeds of the clusters

Value

clusters list indicating the cluster to which each drug belongs to

Examples

1
2
3
4
5
6
7
8
r <- 8
c <- 10
m0 <- matrix(0, r, c)
num_clusters=4
features<-apply(m0, c(1,2), function(x) sample(c(0,1),1))
s<-RandomSeedGenerator(num_clusters,nrow(features))
Seed<-SeedSelection(features,num_clusters,s)
clusters<-KSeedsClusters (features,num_clusters,Seed,s)

DrugClust documentation built on May 30, 2017, 2:30 a.m.