bestopt: Best Of Set Optimal Partitions From Random Starts

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Produces a specified number of optpart solutions from random starts, keeping the best result of the set

Usage

1
bestopt(dist,numclu,numrep,maxitr=100)

Arguments

dist

an object of class ‘dist’ from dist, vegdist, or dsvdis, or a symmetric dissimilarity matrix

numclu

the number of clusters desired

numrep

the number of random starts requested

maxitr

the maximum number of iterations per replicate

Details

calls function optpart with an random initial assignment of items to clusters ‘numitr’ times, keeping the best result (highest within/among ratio observed). See optpart for more details.

Value

an object of class partana, with components:

ptc

the mean similarity of each item to each cluster

ctc

the mean similarity of each cluster to other clusters

musubx

the membership of each item in each cluster

clustering

the best ‘crisp’ partition from musubx

ratio

the within-cluster/among-cluster similarity ratio achieved at each iteration of the selected result.

Note

This is a simple wrapper function to automate independent random starts of function optpart.

Author(s)

David W. Roberts [email protected]

See Also

optpart, partana, pam

Examples

1
2
3
4
5
data(shoshveg)
dis.bc <- dsvdis(shoshveg,'bray/curtis')
x <- bestopt(dis.bc,5,10)
summary(x)
## Not run: plot(x) 

Example output

Loading required package: cluster
Loading required package: labdsv
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-25. For overview type 'help("mgcv-package")'.
Loading required package: MASS

Attaching package: 'labdsv'

The following object is masked from 'package:stats':

    density

Loading required package: plotrix

Attaching package: 'optpart'

The following object is masked from 'package:labdsv':

    clustify

Ratios for respective optparts 
 [1] "4.123" "4.123" "2.993" "2.988" "2.988" "2.988" "2.993" "2.796" "2.993"
[10] "4.123"

Choosing #  2  ratio =  4.123 
Number of clusters =  5 

  1   2   3   4   5 
  7   1   3  28 111 

           [,1]        [,2]       [,3]        [,4]       [,5]
[1,] 0.12578378 0.035825098 0.02065326 0.035951111 0.04131058
[2,] 0.03582510 0.000000000 0.00000000 0.004538691 0.01827140
[3,] 0.02065326 0.000000000 0.35148290 0.098675901 0.01567215
[4,] 0.03595111 0.004538691 0.09867590 0.249659368 0.07002854
[5,] 0.04131058 0.018271397 0.01567215 0.070028536 0.24108138

Ratio of Within-cluster similarity/Among-cluster similarity =  4.123 in 59 iterations

optpart documentation built on May 2, 2019, 3:27 a.m.