medoid                 package:clue                 R Documentation

_M_e_d_o_i_d _P_a_r_t_i_t_i_o_n_s _a_n_d _H_i_e_r_a_r_c_h_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute the medoid of an ensemble of partitions or hierarchies,
     i.e., the element of the ensemble mimimizing the sum of
     dissimilarities to all other elements.

_U_s_a_g_e:

     cl_medoid(x, method = "euclidean")

_A_r_g_u_m_e_n_t_s:

       x: an ensemble of partitions or hierarchies, or something
          coercible to that (see 'cl_ensemble').

  method: a character string or a function, as for argument 'method' of
          function 'cl_dissimilarity'.

_D_e_t_a_i_l_s:

     Medoid clusterings are special cases of "consensus" clusterings
     characterized as the solutions of an optimization problem.  See
     Gordon (2001) for more information.

     The dissimilarities 'd' for determining the medoid are obtained by
     calling 'cl_dissimilarity' with arguments 'x' and 'method'.  The
     medoid can then be found as the (first) row index for which the
     row sum of 'as.matrix(d)' is mimimal.  Modulo possible differences
     in the case of ties, this gives the same results as (the medoid
     obtained by) 'pam' in package 'cluster'.

_V_a_l_u_e:

     The medoid partition or hierarchy.

_R_e_f_e_r_e_n_c_e_s:

     A. D. Gordon (1999). _Classification_ (2nd edition). Boca Raton,
     FL: Chapman & Hall/CRC.

_S_e_e _A_l_s_o:

     'cl_median'

_E_x_a_m_p_l_e_s:

     ## An ensemble of partitions.
     data("CKME")
     pens <- CKME[1 : 20]
     m1 <- cl_medoid(pens)
     diss <- cl_dissimilarity(pens)
     require("cluster")
     m2 <- pens[[pam(diss, 1)$medoids]]
     ## Agreement of medoid consensus partitions.
     cl_agreement(m1, m2)
     ## Or, more straightforwardly:
     table(cl_class_ids(m1), cl_class_ids(m2))

