R Under development (unstable) (2023-12-12 r85669 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(Rmixmod) Loading required package: Rcpp Rmixmod v. 2.1.10 / URI: www.mixmod.org > > ### Models > > # Gaussian models > all <- mixmodGaussianModel() > all **************************************** *** MIXMOD Models: * list = Gaussian_pk_L_I Gaussian_pk_Lk_I Gaussian_pk_L_B Gaussian_pk_Lk_B Gaussian_pk_L_Bk Gaussian_pk_Lk_Bk Gaussian_pk_L_C Gaussian_pk_Lk_C Gaussian_pk_L_D_Ak_D Gaussian_pk_Lk_D_Ak_D Gaussian_pk_L_Dk_A_Dk Gaussian_pk_Lk_Dk_A_Dk Gaussian_pk_L_Ck Gaussian_pk_Lk_Ck Gaussian_p_L_I Gaussian_p_Lk_I Gaussian_p_L_B Gaussian_p_Lk_B Gaussian_p_L_Bk Gaussian_p_Lk_Bk Gaussian_p_L_C Gaussian_p_Lk_C Gaussian_p_L_D_Ak_D Gaussian_p_Lk_D_Ak_D Gaussian_p_L_Dk_A_Dk Gaussian_p_Lk_Dk_A_Dk Gaussian_p_L_Ck Gaussian_p_Lk_Ck * This list includes models with free and equal proportions. **************************************** > > # Multinomial models > all <- mixmodMultinomialModel() > all **************************************** *** MIXMOD Models: * list = Binary_pk_E Binary_pk_Ekj Binary_pk_Ekjh Binary_pk_Ej Binary_pk_Ek Binary_p_E Binary_p_Ekj Binary_p_Ekjh Binary_p_Ej Binary_p_Ek * This list includes models with free and equal proportions. **************************************** > > only.free.proportions <- mixmodMultinomialModel(equal.proportions = FALSE) > list.models <- mixmodMultinomialModel(listModels = c("Binary_p_E", "Binary_p_Ekjh", "Binary_pk_Ekj", "Binary_pk_Ej")) > > var.independent <- mixmodMultinomialModel(variable.independency = TRUE) > var.comp.independent <- mixmodMultinomialModel(variable.independency = TRUE, component.independency = TRUE) > > # Strategy > mixmodStrategy() **************************************** *** MIXMOD Strategy: * algorithm = EM * number of tries = 1 * number of iterations = 200 * epsilon = 0.001 *** Initialization strategy: * algorithm = smallEM * number of tries = 10 * number of iterations = 5 * epsilon = 0.001 * seed = NULL **************************************** > strategy1 <- mixmodStrategy(algo = "CEM", initMethod = "random", nbTry = 10, epsilonInInit = 0.000001) > > # TODO: some issues with this strategy (because of SEM algorithm ?) > strategy2 <- mixmodStrategy(algo = c("SEM", "EM"), nbIterationInAlgo = c(200, 100), epsilonInAlgo = c(NA, 0.0001)) > > ### Unsupervised classification > > # Continuous variables: Geyser dataset > data("geyser") > xem.geyser <- mixmodCluster(data = geyser, nbCluster = 2:8, criterion = c("BIC", "ICL", "NEC"), models = mixmodGaussianModel(), strategy = strategy1) # TODO: was strategy2 > xem.geyser **************************************** *** INPUT: **************************************** * nbCluster = 2 3 4 5 6 7 8 * criterion = BIC ICL NEC **************************************** *** MIXMOD Models: * list = Gaussian_pk_L_I Gaussian_pk_Lk_I Gaussian_pk_L_B Gaussian_pk_Lk_B Gaussian_pk_L_Bk Gaussian_pk_Lk_Bk Gaussian_pk_L_C Gaussian_pk_Lk_C Gaussian_pk_L_D_Ak_D Gaussian_pk_Lk_D_Ak_D Gaussian_pk_L_Dk_A_Dk Gaussian_pk_Lk_Dk_A_Dk Gaussian_pk_L_Ck Gaussian_pk_Lk_Ck Gaussian_p_L_I Gaussian_p_Lk_I Gaussian_p_L_B Gaussian_p_Lk_B Gaussian_p_L_Bk Gaussian_p_Lk_Bk Gaussian_p_L_C Gaussian_p_Lk_C Gaussian_p_L_D_Ak_D Gaussian_p_Lk_D_Ak_D Gaussian_p_L_Dk_A_Dk Gaussian_p_Lk_Dk_A_Dk Gaussian_p_L_Ck Gaussian_p_Lk_Ck * This list includes models with free and equal proportions. **************************************** * data (limited to a 10x10 matrix) = Duration Waiting.Time [1,] 3.6 79 [2,] 1.8 54 [3,] 3.333 74 [4,] 2.283 62 [5,] 4.533 85 [6,] 2.883 55 [7,] 4.7 88 [8,] 3.6 85 [9,] 1.95 51 [10,] 4.35 85 * ... ... **************************************** *** MIXMOD Strategy: * algorithm = CEM * number of tries = 10 * number of iterations = 200 * epsilon = 0.001 *** Initialization strategy: * algorithm = random * number of tries = 10 * number of iterations = 0 * epsilon = 1e-06 * seed = NULL **************************************** **************************************** *** BEST MODEL OUTPUT: *** According to the BIC criterion **************************************** * nbCluster = 2 * model name = Gaussian_pk_Lk_D_Ak_D * criterion = BIC(2320.2869) ICL(2321.3579) NEC(0.0034) * likelihood = -1132.1144 **************************************** *** Cluster 1 * proportion = 0.3566 * means = 2.0381 54.4948 * variances = | 0.0778 0.6395 | | 0.6395 33.7478 | *** Cluster 2 * proportion = 0.6434 * means = 4.2913 79.9886 * variances = | 0.1588 0.6757 | | 0.6757 35.7346 | **************************************** > summary(xem.geyser) ************************************************************** * Number of samples = 272 * Problem dimension = 2 ************************************************************** * Number of cluster = 2 * Model Type = Gaussian_pk_Lk_D_Ak_D * Criterion = BIC(2320.2869) ICL(2321.3579) NEC(0.0034) * Parameters = list by cluster * Cluster 1 : Proportion = 0.3566 Means = 2.0381 54.4948 Variances = | 0.0778 0.6395 | | 0.6395 33.7478 | * Cluster 2 : Proportion = 0.6434 Means = 4.2913 79.9886 Variances = | 0.1588 0.6757 | | 0.6757 35.7346 | * Log-likelihood = -1132.1144 ************************************************************** > plot(xem.geyser) [1] 1 [1] 2 > icl <- sortByCriterion(xem.geyser, "ICL") > icl["bestResult"] * nbCluster = 2 * model name = Gaussian_pk_Lk_D_Ak_D * criterion = BIC(2320.2869) ICL(2321.3579) NEC(0.0034) * likelihood = -1132.1144 **************************************** *** Cluster 1 * proportion = 0.3566 * means = 2.0381 54.4948 * variances = | 0.0778 0.6395 | | 0.6395 33.7478 | *** Cluster 2 * proportion = 0.6434 * means = 4.2913 79.9886 * variances = | 0.1588 0.6757 | | 0.6757 35.7346 | **************************************** > # xem.geyser["results"] > # icl["results"] > > # Categorical variables: Birds of different subspecies > data("birds") > xem.birds <- mixmodCluster(birds, 2) > barplot(xem.birds) > > ### Supervised classification > > # First step: Learning > data("finance") > ratios2002 <- finance[finance["Year"] == 2002, 3:6] > health2002 <- finance[finance["Year"] == 2002, 2] > ratios2003 <- finance[finance["Year"] == 2003, 3:6] > health2003 <- finance[finance["Year"] == 2003, 2] > learn <- mixmodLearn(ratios2002, health2002) > learn["bestResult"] * nbCluster = 2 * model name = Gaussian_pk_Lk_C * criterion = CV(0.1776) * likelihood = 444.9579 **************************************** *** Cluster 1 * proportion = 0.4953 * means = -0.0386 0.2069 0.6089 0.1774 * variances = | 0.0226 0.0064 0.0186 -0.0023 | | 0.0064 0.0166 0.0076 -0.0006 | | 0.0186 0.0076 0.2728 -0.0095 | | -0.0023 -0.0006 -0.0095 0.0079 | *** Cluster 2 * proportion = 0.5047 * means = 0.1662 0.2749 1.0661 0.1079 * variances = | 0.0172 0.0049 0.0142 -0.0017 | | 0.0049 0.0126 0.0058 -0.0005 | | 0.0142 0.0058 0.2076 -0.0073 | | -0.0017 -0.0005 -0.0073 0.0060 | **************************************** * Classification with MAP: | Cluster 1 | Cluster 2 | ----------- ----------- ----------- Cluster 1 | 212 | 0 | Cluster 2 | 0 | 216 | ----------- ----------- ----------- * Error rate with MAP = 0.00 % **************************************** > plot(learn) [1] 1 [1] 2 [1] 3 [1] 4 > > # Second step: Prediction > prediction <- mixmodPredict(data = ratios2003, classificationRule = learn["bestResult"]) > summary(prediction) ************************************************************** * partition = 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 1 2 1 1 1 1 1 1 1 1 1 1 2 1 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 2 2 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 2 1 2 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 2 1 1 1 1 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 1 2 1 1 1 2 1 2 1 1 1 2 1 1 1 1 1 1 1 2 2 2 2 2 1 1 2 1 1 2 1 1 2 1 2 1 2 2 2 2 1 2 2 1 2 2 2 2 2 1 1 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 1 2 2 1 2 2 1 2 1 2 2 2 2 2 1 1 2 2 2 2 1 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 2 2 2 2 2 2 1 2 1 2 2 2 2 1 1 2 1 1 2 2 2 2 2 2 2 1 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 1 1 2 2 2 2 2 2 2 2 1 2 2 2 1 1 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 1 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 * probabilities = | 0.4966 0.5034 | | 0.8125 0.1875 | | 0.8851 0.1149 | | 0.8329 0.1671 | | 0.6984 0.3016 | | 0.8171 0.1829 | | 0.3066 0.6934 | | 0.5747 0.4253 | | 0.8720 0.1280 | | 0.9138 0.0862 | | 0.9477 0.0523 | | 0.6750 0.3250 | | 0.7330 0.2670 | | 0.8018 0.1982 | | 0.5831 0.4169 | | 0.6077 0.3923 | | 0.9998 0.0002 | | 0.9313 0.0687 | | 0.4439 0.5561 | | 1.0000 0.0000 | | 0.6643 0.3357 | | 0.5455 0.4545 | | 0.7460 0.2540 | | 0.4631 0.5369 | | 0.1541 0.8459 | | 0.4411 0.5589 | | 0.7133 0.2867 | | 0.3361 0.6639 | | 0.7399 0.2601 | | 0.9724 0.0276 | | 0.6653 0.3347 | | 0.9147 0.0853 | | 0.5806 0.4194 | | 0.6165 0.3835 | | 0.6970 0.3030 | | 0.8757 0.1243 | | 0.8767 0.1233 | | 0.7670 0.2330 | | 0.4156 0.5844 | | 0.6846 0.3154 | | 0.3874 0.6126 | | 0.3232 0.6768 | | 0.3421 0.6579 | | 0.5309 0.4691 | | 0.9556 0.0444 | | 0.8431 0.1569 | | 0.3336 0.6664 | | 0.2157 0.7843 | | 0.1817 0.8183 | | 0.8886 0.1114 | | 0.9519 0.0481 | | 0.7721 0.2279 | | 0.8232 0.1768 | | 0.5518 0.4482 | | 0.6131 0.3869 | | 0.9638 0.0362 | | 0.6975 0.3025 | | 0.7575 0.2425 | | 0.5676 0.4324 | | 0.9657 0.0343 | | 0.4347 0.5653 | | 0.9792 0.0208 | | 0.3774 0.6226 | | 0.5303 0.4697 | | 0.2398 0.7602 | | 0.5624 0.4376 | | 0.9586 0.0414 | | 0.9927 0.0073 | | 0.9998 0.0002 | | 0.0933 0.9067 | | 0.8979 0.1021 | | 0.4846 0.5154 | | 0.8479 0.1521 | | 0.9708 0.0292 | | 0.7299 0.2701 | | 0.3616 0.6384 | | 0.6823 0.3177 | | 0.9999 0.0001 | | 0.6563 0.3437 | | 0.5429 0.4571 | | 0.7580 0.2420 | | 0.5854 0.4146 | | 0.9945 0.0055 | | 0.7726 0.2274 | | 0.6504 0.3496 | | 0.3869 0.6131 | | 0.2782 0.7218 | | 0.8806 0.1194 | | 0.2668 0.7332 | | 0.8734 0.1266 | | 0.9923 0.0077 | | 1.0000 0.0000 | | 0.9931 0.0069 | | 0.6580 0.3420 | | 0.9645 0.0355 | | 1.0000 0.0000 | | 0.3215 0.6785 | | 0.5663 0.4337 | | 0.9523 0.0477 | | 0.6341 0.3659 | | 0.9163 0.0837 | | 0.9829 0.0171 | | 0.9920 0.0080 | | 0.8849 0.1151 | | 0.8493 0.1507 | | 0.9887 0.0113 | | 0.7705 0.2295 | | 0.5980 0.4020 | | 0.3592 0.6408 | | 0.4475 0.5525 | | 0.5043 0.4957 | | 0.3413 0.6587 | | 0.2568 0.7432 | | 0.8353 0.1647 | | 0.4149 0.5851 | | 0.9070 0.0930 | | 0.1978 0.8022 | | 0.5278 0.4722 | | 0.5491 0.4509 | | 0.2536 0.7464 | | 0.6364 0.3636 | | 0.5144 0.4856 | | 0.5782 0.4218 | | 0.9989 0.0011 | | 0.6633 0.3367 | | 0.9939 0.0061 | | 0.1276 0.8724 | | 0.8392 0.1608 | | 1.0000 0.0000 | | 0.9905 0.0095 | | 0.9518 0.0482 | | 0.2997 0.7003 | | 0.8936 0.1064 | | 0.8884 0.1116 | | 0.3869 0.6131 | | 0.5867 0.4133 | | 0.2424 0.7576 | | 0.6929 0.3071 | | 0.7172 0.2828 | | 0.7065 0.2935 | | 0.8381 0.1619 | | 0.8017 0.1983 | | 0.8253 0.1747 | | 0.6598 0.3402 | | 0.7382 0.2618 | | 0.8052 0.1948 | | 0.3705 0.6295 | | 0.4640 0.5360 | | 0.3818 0.6182 | | 0.9850 0.0150 | | 0.7164 0.2836 | | 0.9815 0.0185 | | 0.8289 0.1711 | | 0.7591 0.2409 | | 0.9513 0.0487 | | 0.6394 0.3606 | | 0.6454 0.3546 | | 0.9178 0.0822 | | 0.6444 0.3556 | | 0.9996 0.0004 | | 0.1203 0.8797 | | 0.3722 0.6278 | | 0.9117 0.0883 | | 0.9568 0.0432 | | 0.9439 0.0561 | | 0.2885 0.7115 | | 0.9066 0.0934 | | 0.8214 0.1786 | | 0.8327 0.1673 | | 0.8468 0.1532 | | 0.4536 0.5464 | | 0.9968 0.0032 | | 0.7295 0.2705 | | 0.8423 0.1577 | | 0.9630 0.0370 | | 0.9993 0.0007 | | 0.0610 0.9390 | | 0.9978 0.0022 | | 0.9644 0.0356 | | 0.6767 0.3233 | | 0.0946 0.9054 | | 0.7978 0.2022 | | 0.2986 0.7014 | | 0.9637 0.0363 | | 0.8514 0.1486 | | 0.1965 0.8035 | | 0.6931 0.3069 | | 0.3815 0.6185 | | 0.8011 0.1989 | | 0.9988 0.0012 | | 0.8145 0.1855 | | 0.4271 0.5729 | | 0.7138 0.2862 | | 0.2199 0.7801 | | 1.0000 0.0000 | | 0.7836 0.2164 | | 0.9904 0.0096 | | 0.0977 0.9023 | | 0.5544 0.4456 | | 0.7646 0.2354 | | 0.9868 0.0132 | | 0.9989 0.0011 | | 0.6939 0.3061 | | 0.5973 0.4027 | | 0.9784 0.0216 | | 0.3146 0.6854 | | 0.2274 0.7726 | | 0.2106 0.7894 | | 0.3654 0.6346 | | 0.4536 0.5464 | | 0.9624 0.0376 | | 0.9721 0.0279 | | 0.4988 0.5012 | | 0.9491 0.0509 | | 0.9999 0.0001 | | 0.2511 0.7489 | | 0.9988 0.0012 | | 0.6417 0.3583 | | 0.1306 0.8694 | | 0.9277 0.0723 | | 0.2718 0.7282 | | 0.5186 0.4814 | | 0.1731 0.8269 | | 0.2523 0.7477 | | 0.1704 0.8296 | | 0.0546 0.9454 | | 0.8951 0.1049 | | 0.1402 0.8598 | | 0.4081 0.5919 | | 0.5378 0.4622 | | 0.1342 0.8658 | | 0.0795 0.9205 | | 0.0613 0.9387 | | 0.4169 0.5831 | | 0.2771 0.7229 | | 0.5068 0.4932 | | 0.5111 0.4889 | | 0.3591 0.6409 | | 0.0672 0.9328 | | 0.2224 0.7776 | | 0.2720 0.7280 | | 0.6652 0.3348 | | 0.2556 0.7444 | | 0.6687 0.3313 | | 0.1891 0.8109 | | 0.4397 0.5603 | | 0.1074 0.8926 | | 0.6259 0.3741 | | 0.1831 0.8169 | | 0.1833 0.8167 | | 0.4184 0.5816 | | 0.1146 0.8854 | | 0.3107 0.6893 | | 0.5729 0.4271 | | 0.4362 0.5638 | | 0.2600 0.7400 | | 0.1853 0.8147 | | 0.0807 0.9193 | | 0.2510 0.7490 | | 0.5647 0.4353 | | 0.2022 0.7978 | | 0.0634 0.9366 | | 0.7980 0.2020 | | 0.1578 0.8422 | | 0.2044 0.7956 | | 0.6034 0.3966 | | 0.2315 0.7685 | | 0.7948 0.2052 | | 0.0324 0.9676 | | 0.1282 0.8718 | | 0.4588 0.5412 | | 0.2665 0.7335 | | 0.4864 0.5136 | | 0.6117 0.3883 | | 0.7697 0.2303 | | 0.2551 0.7449 | | 0.0475 0.9525 | | 0.2330 0.7670 | | 0.2729 0.7271 | | 0.5298 0.4702 | | 0.0927 0.9073 | | 0.1455 0.8545 | | 0.3041 0.6959 | | 0.5159 0.4841 | | 0.0461 0.9539 | | 0.0829 0.9171 | | 0.3730 0.6270 | | 0.2067 0.7933 | | 0.0417 0.9583 | | 0.6569 0.3431 | | 0.1915 0.8085 | | 0.4053 0.5947 | | 0.0571 0.9429 | | 0.0659 0.9341 | | 0.6293 0.3707 | | 0.1368 0.8632 | | 0.0671 0.9329 | | 0.3579 0.6421 | | 0.1029 0.8971 | | 0.6272 0.3728 | | 0.1896 0.8104 | | 0.0582 0.9418 | | 0.2439 0.7561 | | 0.0495 0.9505 | | 0.1897 0.8103 | | 0.1181 0.8819 | | 0.1284 0.8716 | | 0.7172 0.2828 | | 0.2077 0.7923 | | 0.1763 0.8237 | | 0.3544 0.6456 | | 0.4728 0.5272 | | 0.0485 0.9515 | | 0.4294 0.5706 | | 0.0905 0.9095 | | 0.0739 0.9261 | | 0.2198 0.7802 | | 0.0239 0.9761 | | 0.2301 0.7699 | | 0.0320 0.9680 | | 0.9590 0.0410 | | 0.3260 0.6740 | | 0.5026 0.4974 | | 0.0497 0.9503 | | 0.0156 0.9844 | | 0.1141 0.8859 | | 0.0319 0.9681 | | 0.1044 0.8956 | | 0.3155 0.6845 | | 0.2086 0.7914 | | 0.0848 0.9152 | | 0.6412 0.3588 | | 0.2962 0.7038 | | 0.6888 0.3112 | | 0.1725 0.8275 | | 0.2350 0.7650 | | 0.3679 0.6321 | | 0.3778 0.6222 | | 0.8671 0.1329 | | 0.5920 0.4080 | | 0.3743 0.6257 | | 0.5360 0.4640 | | 0.5472 0.4528 | | 0.4585 0.5415 | | 0.1994 0.8006 | | 0.4646 0.5354 | | 0.3880 0.6120 | | 0.1088 0.8912 | | 0.2771 0.7229 | | 0.1939 0.8061 | | 0.8710 0.1290 | | 0.3963 0.6037 | | 0.3845 0.6155 | | 0.2583 0.7417 | | 0.5185 0.4815 | | 0.3821 0.6179 | | 0.2703 0.7297 | | 0.5386 0.4614 | | 0.1256 0.8744 | | 0.3189 0.6811 | | 0.0428 0.9572 | | 0.0589 0.9411 | | 0.4367 0.5633 | | 0.3002 0.6998 | | 0.3083 0.6917 | | 0.0406 0.9594 | | 0.6061 0.3939 | | 0.1288 0.8712 | | 0.4145 0.5855 | | 0.0663 0.9337 | | 0.9306 0.0694 | | 0.6864 0.3136 | | 0.1193 0.8807 | | 0.4185 0.5815 | | 0.2661 0.7339 | | 0.2608 0.7392 | | 0.1839 0.8161 | | 0.2981 0.7019 | | 0.0311 0.9689 | | 0.3075 0.6925 | | 0.6517 0.3483 | | 0.3820 0.6180 | | 0.1843 0.8157 | | 0.1463 0.8537 | | 0.5360 0.4640 | | 0.6032 0.3968 | | 0.4028 0.5972 | | 0.6911 0.3089 | | 0.0977 0.9023 | | 0.0650 0.9350 | | 0.0805 0.9195 | | 0.0439 0.9561 | | 0.1495 0.8505 | | 0.3311 0.6689 | | 0.0603 0.9397 | | 0.1044 0.8956 | | 0.3780 0.6220 | | 0.7544 0.2456 | | 0.2444 0.7556 | | 0.2066 0.7934 | | 0.2586 0.7414 | | 0.2504 0.7496 | | 0.6949 0.3051 | | 0.8076 0.1924 | | 0.0693 0.9307 | | 0.6399 0.3601 | | 0.2576 0.7424 | | 0.0720 0.9280 | | 0.6631 0.3369 | | 0.0246 0.9754 | | 0.4589 0.5411 | | 0.2777 0.7223 | | 0.2086 0.7914 | | 0.0423 0.9577 | | 0.1815 0.8185 | | 0.2524 0.7476 | | 0.1785 0.8215 | | 0.2630 0.7370 | | 0.0284 0.9716 | | 0.1516 0.8484 | | 0.4733 0.5267 | | 0.1581 0.8419 | | 0.9587 0.0413 | | 0.7663 0.2337 | | 0.2940 0.7060 | | 0.4765 0.5235 | | 0.2865 0.7135 | | 0.0581 0.9419 | | 0.9698 0.0302 | | 0.4755 0.5245 | | 0.4422 0.5578 | | 0.2802 0.7198 | | 0.4907 0.5093 | | 0.7996 0.2004 | | 0.4599 0.5401 | | 0.4239 0.5761 | | 0.3305 0.6695 | | 0.3908 0.6092 | | 0.3199 0.6801 | | 0.7171 0.2829 | | 0.3202 0.6798 | | 0.4269 0.5731 | | 0.7519 0.2481 | | 0.2652 0.7348 | | 0.1380 0.8620 | | 0.6259 0.3741 | | 0.1044 0.8956 | | 0.1346 0.8654 | | 0.4464 0.5536 | | 0.1493 0.8507 | | 0.0958 0.9042 | | 0.2062 0.7938 | | 0.3991 0.6009 | | 0.2222 0.7778 | | 0.0577 0.9423 | | 0.2698 0.7302 | | 0.2686 0.7314 | | 0.9998 0.0002 | | 0.7264 0.2736 | | 0.5626 0.4374 | | 0.0308 0.9692 | ************************************************************** > mean(as.integer(health2003) == prediction["partition"]) [1] 0.7570499 > > # semi-supervised Learning > birds.partition <- as.integer(c(rep(1, 34), rep(2, 35))) > birds.partition[10] <- 0 > birds.partition[20] <- 0 > birds.partition[30] <- 0 > birds.partition[40] <- 0 > birds.partition[50] <- 0 > birds.partition[60] <- 0 > mixmodCluster(birds, 2, knownLabels = birds.partition) **************************************** *** INPUT: **************************************** * nbCluster = 2 * criterion = BIC **************************************** *** MIXMOD Models: * list = Binary_pk_Ekjh * This list includes only models with free proportions. **************************************** * data (limited to a 10x10 matrix) = gender eyebrow collar sub-caudal border 1 1 2 2 1 2 2 2 1 2 2 1 3 2 3 1 1 1 4 1 3 2 1 1 5 1 3 2 1 1 6 1 3 2 1 1 7 2 3 2 1 1 8 2 2 2 1 1 9 2 2 2 1 1 10 2 2 2 1 1 * ... ... * knownLabels = 1 1 1 1 1 1 1 1 1 0 ... **************************************** *** MIXMOD Strategy: * algorithm = EM * number of tries = 1 * number of iterations = 200 * epsilon = 0.001 *** Initialization strategy: * algorithm = smallEM * number of tries = 10 * number of iterations = 5 * epsilon = 0.001 * seed = NULL **************************************** **************************************** *** BEST MODEL OUTPUT: *** According to the BIC criterion **************************************** * nbCluster = 2 * model name = Binary_pk_Ekjh * criterion = BIC(546.6591) * likelihood = -211.9350 **************************************** * number of modalities = 2 4 5 5 3 *** Cluster 1 * proportion = 0.4841 * center = 1.0000 2.0000 2.0000 1.0000 1.0000 * scatter = | 0.4806 0.4806 | | 0.1632 0.3823 0.2116 0.0075 | | 0.1339 0.1513 0.0058 0.0058 0.0058 | | 0.4595 0.3255 0.0930 0.0351 0.0058 | | 0.0775 0.0678 0.0097 | *** Cluster 2 * proportion = 0.5159 * center = 2.0000 3.0000 1.0000 1.0000 1.0000 * scatter = | 0.4408 0.4408 | | 0.0242 0.0068 0.1469 0.1159 | | 0.0219 0.0055 0.0055 0.0055 0.0055 | | 0.0490 0.0055 0.0055 0.0326 0.0055 | | 0.0729 0.0364 0.0364 | **************************************** > > proc.time() user system elapsed 5.46 0.09 5.54