adjustedRandIndex           package:mclust           R Documentation

_A_d_j_u_s_t_e_d _R_a_n_d _I_n_d_e_x

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

     Computes the adjusted Rand index comparing two classifications.

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

     adjustedRandIndex(x, y)

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

       x: A numeric or character vector of class labels. 

       y: A numeric or character vector of class labels. The length of
          'y' should be the same as that of 'x'. 

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

     The adjusted Rand index comparing the two partitions (a scalar).  
     It has the value

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

     L. Hubert and P. Arabie (1985) Comparing Partitions,  _Journal of
     the Classification 2:193-218_.

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

     'classError', 'mapClass', 'table'

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

     a <- rep(1:3, 3)
     a
     b <- rep(c("A", "B", "C"), 3)
     b
     adjustedRandIndex(a, b)

     a <- sample(1:3, 9, replace = TRUE)
     a
     b <- sample(c("A", "B", "C"), 9, replace = TRUE)
     b
     adjustedRandIndex(a, b)

     a <- rep(1:3, 4)
     a
     b <- rep(c("A", "B", "C", "D"), 3)
     b
     adjustedRandIndex(a, b)

     irisHCvvv <- hc(modelName = "VVV", data = iris[,-5])
     cl3 <- hclass(irisHCvvv, 3)
     adjustedRandIndex(cl3,iris[,5])

     irisBIC <- mclustBIC(iris[,-5])
     adjustedRandIndex(summary(irisBIC,iris[,-5])$classification,iris[,5])
     adjustedRandIndex(summary(irisBIC,iris[,-5],G=3)$classification,iris[,5])

