Description Usage Arguments Value Examples

View source: R/VariousFunctions.R

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.

1 | ```
KSeedsClusters(train, num_clusters, Seed, s)
``` |

`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 |

clusters list indicating the cluster to which each drug belongs to

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)
``` |

```
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.