cola Report for recount2:ERP003917

Date: 2019-12-25 22:25:21 CET, cola version: 1.3.2

Document is loading...


Summary

All available functions which can be applied to this res_list object:

res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows are extracted by 'SD, CV, MAD, ATC' methods.
#>   Subgroups are detected by 'hclust, kmeans, skmeans, pam, mclust, NMF' method.
#>   Number of partitions are tried for k = 2, 3, 4, 5, 6.
#>   Performed in total 30000 partitions by row resampling.
#> 
#> Following methods can be applied to this 'ConsensusPartitionList' object:
#>  [1] "cola_report"           "collect_classes"       "collect_plots"         "collect_stats"        
#>  [5] "colnames"              "functional_enrichment" "get_anno_col"          "get_anno"             
#>  [9] "get_classes"           "get_matrix"            "get_membership"        "get_stats"            
#> [13] "is_best_k"             "is_stable_k"           "ncol"                  "nrow"                 
#> [17] "rownames"              "show"                  "suggest_best_k"        "test_to_known_factors"
#> [21] "top_rows_heatmap"      "top_rows_overlap"     
#> 
#> You can get result for a single method by, e.g. object["SD", "hclust"] or object["SD:hclust"]
#> or a subset of methods by object[c("SD", "CV")], c("hclust", "kmeans")]

The call of run_all_consensus_partition_methods() was:

#> run_all_consensus_partition_methods(data = mat, mc.cores = 4)

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 15144   101

Density distribution

The density distribution for each sample is visualized as in one column in the following heatmap. The clustering is based on the distance which is the Kolmogorov-Smirnov statistic between two distributions.

library(ComplexHeatmap)
densityHeatmap(mat, ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
    mc.cores = 4)

plot of chunk density-heatmap

Suggest the best k

Folowing table shows the best k (number of partitions) for each combination of top-value methods and partition methods. Clicking on the method name in the table goes to the section for a single combination of methods.

The cola vignette explains the definition of the metrics used for determining the best number of partitions.

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance Optional k
CV:hclust 4 1.000 0.978 0.979 ** 3
MAD:mclust 2 1.000 0.988 0.990 **
ATC:skmeans 3 1.000 0.984 0.989 ** 2
ATC:pam 2 1.000 1.000 1.000 **
ATC:mclust 6 1.000 0.999 0.999 **
ATC:NMF 3 1.000 0.998 0.997 ** 2
SD:pam 6 0.957 0.971 0.975 ** 2,3,5
MAD:pam 6 0.945 0.947 0.956 * 2,4,5
SD:NMF 3 0.944 0.970 0.982 * 2
CV:pam 5 0.929 0.967 0.977 * 2,3,4
SD:hclust 6 0.918 0.907 0.957 * 2,3
CV:NMF 3 0.895 0.958 0.957
CV:mclust 5 0.838 0.872 0.898
SD:skmeans 2 0.836 0.962 0.981
MAD:skmeans 2 0.836 0.919 0.960
MAD:NMF 2 0.772 0.945 0.972
ATC:hclust 4 0.770 0.914 0.932
CV:skmeans 2 0.688 0.925 0.959
SD:mclust 4 0.683 0.776 0.885
MAD:hclust 2 0.674 0.929 0.956
ATC:kmeans 3 0.449 0.583 0.772
SD:kmeans 5 0.432 0.558 0.650
CV:kmeans 3 0.132 0.680 0.764
MAD:kmeans 2 0.116 0.664 0.795

**: 1-PAC > 0.95, *: 1-PAC > 0.9

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

Consensus heatmaps for all methods. (What is a consensus heatmap?)

collect_plots(res_list, k = 2, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-1

collect_plots(res_list, k = 3, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-2

collect_plots(res_list, k = 4, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-3

collect_plots(res_list, k = 5, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-4

collect_plots(res_list, k = 6, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-5

Membership heatmap

Membership heatmaps for all methods. (What is a membership heatmap?)

collect_plots(res_list, k = 2, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-1

collect_plots(res_list, k = 3, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-2

collect_plots(res_list, k = 4, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-3

collect_plots(res_list, k = 5, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-4

collect_plots(res_list, k = 6, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-5

Signature heatmap

Signature heatmaps for all methods. (What is a signature heatmap?)

Note in following heatmaps, rows are scaled.

collect_plots(res_list, k = 2, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-1

collect_plots(res_list, k = 3, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-2

collect_plots(res_list, k = 4, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-3

collect_plots(res_list, k = 5, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-4

collect_plots(res_list, k = 6, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-5

Statistics table

The statistics used for measuring the stability of consensus partitioning. (How are they defined?)

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 0.919           0.932       0.967          0.446 0.531   0.531
#> CV:NMF      2 0.836           0.932       0.970          0.427 0.595   0.595
#> MAD:NMF     2 0.772           0.945       0.972          0.464 0.531   0.531
#> ATC:NMF     2 1.000           1.000       1.000          0.405 0.595   0.595
#> SD:skmeans  2 0.836           0.962       0.981          0.476 0.531   0.531
#> CV:skmeans  2 0.688           0.925       0.959          0.485 0.499   0.499
#> MAD:skmeans 2 0.836           0.919       0.960          0.492 0.499   0.499
#> ATC:skmeans 2 1.000           0.992       0.995          0.408 0.595   0.595
#> SD:mclust   2 0.280           0.373       0.688          0.422 0.497   0.497
#> CV:mclust   2 0.203           0.759       0.817          0.453 0.499   0.499
#> MAD:mclust  2 1.000           0.988       0.990          0.290 0.717   0.717
#> ATC:mclust  2 0.836           0.954       0.966          0.489 0.499   0.499
#> SD:kmeans   2 0.150           0.560       0.763          0.383 0.604   0.604
#> CV:kmeans   2 0.185           0.576       0.731          0.357 0.531   0.531
#> MAD:kmeans  2 0.116           0.664       0.795          0.411 0.604   0.604
#> ATC:kmeans  2 0.722           0.938       0.941          0.380 0.595   0.595
#> SD:pam      2 1.000           1.000       1.000          0.405 0.595   0.595
#> CV:pam      2 1.000           1.000       1.000          0.405 0.595   0.595
#> MAD:pam     2 0.901           0.952       0.975          0.452 0.531   0.531
#> ATC:pam     2 1.000           1.000       1.000          0.405 0.595   0.595
#> SD:hclust   2 1.000           0.990       0.994          0.409 0.595   0.595
#> CV:hclust   2 0.531           0.953       0.918          0.352 0.595   0.595
#> MAD:hclust  2 0.674           0.929       0.956          0.442 0.531   0.531
#> ATC:hclust  2 0.820           0.897       0.958          0.342 0.704   0.704
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.944           0.970       0.982          0.198 0.950   0.906
#> CV:NMF      3 0.895           0.958       0.957          0.432 0.804   0.671
#> MAD:NMF     3 0.643           0.756       0.883          0.387 0.740   0.542
#> ATC:NMF     3 1.000           0.998       0.997          0.605 0.754   0.587
#> SD:skmeans  3 0.772           0.831       0.916          0.391 0.754   0.563
#> CV:skmeans  3 0.706           0.692       0.872          0.357 0.704   0.475
#> MAD:skmeans 3 0.706           0.840       0.909          0.348 0.786   0.597
#> ATC:skmeans 3 1.000           0.984       0.989          0.589 0.754   0.587
#> SD:mclust   3 0.380           0.711       0.777          0.426 0.623   0.407
#> CV:mclust   3 0.554           0.548       0.700          0.391 0.636   0.391
#> MAD:mclust  3 0.405           0.758       0.796          1.077 0.733   0.631
#> ATC:mclust  3 0.587           0.866       0.849          0.288 0.836   0.682
#> SD:kmeans   3 0.216           0.538       0.700          0.463 0.806   0.696
#> CV:kmeans   3 0.132           0.680       0.764          0.488 0.754   0.609
#> MAD:kmeans  3 0.200           0.511       0.611          0.393 0.806   0.696
#> ATC:kmeans  3 0.449           0.583       0.772          0.524 0.804   0.671
#> SD:pam      3 1.000           1.000       1.000          0.281 0.886   0.808
#> CV:pam      3 1.000           1.000       1.000          0.281 0.886   0.808
#> MAD:pam     3 0.742           0.825       0.896          0.285 0.950   0.906
#> ATC:pam     3 0.878           0.847       0.942          0.641 0.745   0.571
#> SD:hclust   3 1.000           0.999       1.000          0.270 0.886   0.808
#> CV:hclust   3 1.000           1.000       1.000          0.477 0.886   0.808
#> MAD:hclust  3 0.642           0.921       0.957          0.194 0.950   0.906
#> ATC:hclust  3 0.718           0.768       0.834          0.611 0.663   0.521
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.742           0.783       0.857         0.3487 0.755   0.501
#> CV:NMF      4 0.841           0.942       0.941         0.2055 0.850   0.625
#> MAD:NMF     4 0.699           0.853       0.879         0.1483 0.748   0.403
#> ATC:NMF     4 0.827           0.926       0.915         0.1438 0.900   0.714
#> SD:skmeans  4 0.706           0.659       0.757         0.1200 0.836   0.587
#> CV:skmeans  4 0.706           0.811       0.873         0.1279 0.854   0.598
#> MAD:skmeans 4 0.690           0.798       0.841         0.1176 0.898   0.709
#> ATC:skmeans 4 0.769           0.777       0.852         0.1221 0.940   0.828
#> SD:mclust   4 0.683           0.776       0.885         0.1434 0.918   0.794
#> CV:mclust   4 0.702           0.769       0.845         0.0926 0.950   0.849
#> MAD:mclust  4 0.595           0.603       0.779         0.2017 0.652   0.343
#> ATC:mclust  4 0.720           0.700       0.769         0.1274 0.852   0.629
#> SD:kmeans   4 0.317           0.485       0.672         0.1756 0.886   0.771
#> CV:kmeans   4 0.373           0.582       0.709         0.1948 1.000   1.000
#> MAD:kmeans  4 0.266           0.552       0.653         0.1870 0.754   0.535
#> ATC:kmeans  4 0.469           0.672       0.732         0.1648 0.804   0.577
#> SD:pam      4 0.797           0.840       0.858         0.2838 0.802   0.589
#> CV:pam      4 1.000           0.987       0.986         0.1886 0.902   0.796
#> MAD:pam     4 0.962           0.913       0.964         0.2100 0.813   0.612
#> ATC:pam     4 0.747           0.745       0.825         0.0647 0.958   0.884
#> SD:hclust   4 0.718           0.867       0.814         0.1866 0.966   0.930
#> CV:hclust   4 1.000           0.978       0.979         0.2030 0.902   0.796
#> MAD:hclust  4 0.561           0.764       0.847         0.2927 0.836   0.659
#> ATC:hclust  4 0.770           0.914       0.932         0.2013 0.947   0.854
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.876           0.950       0.939         0.0777 0.930   0.742
#> CV:NMF      5 0.804           0.822       0.857         0.0583 0.934   0.752
#> MAD:NMF     5 0.892           0.930       0.941         0.0565 0.902   0.652
#> ATC:NMF     5 0.863           0.926       0.929         0.0546 0.902   0.652
#> SD:skmeans  5 0.822           0.805       0.795         0.0576 0.902   0.671
#> CV:skmeans  5 0.806           0.770       0.827         0.0561 0.918   0.691
#> MAD:skmeans 5 0.772           0.861       0.868         0.0615 0.968   0.871
#> ATC:skmeans 5 0.850           0.924       0.854         0.0593 0.923   0.736
#> SD:mclust   5 0.752           0.740       0.841         0.0944 0.900   0.684
#> CV:mclust   5 0.838           0.872       0.898         0.1161 0.952   0.829
#> MAD:mclust  5 0.702           0.842       0.800         0.0521 0.818   0.452
#> ATC:mclust  5 0.866           0.916       0.922         0.0724 0.968   0.887
#> SD:kmeans   5 0.432           0.558       0.650         0.0934 0.757   0.459
#> CV:kmeans   5 0.495           0.471       0.653         0.1034 0.902   0.796
#> MAD:kmeans  5 0.467           0.554       0.612         0.0887 0.886   0.656
#> ATC:kmeans  5 0.569           0.599       0.670         0.1012 0.902   0.704
#> SD:pam      5 0.960           0.961       0.982         0.1455 0.939   0.790
#> CV:pam      5 0.929           0.967       0.977         0.1480 0.918   0.786
#> MAD:pam     5 0.954           0.947       0.974         0.0870 0.912   0.715
#> ATC:pam     5 0.739           0.736       0.810         0.0668 0.862   0.610
#> SD:hclust   5 0.800           0.886       0.866         0.1563 0.802   0.558
#> CV:hclust   5 0.852           0.894       0.946         0.1763 0.868   0.656
#> MAD:hclust  5 0.613           0.672       0.791         0.0640 0.868   0.670
#> ATC:hclust  5 0.800           0.854       0.862         0.1674 0.900   0.682
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.850           0.815       0.805         0.0478 0.966   0.843
#> CV:NMF      6 0.820           0.838       0.801         0.0441 0.984   0.926
#> MAD:NMF     6 0.818           0.798       0.822         0.0426 0.913   0.652
#> ATC:NMF     6 0.887           0.837       0.857         0.0373 1.000   1.000
#> SD:skmeans  6 0.818           0.864       0.871         0.0380 0.968   0.851
#> CV:skmeans  6 0.852           0.846       0.776         0.0369 0.984   0.920
#> MAD:skmeans 6 0.836           0.879       0.864         0.0404 0.968   0.851
#> ATC:skmeans 6 0.852           0.894       0.870         0.0470 0.968   0.851
#> SD:mclust   6 0.854           0.827       0.886         0.0863 0.930   0.702
#> CV:mclust   6 0.786           0.807       0.823         0.0467 0.882   0.582
#> MAD:mclust  6 0.834           0.878       0.927         0.0723 0.950   0.786
#> ATC:mclust  6 1.000           0.999       0.999         0.0731 0.932   0.730
#> SD:kmeans   6 0.601           0.629       0.643         0.0732 0.935   0.752
#> CV:kmeans   6 0.595           0.596       0.601         0.0741 0.786   0.524
#> MAD:kmeans  6 0.645           0.617       0.590         0.0598 0.872   0.510
#> ATC:kmeans  6 0.646           0.576       0.661         0.0576 0.936   0.745
#> SD:pam      6 0.957           0.971       0.975         0.0480 0.964   0.849
#> CV:pam      6 0.884           0.946       0.936         0.0865 0.934   0.781
#> MAD:pam     6 0.945           0.947       0.956         0.0480 0.964   0.849
#> ATC:pam     6 0.834           0.757       0.874         0.0552 0.908   0.652
#> SD:hclust   6 0.918           0.907       0.957         0.1130 0.950   0.800
#> CV:hclust   6 0.868           0.921       0.925         0.0573 0.984   0.936
#> MAD:hclust  6 0.834           0.828       0.917         0.1070 0.868   0.622
#> ATC:hclust  6 0.832           0.522       0.698         0.0379 0.848   0.465

Following heatmap plots the partition for each combination of methods and the lightness correspond to the silhouette scores for samples in each method. On top the consensus subgroup is inferred from all methods by taking the mean silhouette scores as weight.

collect_stats(res_list, k = 2)

plot of chunk tab-collect-stats-from-consensus-partition-list-1

collect_stats(res_list, k = 3)

plot of chunk tab-collect-stats-from-consensus-partition-list-2

collect_stats(res_list, k = 4)

plot of chunk tab-collect-stats-from-consensus-partition-list-3

collect_stats(res_list, k = 5)

plot of chunk tab-collect-stats-from-consensus-partition-list-4

collect_stats(res_list, k = 6)

plot of chunk tab-collect-stats-from-consensus-partition-list-5

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

plot of chunk tab-collect-classes-from-consensus-partition-list-1

collect_classes(res_list, k = 3)

plot of chunk tab-collect-classes-from-consensus-partition-list-2

collect_classes(res_list, k = 4)

plot of chunk tab-collect-classes-from-consensus-partition-list-3

collect_classes(res_list, k = 5)

plot of chunk tab-collect-classes-from-consensus-partition-list-4

collect_classes(res_list, k = 6)

plot of chunk tab-collect-classes-from-consensus-partition-list-5

Top rows overlap

Overlap of top rows from different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-1

top_rows_overlap(res_list, top_n = 2000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-2

top_rows_overlap(res_list, top_n = 3000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-3

top_rows_overlap(res_list, top_n = 4000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-4

top_rows_overlap(res_list, top_n = 5000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-5

Also visualize the correspondance of rankings between different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-1

top_rows_overlap(res_list, top_n = 2000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-2

top_rows_overlap(res_list, top_n = 3000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-3

top_rows_overlap(res_list, top_n = 4000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-4

top_rows_overlap(res_list, top_n = 5000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-5

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

plot of chunk tab-top-rows-heatmap-1

top_rows_heatmap(res_list, top_n = 2000)

plot of chunk tab-top-rows-heatmap-2

top_rows_heatmap(res_list, top_n = 3000)

plot of chunk tab-top-rows-heatmap-3

top_rows_heatmap(res_list, top_n = 4000)

plot of chunk tab-top-rows-heatmap-4

top_rows_heatmap(res_list, top_n = 5000)

plot of chunk tab-top-rows-heatmap-5

Results for each method


SD:hclust*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "hclust"]
# you can also extract it by
# res = res_list["SD:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.990       0.994          0.409 0.595   0.595
#> 3 3 1.000           0.999       1.000          0.270 0.886   0.808
#> 4 4 0.718           0.867       0.814          0.187 0.966   0.930
#> 5 5 0.800           0.886       0.866          0.156 0.802   0.558
#> 6 6 0.918           0.907       0.957          0.113 0.950   0.800

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3

There is also optional best \(k\) = 2 3 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1  0.0000      0.992 1.000 0.000
#> ERR342843     1  0.0000      0.992 1.000 0.000
#> ERR342896     1  0.0000      0.992 1.000 0.000
#> ERR342827     2  0.0000      0.998 0.000 1.000
#> ERR342871     1  0.0000      0.992 1.000 0.000
#> ERR342863     2  0.0000      0.998 0.000 1.000
#> ERR342839     1  0.0000      0.992 1.000 0.000
#> ERR342906     1  0.0000      0.992 1.000 0.000
#> ERR342905     2  0.0376      0.997 0.004 0.996
#> ERR342816     1  0.0000      0.992 1.000 0.000
#> ERR342865     2  0.0000      0.998 0.000 1.000
#> ERR342824     1  0.0000      0.992 1.000 0.000
#> ERR342841     2  0.0000      0.998 0.000 1.000
#> ERR342835     1  0.0000      0.992 1.000 0.000
#> ERR342899     2  0.0376      0.997 0.004 0.996
#> ERR342829     1  0.0000      0.992 1.000 0.000
#> ERR342850     1  0.0000      0.992 1.000 0.000
#> ERR342849     2  0.0376      0.997 0.004 0.996
#> ERR342811     1  0.0000      0.992 1.000 0.000
#> ERR342837     1  0.0000      0.992 1.000 0.000
#> ERR342857     1  0.0000      0.992 1.000 0.000
#> ERR342869     1  0.0000      0.992 1.000 0.000
#> ERR342903     1  0.0000      0.992 1.000 0.000
#> ERR342819     1  0.0000      0.992 1.000 0.000
#> ERR342885     1  0.3274      0.943 0.940 0.060
#> ERR342889     2  0.0000      0.998 0.000 1.000
#> ERR342864     1  0.0000      0.992 1.000 0.000
#> ERR342860     2  0.0376      0.997 0.004 0.996
#> ERR342808     1  0.0000      0.992 1.000 0.000
#> ERR342823     1  0.0000      0.992 1.000 0.000
#> ERR342907     2  0.0000      0.998 0.000 1.000
#> ERR342852     1  0.0000      0.992 1.000 0.000
#> ERR342832     2  0.0000      0.998 0.000 1.000
#> ERR342868     1  0.0000      0.992 1.000 0.000
#> ERR342821     1  0.0000      0.992 1.000 0.000
#> ERR342878     2  0.0000      0.998 0.000 1.000
#> ERR342876     1  0.0000      0.992 1.000 0.000
#> ERR342809     1  0.0000      0.992 1.000 0.000
#> ERR342846     1  0.3274      0.943 0.940 0.060
#> ERR342872     2  0.0000      0.998 0.000 1.000
#> ERR342828     2  0.0000      0.998 0.000 1.000
#> ERR342840     1  0.0000      0.992 1.000 0.000
#> ERR342831     1  0.0000      0.992 1.000 0.000
#> ERR342818     1  0.0000      0.992 1.000 0.000
#> ERR342862     1  0.0000      0.992 1.000 0.000
#> ERR342894     1  0.0000      0.992 1.000 0.000
#> ERR342884     2  0.0000      0.998 0.000 1.000
#> ERR342891     1  0.0000      0.992 1.000 0.000
#> ERR342890     1  0.0000      0.992 1.000 0.000
#> ERR342836     2  0.0000      0.998 0.000 1.000
#> ERR342879     1  0.0000      0.992 1.000 0.000
#> ERR342848     1  0.0000      0.992 1.000 0.000
#> ERR342861     1  0.0000      0.992 1.000 0.000
#> ERR342814     2  0.0376      0.997 0.004 0.996
#> ERR342870     1  0.0000      0.992 1.000 0.000
#> ERR342901     1  0.0000      0.992 1.000 0.000
#> ERR342908     1  0.0000      0.992 1.000 0.000
#> ERR342815     2  0.0000      0.998 0.000 1.000
#> ERR342897     1  0.3274      0.943 0.940 0.060
#> ERR342833     2  0.0000      0.998 0.000 1.000
#> ERR342817     1  0.3274      0.943 0.940 0.060
#> ERR342810     2  0.0376      0.997 0.004 0.996
#> ERR342867     1  0.0000      0.992 1.000 0.000
#> ERR342847     1  0.0000      0.992 1.000 0.000
#> ERR342855     1  0.0000      0.992 1.000 0.000
#> ERR342851     1  0.0000      0.992 1.000 0.000
#> ERR342813     1  0.0000      0.992 1.000 0.000
#> ERR342883     1  0.0000      0.992 1.000 0.000
#> ERR342856     1  0.3274      0.943 0.940 0.060
#> ERR342822     2  0.0000      0.998 0.000 1.000
#> ERR342892     1  0.0000      0.992 1.000 0.000
#> ERR342842     1  0.0000      0.992 1.000 0.000
#> ERR342902     2  0.0000      0.998 0.000 1.000
#> ERR342900     2  0.0376      0.997 0.004 0.996
#> ERR342888     1  0.0000      0.992 1.000 0.000
#> ERR342812     1  0.0000      0.992 1.000 0.000
#> ERR342853     2  0.0376      0.997 0.004 0.996
#> ERR342866     1  0.0000      0.992 1.000 0.000
#> ERR342820     1  0.0000      0.992 1.000 0.000
#> ERR342895     1  0.0000      0.992 1.000 0.000
#> ERR342825     1  0.3274      0.943 0.940 0.060
#> ERR342826     1  0.3274      0.943 0.940 0.060
#> ERR342875     2  0.0000      0.998 0.000 1.000
#> ERR342834     1  0.3274      0.943 0.940 0.060
#> ERR342898     1  0.0000      0.992 1.000 0.000
#> ERR342886     2  0.0376      0.997 0.004 0.996
#> ERR342838     1  0.0000      0.992 1.000 0.000
#> ERR342882     1  0.0000      0.992 1.000 0.000
#> ERR342807     2  0.0000      0.998 0.000 1.000
#> ERR342873     1  0.0000      0.992 1.000 0.000
#> ERR342844     1  0.0000      0.992 1.000 0.000
#> ERR342874     1  0.0000      0.992 1.000 0.000
#> ERR342893     1  0.0000      0.992 1.000 0.000
#> ERR342859     1  0.3274      0.943 0.940 0.060
#> ERR342830     2  0.0376      0.997 0.004 0.996
#> ERR342880     1  0.0000      0.992 1.000 0.000
#> ERR342887     1  0.0000      0.992 1.000 0.000
#> ERR342854     1  0.0000      0.992 1.000 0.000
#> ERR342904     1  0.0000      0.992 1.000 0.000
#> ERR342881     1  0.0000      0.992 1.000 0.000
#> ERR342858     1  0.0000      0.992 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2 p3
#> ERR342845     1  0.0000      1.000 1.000 0.000  0
#> ERR342843     1  0.0000      1.000 1.000 0.000  0
#> ERR342896     1  0.0000      1.000 1.000 0.000  0
#> ERR342827     2  0.0000      0.998 0.000 1.000  0
#> ERR342871     1  0.0000      1.000 1.000 0.000  0
#> ERR342863     2  0.0000      0.998 0.000 1.000  0
#> ERR342839     1  0.0000      1.000 1.000 0.000  0
#> ERR342906     1  0.0000      1.000 1.000 0.000  0
#> ERR342905     2  0.0237      0.996 0.004 0.996  0
#> ERR342816     1  0.0000      1.000 1.000 0.000  0
#> ERR342865     2  0.0000      0.998 0.000 1.000  0
#> ERR342824     1  0.0000      1.000 1.000 0.000  0
#> ERR342841     2  0.0000      0.998 0.000 1.000  0
#> ERR342835     1  0.0000      1.000 1.000 0.000  0
#> ERR342899     2  0.0237      0.996 0.004 0.996  0
#> ERR342829     1  0.0000      1.000 1.000 0.000  0
#> ERR342850     1  0.0000      1.000 1.000 0.000  0
#> ERR342849     2  0.0237      0.996 0.004 0.996  0
#> ERR342811     1  0.0000      1.000 1.000 0.000  0
#> ERR342837     1  0.0000      1.000 1.000 0.000  0
#> ERR342857     1  0.0000      1.000 1.000 0.000  0
#> ERR342869     1  0.0000      1.000 1.000 0.000  0
#> ERR342903     1  0.0000      1.000 1.000 0.000  0
#> ERR342819     1  0.0000      1.000 1.000 0.000  0
#> ERR342885     3  0.0000      1.000 0.000 0.000  1
#> ERR342889     2  0.0000      0.998 0.000 1.000  0
#> ERR342864     1  0.0000      1.000 1.000 0.000  0
#> ERR342860     2  0.0237      0.996 0.004 0.996  0
#> ERR342808     1  0.0000      1.000 1.000 0.000  0
#> ERR342823     1  0.0000      1.000 1.000 0.000  0
#> ERR342907     2  0.0000      0.998 0.000 1.000  0
#> ERR342852     1  0.0000      1.000 1.000 0.000  0
#> ERR342832     2  0.0000      0.998 0.000 1.000  0
#> ERR342868     1  0.0000      1.000 1.000 0.000  0
#> ERR342821     1  0.0000      1.000 1.000 0.000  0
#> ERR342878     2  0.0000      0.998 0.000 1.000  0
#> ERR342876     1  0.0000      1.000 1.000 0.000  0
#> ERR342809     1  0.0000      1.000 1.000 0.000  0
#> ERR342846     3  0.0000      1.000 0.000 0.000  1
#> ERR342872     2  0.0000      0.998 0.000 1.000  0
#> ERR342828     2  0.0000      0.998 0.000 1.000  0
#> ERR342840     1  0.0000      1.000 1.000 0.000  0
#> ERR342831     1  0.0000      1.000 1.000 0.000  0
#> ERR342818     1  0.0000      1.000 1.000 0.000  0
#> ERR342862     1  0.0000      1.000 1.000 0.000  0
#> ERR342894     1  0.0000      1.000 1.000 0.000  0
#> ERR342884     2  0.0000      0.998 0.000 1.000  0
#> ERR342891     1  0.0000      1.000 1.000 0.000  0
#> ERR342890     1  0.0000      1.000 1.000 0.000  0
#> ERR342836     2  0.0000      0.998 0.000 1.000  0
#> ERR342879     1  0.0000      1.000 1.000 0.000  0
#> ERR342848     1  0.0000      1.000 1.000 0.000  0
#> ERR342861     1  0.0000      1.000 1.000 0.000  0
#> ERR342814     2  0.0237      0.996 0.004 0.996  0
#> ERR342870     1  0.0000      1.000 1.000 0.000  0
#> ERR342901     1  0.0000      1.000 1.000 0.000  0
#> ERR342908     1  0.0000      1.000 1.000 0.000  0
#> ERR342815     2  0.0000      0.998 0.000 1.000  0
#> ERR342897     3  0.0000      1.000 0.000 0.000  1
#> ERR342833     2  0.0000      0.998 0.000 1.000  0
#> ERR342817     3  0.0000      1.000 0.000 0.000  1
#> ERR342810     2  0.0237      0.996 0.004 0.996  0
#> ERR342867     1  0.0000      1.000 1.000 0.000  0
#> ERR342847     1  0.0000      1.000 1.000 0.000  0
#> ERR342855     1  0.0000      1.000 1.000 0.000  0
#> ERR342851     1  0.0000      1.000 1.000 0.000  0
#> ERR342813     1  0.0000      1.000 1.000 0.000  0
#> ERR342883     1  0.0000      1.000 1.000 0.000  0
#> ERR342856     3  0.0000      1.000 0.000 0.000  1
#> ERR342822     2  0.0000      0.998 0.000 1.000  0
#> ERR342892     1  0.0000      1.000 1.000 0.000  0
#> ERR342842     1  0.0000      1.000 1.000 0.000  0
#> ERR342902     2  0.0000      0.998 0.000 1.000  0
#> ERR342900     2  0.0237      0.996 0.004 0.996  0
#> ERR342888     1  0.0000      1.000 1.000 0.000  0
#> ERR342812     1  0.0000      1.000 1.000 0.000  0
#> ERR342853     2  0.0237      0.996 0.004 0.996  0
#> ERR342866     1  0.0000      1.000 1.000 0.000  0
#> ERR342820     1  0.0000      1.000 1.000 0.000  0
#> ERR342895     1  0.0000      1.000 1.000 0.000  0
#> ERR342825     3  0.0000      1.000 0.000 0.000  1
#> ERR342826     3  0.0000      1.000 0.000 0.000  1
#> ERR342875     2  0.0000      0.998 0.000 1.000  0
#> ERR342834     3  0.0000      1.000 0.000 0.000  1
#> ERR342898     1  0.0000      1.000 1.000 0.000  0
#> ERR342886     2  0.0237      0.996 0.004 0.996  0
#> ERR342838     1  0.0000      1.000 1.000 0.000  0
#> ERR342882     1  0.0000      1.000 1.000 0.000  0
#> ERR342807     2  0.0000      0.998 0.000 1.000  0
#> ERR342873     1  0.0000      1.000 1.000 0.000  0
#> ERR342844     1  0.0000      1.000 1.000 0.000  0
#> ERR342874     1  0.0000      1.000 1.000 0.000  0
#> ERR342893     1  0.0000      1.000 1.000 0.000  0
#> ERR342859     3  0.0000      1.000 0.000 0.000  1
#> ERR342830     2  0.0237      0.996 0.004 0.996  0
#> ERR342880     1  0.0000      1.000 1.000 0.000  0
#> ERR342887     1  0.0000      1.000 1.000 0.000  0
#> ERR342854     1  0.0000      1.000 1.000 0.000  0
#> ERR342904     1  0.0000      1.000 1.000 0.000  0
#> ERR342881     1  0.0000      1.000 1.000 0.000  0
#> ERR342858     1  0.0000      1.000 1.000 0.000  0

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> ERR342845     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342843     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342896     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342827     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342871     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342863     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342839     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342906     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342905     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342816     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342865     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342824     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342841     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342835     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342899     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342829     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342850     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342849     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342811     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342837     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342857     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342869     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342903     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342819     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342889     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342864     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342860     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342808     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342823     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342907     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342852     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342832     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342868     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342821     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342878     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342876     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342809     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342872     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342828     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342840     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342831     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342818     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342862     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342894     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342884     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342891     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342890     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342836     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342879     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342848     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342861     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342814     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342870     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342901     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342908     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342815     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342833     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342810     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342867     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342847     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342855     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342851     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342813     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342883     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342822     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342892     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342842     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342902     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342900     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342888     1  0.4989      0.736 0.528 0.000  0 0.472
#> ERR342812     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342853     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342866     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342820     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342895     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342875     2  0.0336      0.986 0.000 0.992  0 0.008
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342898     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342886     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342838     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342882     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342807     4  0.4989      1.000 0.000 0.472  0 0.528
#> ERR342873     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342844     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342874     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342893     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342830     2  0.0188      0.988 0.004 0.996  0 0.000
#> ERR342880     1  0.0000      0.778 1.000 0.000  0 0.000
#> ERR342887     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342854     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342904     1  0.0188      0.778 0.996 0.000  0 0.004
#> ERR342881     1  0.4543      0.828 0.676 0.000  0 0.324
#> ERR342858     1  0.0000      0.778 1.000 0.000  0 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2 p3    p4    p5
#> ERR342845     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342843     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342896     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342827     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342871     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342863     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342839     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342906     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342905     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342816     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342865     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342824     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342841     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342835     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342899     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342829     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342850     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342849     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342811     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342837     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342857     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342869     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342903     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342819     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342889     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342864     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342860     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342808     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342823     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342907     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342852     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342832     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342868     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342821     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342878     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342876     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342809     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342872     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342828     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342840     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342831     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342818     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342862     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342894     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342884     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342891     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342890     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342836     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342879     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342848     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342861     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342814     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342870     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342901     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342908     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342815     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342833     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342810     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342867     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342847     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342855     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342851     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342813     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342883     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342822     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342892     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342842     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342902     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342900     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342888     1  0.1544      0.493 0.932 0.000  0 0.068 0.000
#> ERR342812     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342853     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342866     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342820     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342895     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342875     2  0.0404      0.993 0.000 0.988  0 0.000 0.012
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342898     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342886     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342838     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342882     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342807     5  0.0000      1.000 0.000 0.000  0 0.000 1.000
#> ERR342873     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342844     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342874     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342893     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342830     2  0.0000      0.994 0.000 1.000  0 0.000 0.000
#> ERR342880     4  0.1768      0.914 0.072 0.004  0 0.924 0.000
#> ERR342887     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342854     1  0.4299      0.813 0.608 0.004  0 0.388 0.000
#> ERR342904     4  0.0000      0.959 0.000 0.000  0 1.000 0.000
#> ERR342881     1  0.4288      0.811 0.612 0.004  0 0.384 0.000
#> ERR342858     4  0.1768      0.914 0.072 0.004  0 0.924 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3    p4    p5    p6
#> ERR342845     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342843     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342896     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342827     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342871     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342863     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342839     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342906     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342905     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342816     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342865     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342824     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342841     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342835     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342899     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342829     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342850     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342849     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342811     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342837     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342857     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342869     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342903     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342819     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342885     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342889     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342864     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342860     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342808     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342823     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342907     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342852     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342832     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342868     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342821     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342878     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342876     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342809     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342846     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342872     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342828     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342840     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342831     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342818     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342862     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342894     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342884     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342891     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342890     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342836     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342879     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342848     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342861     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342814     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342870     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342901     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342908     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342815     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342897     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342833     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342817     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342810     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342867     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342847     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342855     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342851     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342813     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342883     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342856     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342822     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342892     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342842     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342902     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342900     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342888     5   0.000      1.000 0.000 0.000  0 0.000 1.000 0.000
#> ERR342812     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342853     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342866     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342820     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342895     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342825     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342826     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342875     2   0.385      0.993 0.000 0.536  0 0.000 0.000 0.464
#> ERR342834     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342898     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342886     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342838     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342882     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342807     6   0.384      1.000 0.452 0.000  0 0.000 0.000 0.548
#> ERR342873     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342844     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342874     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342893     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342859     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342830     2   0.384      0.994 0.000 0.548  0 0.000 0.000 0.452
#> ERR342880     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000
#> ERR342887     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342854     1   0.397      0.998 0.548 0.000  0 0.448 0.004 0.000
#> ERR342904     4   0.384      0.784 0.000 0.452  0 0.548 0.000 0.000
#> ERR342881     1   0.384      0.997 0.548 0.000  0 0.452 0.000 0.000
#> ERR342858     4   0.026      0.413 0.008 0.000  0 0.992 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "kmeans"]
# you can also extract it by
# res = res_list["SD:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.150           0.560       0.763         0.3830 0.604   0.604
#> 3 3 0.216           0.538       0.700         0.4631 0.806   0.696
#> 4 4 0.317           0.485       0.672         0.1756 0.886   0.771
#> 5 5 0.432           0.558       0.650         0.0934 0.757   0.459
#> 6 6 0.601           0.629       0.643         0.0732 0.935   0.752

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.745     0.6040 0.788 0.212
#> ERR342843     1   0.745     0.6040 0.788 0.212
#> ERR342896     1   0.118     0.7322 0.984 0.016
#> ERR342827     2   0.788     0.7310 0.236 0.764
#> ERR342871     1   0.730     0.6423 0.796 0.204
#> ERR342863     2   0.788     0.7298 0.236 0.764
#> ERR342839     1   0.745     0.6040 0.788 0.212
#> ERR342906     1   0.839     0.5467 0.732 0.268
#> ERR342905     1   0.990    -0.0194 0.560 0.440
#> ERR342816     1   0.839     0.5467 0.732 0.268
#> ERR342865     2   0.788     0.7298 0.236 0.764
#> ERR342824     1   0.118     0.7322 0.984 0.016
#> ERR342841     2   0.788     0.7310 0.236 0.764
#> ERR342835     1   0.327     0.7172 0.940 0.060
#> ERR342899     1   0.990    -0.0194 0.560 0.440
#> ERR342829     1   0.118     0.7322 0.984 0.016
#> ERR342850     1   0.730     0.6423 0.796 0.204
#> ERR342849     1   0.990    -0.0194 0.560 0.440
#> ERR342811     1   0.730     0.6423 0.796 0.204
#> ERR342837     1   0.327     0.7172 0.940 0.060
#> ERR342857     1   0.839     0.5467 0.732 0.268
#> ERR342869     1   0.730     0.6423 0.796 0.204
#> ERR342903     1   0.118     0.7322 0.984 0.016
#> ERR342819     1   0.327     0.7172 0.940 0.060
#> ERR342885     2   1.000     0.1077 0.488 0.512
#> ERR342889     2   0.788     0.7298 0.236 0.764
#> ERR342864     1   0.839     0.5467 0.732 0.268
#> ERR342860     1   0.990    -0.0194 0.560 0.440
#> ERR342808     1   0.730     0.6423 0.796 0.204
#> ERR342823     1   0.118     0.7322 0.984 0.016
#> ERR342907     2   0.788     0.7310 0.236 0.764
#> ERR342852     1   0.839     0.5467 0.732 0.268
#> ERR342832     2   0.788     0.7298 0.236 0.764
#> ERR342868     1   0.745     0.6040 0.788 0.212
#> ERR342821     1   0.839     0.5467 0.732 0.268
#> ERR342878     2   0.788     0.7310 0.236 0.764
#> ERR342876     1   0.118     0.7322 0.984 0.016
#> ERR342809     1   0.118     0.7322 0.984 0.016
#> ERR342846     2   1.000     0.1077 0.488 0.512
#> ERR342872     2   0.788     0.7310 0.236 0.764
#> ERR342828     2   0.788     0.7298 0.236 0.764
#> ERR342840     1   0.327     0.7172 0.940 0.060
#> ERR342831     1   0.745     0.6040 0.788 0.212
#> ERR342818     1   0.625     0.6829 0.844 0.156
#> ERR342862     1   0.327     0.7172 0.940 0.060
#> ERR342894     1   0.745     0.6040 0.788 0.212
#> ERR342884     2   0.788     0.7310 0.236 0.764
#> ERR342891     1   0.118     0.7322 0.984 0.016
#> ERR342890     1   0.745     0.6040 0.788 0.212
#> ERR342836     2   0.788     0.7298 0.236 0.764
#> ERR342879     1   0.625     0.6829 0.844 0.156
#> ERR342848     1   0.625     0.6829 0.844 0.156
#> ERR342861     1   0.118     0.7322 0.984 0.016
#> ERR342814     1   0.990    -0.0194 0.560 0.440
#> ERR342870     1   0.730     0.6423 0.796 0.204
#> ERR342901     1   0.118     0.7322 0.984 0.016
#> ERR342908     1   0.730     0.6423 0.796 0.204
#> ERR342815     2   0.788     0.7298 0.236 0.764
#> ERR342897     2   1.000     0.1077 0.488 0.512
#> ERR342833     2   0.788     0.7310 0.236 0.764
#> ERR342817     2   1.000     0.1077 0.488 0.512
#> ERR342810     1   0.990    -0.0194 0.560 0.440
#> ERR342867     1   0.839     0.5467 0.732 0.268
#> ERR342847     1   0.327     0.7172 0.940 0.060
#> ERR342855     1   0.118     0.7322 0.984 0.016
#> ERR342851     1   0.625     0.6829 0.844 0.156
#> ERR342813     1   0.745     0.6040 0.788 0.212
#> ERR342883     1   0.625     0.6829 0.844 0.156
#> ERR342856     2   1.000     0.1077 0.488 0.512
#> ERR342822     2   0.788     0.7298 0.236 0.764
#> ERR342892     1   0.118     0.7322 0.984 0.016
#> ERR342842     1   0.118     0.7322 0.984 0.016
#> ERR342902     2   0.788     0.7310 0.236 0.764
#> ERR342900     1   0.990    -0.0194 0.560 0.440
#> ERR342888     1   0.745     0.6040 0.788 0.212
#> ERR342812     1   0.118     0.7322 0.984 0.016
#> ERR342853     1   0.990    -0.0194 0.560 0.440
#> ERR342866     1   0.327     0.7172 0.940 0.060
#> ERR342820     1   0.730     0.6423 0.796 0.204
#> ERR342895     1   0.118     0.7322 0.984 0.016
#> ERR342825     2   1.000     0.1077 0.488 0.512
#> ERR342826     2   1.000     0.1077 0.488 0.512
#> ERR342875     2   0.788     0.7298 0.236 0.764
#> ERR342834     2   1.000     0.1077 0.488 0.512
#> ERR342898     1   0.839     0.5467 0.732 0.268
#> ERR342886     1   0.990    -0.0194 0.560 0.440
#> ERR342838     1   0.118     0.7322 0.984 0.016
#> ERR342882     1   0.118     0.7322 0.984 0.016
#> ERR342807     2   0.788     0.7310 0.236 0.764
#> ERR342873     1   0.625     0.6829 0.844 0.156
#> ERR342844     1   0.839     0.5467 0.732 0.268
#> ERR342874     1   0.327     0.7172 0.940 0.060
#> ERR342893     1   0.625     0.6829 0.844 0.156
#> ERR342859     2   1.000     0.1077 0.488 0.512
#> ERR342830     1   0.990    -0.0194 0.560 0.440
#> ERR342880     1   0.625     0.6829 0.844 0.156
#> ERR342887     1   0.118     0.7322 0.984 0.016
#> ERR342854     1   0.118     0.7322 0.984 0.016
#> ERR342904     1   0.730     0.6423 0.796 0.204
#> ERR342881     1   0.327     0.7172 0.940 0.060
#> ERR342858     1   0.625     0.6829 0.844 0.156

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.7529     0.3562 0.624 0.060 0.316
#> ERR342843     1  0.7529     0.3562 0.624 0.060 0.316
#> ERR342896     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342827     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342871     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342863     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342839     1  0.7588     0.3562 0.624 0.064 0.312
#> ERR342906     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342905     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342816     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342865     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342824     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342841     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342835     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342899     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342829     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342850     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342849     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342811     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342837     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342857     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342869     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342903     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342819     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342885     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342889     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342864     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342860     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342808     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342823     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342907     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342852     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342832     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342868     1  0.7588     0.3562 0.624 0.064 0.312
#> ERR342821     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342878     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342876     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342809     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342846     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342872     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342828     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342840     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342831     1  0.7529     0.3562 0.624 0.060 0.316
#> ERR342818     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342862     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342894     1  0.7529     0.3562 0.624 0.060 0.316
#> ERR342884     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342891     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342890     1  0.7588     0.3562 0.624 0.064 0.312
#> ERR342836     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342879     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342848     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342861     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342814     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342870     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342901     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342908     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342815     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342897     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342833     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342817     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342810     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342867     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342847     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342855     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342851     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342813     1  0.7529     0.3562 0.624 0.060 0.316
#> ERR342883     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342856     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342822     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342892     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342842     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342902     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342900     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342888     1  0.7588     0.3562 0.624 0.064 0.312
#> ERR342812     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342853     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342866     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342820     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342895     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342825     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342826     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342875     2  0.2173     0.7756 0.048 0.944 0.008
#> ERR342834     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342898     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342886     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342838     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342882     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342807     2  0.5202     0.7441 0.044 0.820 0.136
#> ERR342873     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342844     1  0.9730     0.0222 0.428 0.232 0.340
#> ERR342874     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342893     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342859     3  0.8042     1.0000 0.216 0.136 0.648
#> ERR342830     2  0.8266     0.6157 0.240 0.624 0.136
#> ERR342880     1  0.8513     0.4338 0.596 0.140 0.264
#> ERR342887     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342854     1  0.0424     0.6056 0.992 0.008 0.000
#> ERR342904     1  0.9046     0.1773 0.528 0.160 0.312
#> ERR342881     1  0.5757     0.5673 0.792 0.056 0.152
#> ERR342858     1  0.8513     0.4338 0.596 0.140 0.264

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> ERR342845     1  0.7860     0.3578 0.464 0.016 0.168 NA
#> ERR342843     1  0.7881     0.3578 0.464 0.016 0.172 NA
#> ERR342896     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342827     2  0.5501     0.7361 0.012 0.748 0.076 NA
#> ERR342871     1  0.9087    -0.2609 0.388 0.092 0.344 NA
#> ERR342863     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342839     1  0.7909     0.3578 0.460 0.016 0.176 NA
#> ERR342906     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342905     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342816     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342865     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342824     1  0.0779     0.5724 0.980 0.016 0.004 NA
#> ERR342841     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342835     1  0.6510     0.4988 0.636 0.036 0.044 NA
#> ERR342899     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342829     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342850     1  0.9087    -0.2609 0.388 0.092 0.344 NA
#> ERR342849     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342811     1  0.9067    -0.2607 0.388 0.092 0.348 NA
#> ERR342837     1  0.6510     0.4988 0.636 0.036 0.044 NA
#> ERR342857     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342869     1  0.9087    -0.2609 0.388 0.092 0.344 NA
#> ERR342903     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342819     1  0.6510     0.4988 0.636 0.036 0.044 NA
#> ERR342885     3  0.4362     0.6730 0.096 0.088 0.816 NA
#> ERR342889     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342864     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342860     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342808     1  0.9067    -0.2607 0.388 0.092 0.348 NA
#> ERR342823     1  0.0779     0.5724 0.980 0.016 0.004 NA
#> ERR342907     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342852     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342832     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342868     1  0.7909     0.3578 0.460 0.016 0.176 NA
#> ERR342821     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342878     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342876     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342809     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342846     3  0.5040     0.6724 0.096 0.088 0.796 NA
#> ERR342872     2  0.5478     0.7361 0.012 0.748 0.072 NA
#> ERR342828     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342840     1  0.6562     0.4989 0.636 0.036 0.048 NA
#> ERR342831     1  0.7860     0.3578 0.464 0.016 0.168 NA
#> ERR342818     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342862     1  0.6611     0.4989 0.636 0.036 0.052 NA
#> ERR342894     1  0.7881     0.3578 0.464 0.016 0.172 NA
#> ERR342884     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342891     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342890     1  0.7909     0.3578 0.460 0.016 0.176 NA
#> ERR342836     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342879     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342848     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342861     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342814     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342870     1  0.9067    -0.2607 0.388 0.092 0.348 NA
#> ERR342901     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342908     1  0.9067    -0.2607 0.388 0.092 0.348 NA
#> ERR342815     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342897     3  0.5040     0.6724 0.096 0.088 0.796 NA
#> ERR342833     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342817     3  0.4362     0.6730 0.096 0.088 0.816 NA
#> ERR342810     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342867     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342847     1  0.6562     0.4989 0.636 0.036 0.048 NA
#> ERR342855     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342851     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342813     1  0.7881     0.3578 0.464 0.016 0.172 NA
#> ERR342883     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342856     3  0.5040     0.6724 0.096 0.088 0.796 NA
#> ERR342822     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342892     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342842     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342902     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342900     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342888     1  0.7909     0.3578 0.460 0.016 0.176 NA
#> ERR342812     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342853     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342866     1  0.6562     0.4989 0.636 0.036 0.048 NA
#> ERR342820     1  0.9087    -0.2609 0.388 0.092 0.344 NA
#> ERR342895     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342825     3  0.4362     0.6730 0.096 0.088 0.816 NA
#> ERR342826     3  0.4362     0.6730 0.096 0.088 0.816 NA
#> ERR342875     2  0.0967     0.7885 0.004 0.976 0.016 NA
#> ERR342834     3  0.4362     0.6730 0.096 0.088 0.816 NA
#> ERR342898     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342886     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342838     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342882     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342807     2  0.5452     0.7362 0.012 0.748 0.068 NA
#> ERR342873     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342844     3  0.9540     0.5914 0.280 0.180 0.384 NA
#> ERR342874     1  0.6611     0.4989 0.636 0.036 0.052 NA
#> ERR342893     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342859     3  0.5040     0.6724 0.096 0.088 0.796 NA
#> ERR342830     2  0.6530     0.7001 0.096 0.700 0.044 NA
#> ERR342880     1  0.9468     0.0684 0.380 0.120 0.224 NA
#> ERR342887     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342854     1  0.0592     0.5728 0.984 0.016 0.000 NA
#> ERR342904     1  0.9067    -0.2607 0.388 0.092 0.348 NA
#> ERR342881     1  0.6611     0.4989 0.636 0.036 0.052 NA
#> ERR342858     1  0.9468     0.0684 0.380 0.120 0.224 NA

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.6083      0.985 0.352 0.008 0.004 0.092 0.544
#> ERR342843     5  0.6126      0.985 0.352 0.008 0.004 0.096 0.540
#> ERR342896     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.5309      0.639 0.012 0.656 0.288 0.028 0.016
#> ERR342871     4  0.7220      0.439 0.260 0.064 0.060 0.568 0.048
#> ERR342863     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342839     5  0.6548      0.983 0.352 0.008 0.024 0.092 0.524
#> ERR342906     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342905     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342816     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342865     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342824     1  0.1153      0.733 0.964 0.000 0.024 0.004 0.008
#> ERR342841     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342835     1  0.7620      0.372 0.540 0.036 0.108 0.072 0.244
#> ERR342899     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342829     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.7220      0.439 0.260 0.064 0.060 0.568 0.048
#> ERR342849     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342811     4  0.7163      0.440 0.260 0.064 0.056 0.572 0.048
#> ERR342837     1  0.7620      0.372 0.540 0.036 0.108 0.072 0.244
#> ERR342857     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342869     4  0.7220      0.439 0.260 0.064 0.060 0.568 0.048
#> ERR342903     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342819     1  0.7620      0.372 0.540 0.036 0.108 0.072 0.244
#> ERR342885     4  0.8507     -0.921 0.040 0.084 0.308 0.396 0.172
#> ERR342889     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342864     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342860     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342808     4  0.7163      0.440 0.260 0.064 0.056 0.572 0.048
#> ERR342823     1  0.1153      0.733 0.964 0.000 0.024 0.004 0.008
#> ERR342907     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342852     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342832     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342868     5  0.6548      0.983 0.352 0.008 0.024 0.092 0.524
#> ERR342821     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342878     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342876     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.8324      1.000 0.040 0.084 0.380 0.364 0.132
#> ERR342872     2  0.5309      0.639 0.012 0.656 0.288 0.028 0.016
#> ERR342828     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342840     1  0.7650      0.372 0.540 0.036 0.108 0.076 0.240
#> ERR342831     5  0.6083      0.985 0.352 0.008 0.004 0.092 0.544
#> ERR342818     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342862     1  0.7675      0.371 0.540 0.036 0.120 0.072 0.232
#> ERR342894     5  0.6126      0.985 0.352 0.008 0.004 0.096 0.540
#> ERR342884     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342891     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.6548      0.983 0.352 0.008 0.024 0.092 0.524
#> ERR342836     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342879     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342848     4  0.8508      0.446 0.268 0.088 0.092 0.456 0.096
#> ERR342861     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342870     4  0.7163      0.440 0.260 0.064 0.056 0.572 0.048
#> ERR342901     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.7163      0.440 0.260 0.064 0.056 0.572 0.048
#> ERR342815     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342897     3  0.8324      1.000 0.040 0.084 0.380 0.364 0.132
#> ERR342833     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342817     4  0.8507     -0.921 0.040 0.084 0.308 0.396 0.172
#> ERR342810     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342867     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342847     1  0.7650      0.372 0.540 0.036 0.108 0.076 0.240
#> ERR342855     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342813     5  0.6126      0.985 0.352 0.008 0.004 0.096 0.540
#> ERR342883     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342856     3  0.8324      1.000 0.040 0.084 0.380 0.364 0.132
#> ERR342822     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342892     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.4919      0.640 0.012 0.656 0.304 0.028 0.000
#> ERR342900     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342888     5  0.6548      0.983 0.352 0.008 0.024 0.092 0.524
#> ERR342812     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342866     1  0.7650      0.372 0.540 0.036 0.108 0.076 0.240
#> ERR342820     4  0.7220      0.439 0.260 0.064 0.060 0.568 0.048
#> ERR342895     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342825     4  0.8507     -0.921 0.040 0.084 0.308 0.396 0.172
#> ERR342826     4  0.8527     -0.922 0.040 0.084 0.308 0.392 0.176
#> ERR342875     2  0.0451      0.702 0.008 0.988 0.000 0.004 0.000
#> ERR342834     4  0.8527     -0.922 0.040 0.084 0.308 0.392 0.176
#> ERR342898     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342886     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342838     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.5052      0.640 0.012 0.656 0.300 0.028 0.004
#> ERR342873     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342844     4  0.6044      0.484 0.172 0.152 0.008 0.652 0.016
#> ERR342874     1  0.7675      0.371 0.540 0.036 0.120 0.072 0.232
#> ERR342893     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342859     3  0.8324      1.000 0.040 0.084 0.380 0.364 0.132
#> ERR342830     2  0.7993      0.605 0.096 0.552 0.088 0.088 0.176
#> ERR342880     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092
#> ERR342887     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.757 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.7163      0.440 0.260 0.064 0.056 0.572 0.048
#> ERR342881     1  0.7675      0.371 0.540 0.036 0.120 0.072 0.232
#> ERR342858     4  0.8508      0.446 0.268 0.088 0.096 0.456 0.092

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5   0.582      0.965 0.236 0.036 0.100 0.012 0.616 0.000
#> ERR342843     5   0.582      0.965 0.236 0.036 0.100 0.012 0.616 0.000
#> ERR342896     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     6   0.481      0.979 0.004 0.272 0.012 0.032 0.012 0.668
#> ERR342871     4   0.803      0.480 0.140 0.048 0.280 0.432 0.044 0.056
#> ERR342863     2   0.595      0.138 0.004 0.524 0.008 0.072 0.032 0.360
#> ERR342839     5   0.738      0.956 0.236 0.056 0.104 0.036 0.528 0.040
#> ERR342906     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342905     2   0.285      0.596 0.064 0.880 0.020 0.020 0.016 0.000
#> ERR342816     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342865     2   0.595      0.138 0.004 0.524 0.008 0.072 0.032 0.360
#> ERR342824     1   0.187      0.704 0.932 0.004 0.004 0.016 0.008 0.036
#> ERR342841     6   0.433      0.993 0.004 0.272 0.012 0.024 0.000 0.688
#> ERR342835     1   0.823      0.335 0.428 0.140 0.020 0.100 0.244 0.068
#> ERR342899     2   0.246      0.598 0.064 0.896 0.020 0.016 0.004 0.000
#> ERR342829     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4   0.803      0.480 0.140 0.048 0.280 0.432 0.044 0.056
#> ERR342849     2   0.246      0.598 0.064 0.896 0.020 0.016 0.004 0.000
#> ERR342811     4   0.803      0.480 0.140 0.044 0.280 0.432 0.048 0.056
#> ERR342837     1   0.823      0.335 0.428 0.140 0.020 0.100 0.244 0.068
#> ERR342857     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342869     4   0.803      0.480 0.140 0.048 0.280 0.432 0.044 0.056
#> ERR342903     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     1   0.823      0.335 0.428 0.140 0.020 0.100 0.244 0.068
#> ERR342885     3   0.166      0.968 0.008 0.024 0.940 0.000 0.004 0.024
#> ERR342889     2   0.595      0.138 0.004 0.524 0.008 0.072 0.032 0.360
#> ERR342864     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342860     2   0.293      0.595 0.064 0.876 0.028 0.016 0.016 0.000
#> ERR342808     4   0.803      0.480 0.140 0.044 0.280 0.432 0.048 0.056
#> ERR342823     1   0.187      0.704 0.932 0.004 0.004 0.016 0.008 0.036
#> ERR342907     6   0.433      0.993 0.004 0.272 0.012 0.024 0.000 0.688
#> ERR342852     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342832     2   0.595      0.138 0.004 0.524 0.008 0.072 0.032 0.360
#> ERR342868     5   0.738      0.956 0.236 0.056 0.104 0.036 0.528 0.040
#> ERR342821     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342878     6   0.433      0.993 0.004 0.272 0.012 0.024 0.000 0.688
#> ERR342876     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3   0.320      0.961 0.008 0.032 0.868 0.008 0.032 0.052
#> ERR342872     6   0.461      0.987 0.004 0.272 0.012 0.032 0.004 0.676
#> ERR342828     2   0.597      0.136 0.004 0.524 0.008 0.068 0.036 0.360
#> ERR342840     1   0.825      0.334 0.428 0.140 0.024 0.100 0.244 0.064
#> ERR342831     5   0.582      0.965 0.236 0.036 0.100 0.012 0.616 0.000
#> ERR342818     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342862     1   0.826      0.333 0.428 0.140 0.020 0.108 0.236 0.068
#> ERR342894     5   0.582      0.965 0.236 0.036 0.100 0.012 0.616 0.000
#> ERR342884     6   0.440      0.991 0.004 0.272 0.012 0.028 0.000 0.684
#> ERR342891     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5   0.738      0.956 0.236 0.056 0.104 0.036 0.528 0.040
#> ERR342836     2   0.595      0.138 0.004 0.524 0.008 0.072 0.032 0.360
#> ERR342879     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342848     4   0.893      0.485 0.204 0.088 0.108 0.404 0.100 0.096
#> ERR342861     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2   0.257      0.597 0.064 0.892 0.020 0.016 0.008 0.000
#> ERR342870     4   0.803      0.480 0.140 0.040 0.280 0.432 0.052 0.056
#> ERR342901     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4   0.803      0.480 0.140 0.044 0.280 0.432 0.048 0.056
#> ERR342815     2   0.598      0.134 0.004 0.524 0.008 0.064 0.040 0.360
#> ERR342897     3   0.320      0.961 0.008 0.032 0.868 0.008 0.032 0.052
#> ERR342833     6   0.433      0.993 0.004 0.272 0.012 0.024 0.000 0.688
#> ERR342817     3   0.166      0.968 0.008 0.024 0.940 0.000 0.004 0.024
#> ERR342810     2   0.285      0.596 0.064 0.880 0.020 0.020 0.016 0.000
#> ERR342867     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342847     1   0.825      0.334 0.428 0.140 0.024 0.100 0.244 0.064
#> ERR342855     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342813     5   0.582      0.965 0.236 0.036 0.100 0.012 0.616 0.000
#> ERR342883     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342856     3   0.320      0.961 0.008 0.032 0.868 0.008 0.032 0.052
#> ERR342822     2   0.597      0.136 0.004 0.524 0.008 0.068 0.036 0.360
#> ERR342892     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     6   0.433      0.993 0.004 0.272 0.012 0.024 0.000 0.688
#> ERR342900     2   0.246      0.598 0.064 0.896 0.020 0.016 0.004 0.000
#> ERR342888     5   0.738      0.956 0.236 0.056 0.104 0.036 0.528 0.040
#> ERR342812     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2   0.285      0.596 0.064 0.880 0.020 0.020 0.016 0.000
#> ERR342866     1   0.825      0.334 0.428 0.140 0.024 0.100 0.244 0.064
#> ERR342820     4   0.803      0.480 0.140 0.048 0.280 0.432 0.044 0.056
#> ERR342895     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3   0.166      0.968 0.008 0.024 0.940 0.000 0.004 0.024
#> ERR342826     3   0.178      0.968 0.008 0.024 0.936 0.000 0.008 0.024
#> ERR342875     2   0.597      0.136 0.004 0.524 0.008 0.068 0.036 0.360
#> ERR342834     3   0.166      0.968 0.008 0.024 0.940 0.000 0.004 0.024
#> ERR342898     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342886     2   0.293      0.595 0.064 0.876 0.028 0.016 0.016 0.000
#> ERR342838     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     6   0.468      0.980 0.004 0.272 0.012 0.036 0.004 0.672
#> ERR342873     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342844     4   0.683      0.486 0.072 0.048 0.304 0.524 0.020 0.032
#> ERR342874     1   0.826      0.333 0.428 0.140 0.020 0.108 0.236 0.068
#> ERR342893     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342859     3   0.320      0.961 0.008 0.032 0.868 0.008 0.032 0.052
#> ERR342830     2   0.293      0.595 0.064 0.876 0.028 0.016 0.016 0.000
#> ERR342880     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092
#> ERR342887     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1   0.000      0.743 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4   0.803      0.480 0.140 0.040 0.280 0.432 0.052 0.056
#> ERR342881     1   0.826      0.333 0.428 0.140 0.020 0.108 0.236 0.068
#> ERR342858     4   0.886      0.487 0.204 0.088 0.112 0.412 0.092 0.092

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "skmeans"]
# you can also extract it by
# res = res_list["SD:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.836           0.962       0.981         0.4761 0.531   0.531
#> 3 3 0.772           0.831       0.916         0.3914 0.754   0.563
#> 4 4 0.706           0.659       0.757         0.1200 0.836   0.587
#> 5 5 0.822           0.805       0.795         0.0576 0.902   0.671
#> 6 6 0.818           0.864       0.871         0.0380 0.968   0.851

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1  0.0376      0.967 0.996 0.004
#> ERR342843     1  0.0376      0.967 0.996 0.004
#> ERR342896     1  0.0000      0.969 1.000 0.000
#> ERR342827     2  0.0000      0.999 0.000 1.000
#> ERR342871     1  0.0000      0.969 1.000 0.000
#> ERR342863     2  0.0000      0.999 0.000 1.000
#> ERR342839     1  0.0376      0.967 0.996 0.004
#> ERR342906     1  0.7299      0.776 0.796 0.204
#> ERR342905     2  0.0000      0.999 0.000 1.000
#> ERR342816     1  0.7299      0.776 0.796 0.204
#> ERR342865     2  0.0000      0.999 0.000 1.000
#> ERR342824     1  0.0000      0.969 1.000 0.000
#> ERR342841     2  0.0000      0.999 0.000 1.000
#> ERR342835     1  0.0000      0.969 1.000 0.000
#> ERR342899     2  0.0000      0.999 0.000 1.000
#> ERR342829     1  0.0000      0.969 1.000 0.000
#> ERR342850     1  0.0000      0.969 1.000 0.000
#> ERR342849     2  0.0000      0.999 0.000 1.000
#> ERR342811     1  0.0000      0.969 1.000 0.000
#> ERR342837     1  0.0000      0.969 1.000 0.000
#> ERR342857     1  0.7299      0.776 0.796 0.204
#> ERR342869     1  0.0000      0.969 1.000 0.000
#> ERR342903     1  0.0000      0.969 1.000 0.000
#> ERR342819     1  0.0000      0.969 1.000 0.000
#> ERR342885     2  0.0376      0.997 0.004 0.996
#> ERR342889     2  0.0000      0.999 0.000 1.000
#> ERR342864     1  0.7299      0.776 0.796 0.204
#> ERR342860     2  0.0000      0.999 0.000 1.000
#> ERR342808     1  0.0000      0.969 1.000 0.000
#> ERR342823     1  0.0000      0.969 1.000 0.000
#> ERR342907     2  0.0000      0.999 0.000 1.000
#> ERR342852     1  0.7299      0.776 0.796 0.204
#> ERR342832     2  0.0000      0.999 0.000 1.000
#> ERR342868     1  0.0376      0.967 0.996 0.004
#> ERR342821     1  0.7299      0.776 0.796 0.204
#> ERR342878     2  0.0000      0.999 0.000 1.000
#> ERR342876     1  0.0000      0.969 1.000 0.000
#> ERR342809     1  0.0000      0.969 1.000 0.000
#> ERR342846     2  0.0376      0.997 0.004 0.996
#> ERR342872     2  0.0000      0.999 0.000 1.000
#> ERR342828     2  0.0000      0.999 0.000 1.000
#> ERR342840     1  0.0000      0.969 1.000 0.000
#> ERR342831     1  0.0376      0.967 0.996 0.004
#> ERR342818     1  0.0376      0.967 0.996 0.004
#> ERR342862     1  0.0000      0.969 1.000 0.000
#> ERR342894     1  0.0376      0.967 0.996 0.004
#> ERR342884     2  0.0000      0.999 0.000 1.000
#> ERR342891     1  0.0000      0.969 1.000 0.000
#> ERR342890     1  0.0376      0.967 0.996 0.004
#> ERR342836     2  0.0000      0.999 0.000 1.000
#> ERR342879     1  0.0376      0.967 0.996 0.004
#> ERR342848     1  0.0376      0.967 0.996 0.004
#> ERR342861     1  0.0000      0.969 1.000 0.000
#> ERR342814     2  0.0000      0.999 0.000 1.000
#> ERR342870     1  0.0000      0.969 1.000 0.000
#> ERR342901     1  0.0000      0.969 1.000 0.000
#> ERR342908     1  0.0000      0.969 1.000 0.000
#> ERR342815     2  0.0000      0.999 0.000 1.000
#> ERR342897     2  0.0376      0.997 0.004 0.996
#> ERR342833     2  0.0000      0.999 0.000 1.000
#> ERR342817     2  0.0376      0.997 0.004 0.996
#> ERR342810     2  0.0000      0.999 0.000 1.000
#> ERR342867     1  0.7299      0.776 0.796 0.204
#> ERR342847     1  0.0000      0.969 1.000 0.000
#> ERR342855     1  0.0000      0.969 1.000 0.000
#> ERR342851     1  0.0376      0.967 0.996 0.004
#> ERR342813     1  0.0376      0.967 0.996 0.004
#> ERR342883     1  0.0376      0.967 0.996 0.004
#> ERR342856     2  0.0376      0.997 0.004 0.996
#> ERR342822     2  0.0000      0.999 0.000 1.000
#> ERR342892     1  0.0000      0.969 1.000 0.000
#> ERR342842     1  0.0000      0.969 1.000 0.000
#> ERR342902     2  0.0000      0.999 0.000 1.000
#> ERR342900     2  0.0000      0.999 0.000 1.000
#> ERR342888     1  0.0376      0.967 0.996 0.004
#> ERR342812     1  0.0000      0.969 1.000 0.000
#> ERR342853     2  0.0000      0.999 0.000 1.000
#> ERR342866     1  0.0000      0.969 1.000 0.000
#> ERR342820     1  0.0000      0.969 1.000 0.000
#> ERR342895     1  0.0000      0.969 1.000 0.000
#> ERR342825     2  0.0376      0.997 0.004 0.996
#> ERR342826     2  0.0376      0.997 0.004 0.996
#> ERR342875     2  0.0000      0.999 0.000 1.000
#> ERR342834     2  0.0376      0.997 0.004 0.996
#> ERR342898     1  0.7299      0.776 0.796 0.204
#> ERR342886     2  0.0000      0.999 0.000 1.000
#> ERR342838     1  0.0000      0.969 1.000 0.000
#> ERR342882     1  0.0000      0.969 1.000 0.000
#> ERR342807     2  0.0000      0.999 0.000 1.000
#> ERR342873     1  0.0376      0.967 0.996 0.004
#> ERR342844     1  0.7299      0.776 0.796 0.204
#> ERR342874     1  0.0000      0.969 1.000 0.000
#> ERR342893     1  0.0376      0.967 0.996 0.004
#> ERR342859     2  0.0376      0.997 0.004 0.996
#> ERR342830     2  0.0000      0.999 0.000 1.000
#> ERR342880     1  0.0376      0.967 0.996 0.004
#> ERR342887     1  0.0000      0.969 1.000 0.000
#> ERR342854     1  0.0000      0.969 1.000 0.000
#> ERR342904     1  0.0000      0.969 1.000 0.000
#> ERR342881     1  0.0000      0.969 1.000 0.000
#> ERR342858     1  0.0376      0.967 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342843     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342896     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342827     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342871     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342863     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342839     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342906     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342905     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342816     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342865     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342824     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342841     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342835     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342899     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342829     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342850     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342849     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342811     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342837     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342857     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342869     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342903     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342819     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342885     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342889     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342864     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342860     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342808     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342823     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342907     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342852     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342832     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342868     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342821     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342878     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342876     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342809     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342846     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342872     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342828     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342840     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342831     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342818     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342862     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342894     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342884     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342891     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342890     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342836     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342879     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342848     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342861     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342814     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342870     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342901     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342908     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342815     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342897     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342833     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342817     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342810     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342867     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342847     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342855     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342851     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342813     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342883     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342856     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342822     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342892     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342842     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342902     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342900     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342888     1  0.5621      0.595 0.692 0.000 0.308
#> ERR342812     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342853     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342866     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342820     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342895     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342825     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342826     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342875     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342834     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342898     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342886     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342838     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342882     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342807     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342873     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342844     3  0.0592      0.945 0.012 0.000 0.988
#> ERR342874     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342893     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342859     3  0.2774      0.920 0.008 0.072 0.920
#> ERR342830     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342880     1  0.6291      0.267 0.532 0.000 0.468
#> ERR342887     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342854     1  0.0000      0.821 1.000 0.000 0.000
#> ERR342904     3  0.1860      0.935 0.052 0.000 0.948
#> ERR342881     1  0.0892      0.819 0.980 0.000 0.020
#> ERR342858     1  0.6291      0.267 0.532 0.000 0.468

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342843     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342896     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342827     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342871     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342863     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342839     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342906     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342905     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342816     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342865     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342841     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342835     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342899     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342829     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342850     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342849     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342811     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342837     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342857     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342869     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342903     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342819     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342885     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342889     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342864     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342860     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342808     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342823     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342907     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342852     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342832     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342868     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342821     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342878     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342876     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342846     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342872     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342828     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342840     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342831     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342818     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342862     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342894     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342884     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342891     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342890     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342836     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342879     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342848     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342861     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342814     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342870     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342901     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342908     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342815     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342897     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342833     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342817     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342810     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342867     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342847     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342855     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342851     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342813     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342883     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342856     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342822     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342902     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342900     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342888     3  0.7706     0.0822 0.224 0.000 0.412 0.364
#> ERR342812     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342853     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342866     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342820     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342895     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342825     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342826     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342875     2  0.0000     0.9935 0.000 1.000 0.000 0.000
#> ERR342834     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342898     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342886     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342838     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342807     2  0.0592     0.9889 0.000 0.984 0.016 0.000
#> ERR342873     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342844     3  0.4992     0.3568 0.000 0.000 0.524 0.476
#> ERR342874     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342893     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342859     3  0.0188     0.4678 0.000 0.004 0.996 0.000
#> ERR342830     2  0.0188     0.9931 0.000 0.996 0.000 0.004
#> ERR342880     4  0.3976     1.0000 0.112 0.004 0.044 0.840
#> ERR342887     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000     0.7966 1.000 0.000 0.000 0.000
#> ERR342904     3  0.5281     0.3547 0.008 0.000 0.528 0.464
#> ERR342881     1  0.6498     0.3665 0.488 0.000 0.072 0.440
#> ERR342858     4  0.3976     1.0000 0.112 0.004 0.044 0.840

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342843     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342871     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342863     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342906     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342905     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342816     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342865     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342835     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342899     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342849     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342811     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342837     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342857     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342869     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342885     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342889     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342864     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342860     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342808     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342852     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342832     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342868     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342821     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342878     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342872     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342828     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342831     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342818     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342862     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342894     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342884     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342836     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342879     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342848     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342870     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342815     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342897     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342833     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342817     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342810     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342867     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342847     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342813     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342883     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342856     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342822     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342900     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342888     5  0.3891      0.694 0.060 0.000 0.004 0.128 0.808
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342866     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342820     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342826     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342875     2  0.0000      0.984 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342898     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342886     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.0727      0.980 0.000 0.980 0.004 0.004 0.012
#> ERR342873     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342844     3  0.4522      0.543 0.000 0.000 0.660 0.316 0.024
#> ERR342874     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342893     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342859     3  0.4920      0.445 0.000 0.012 0.572 0.012 0.404
#> ERR342830     2  0.1095      0.978 0.000 0.968 0.012 0.008 0.012
#> ERR342880     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     3  0.5188      0.533 0.008 0.000 0.636 0.308 0.048
#> ERR342881     5  0.7413      0.652 0.244 0.000 0.040 0.284 0.432
#> ERR342858     4  0.1653      1.000 0.024 0.000 0.004 0.944 0.028

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342843     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342871     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342863     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342839     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342906     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342905     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342816     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342865     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342835     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342899     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342849     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342811     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342837     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342857     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342869     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342885     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342889     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342864     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342860     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342808     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342852     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342832     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342868     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342821     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342878     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342872     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342828     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342840     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342831     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342818     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342862     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342894     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342884     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342836     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342879     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342848     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342870     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342815     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342897     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342833     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342817     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342810     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342867     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342847     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342813     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342883     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342856     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342822     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342900     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342888     5  0.0291      0.579 0.004 0.000 0.000 0.004 0.992 0.000
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342866     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342820     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342826     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342875     2  0.0000      0.957 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342834     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342898     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342886     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.0858      0.952 0.000 0.968 0.028 0.004 0.000 0.000
#> ERR342873     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342844     4  0.3499      0.748 0.000 0.000 0.044 0.812 0.012 0.132
#> ERR342874     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342893     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342859     3  0.4031      1.000 0.000 0.000 0.736 0.048 0.212 0.004
#> ERR342830     2  0.2314      0.934 0.000 0.900 0.056 0.008 0.000 0.036
#> ERR342880     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.4059      0.760 0.000 0.000 0.148 0.760 0.004 0.088
#> ERR342881     5  0.7635      0.555 0.140 0.000 0.140 0.024 0.396 0.300
#> ERR342858     6  0.2164      1.000 0.000 0.000 0.000 0.068 0.032 0.900

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "pam"]
# you can also extract it by
# res = res_list["SD:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000          0.405 0.595   0.595
#> 3 3 1.000           1.000       1.000          0.281 0.886   0.808
#> 4 4 0.797           0.840       0.858          0.284 0.802   0.589
#> 5 5 0.960           0.961       0.982          0.145 0.939   0.790
#> 6 6 0.957           0.971       0.975          0.048 0.964   0.849

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 5

There is also optional best \(k\) = 2 3 5 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette p1 p2
#> ERR342845     1       0          1  1  0
#> ERR342843     1       0          1  1  0
#> ERR342896     1       0          1  1  0
#> ERR342827     2       0          1  0  1
#> ERR342871     1       0          1  1  0
#> ERR342863     2       0          1  0  1
#> ERR342839     1       0          1  1  0
#> ERR342906     1       0          1  1  0
#> ERR342905     2       0          1  0  1
#> ERR342816     1       0          1  1  0
#> ERR342865     2       0          1  0  1
#> ERR342824     1       0          1  1  0
#> ERR342841     2       0          1  0  1
#> ERR342835     1       0          1  1  0
#> ERR342899     2       0          1  0  1
#> ERR342829     1       0          1  1  0
#> ERR342850     1       0          1  1  0
#> ERR342849     2       0          1  0  1
#> ERR342811     1       0          1  1  0
#> ERR342837     1       0          1  1  0
#> ERR342857     1       0          1  1  0
#> ERR342869     1       0          1  1  0
#> ERR342903     1       0          1  1  0
#> ERR342819     1       0          1  1  0
#> ERR342885     1       0          1  1  0
#> ERR342889     2       0          1  0  1
#> ERR342864     1       0          1  1  0
#> ERR342860     2       0          1  0  1
#> ERR342808     1       0          1  1  0
#> ERR342823     1       0          1  1  0
#> ERR342907     2       0          1  0  1
#> ERR342852     1       0          1  1  0
#> ERR342832     2       0          1  0  1
#> ERR342868     1       0          1  1  0
#> ERR342821     1       0          1  1  0
#> ERR342878     2       0          1  0  1
#> ERR342876     1       0          1  1  0
#> ERR342809     1       0          1  1  0
#> ERR342846     1       0          1  1  0
#> ERR342872     2       0          1  0  1
#> ERR342828     2       0          1  0  1
#> ERR342840     1       0          1  1  0
#> ERR342831     1       0          1  1  0
#> ERR342818     1       0          1  1  0
#> ERR342862     1       0          1  1  0
#> ERR342894     1       0          1  1  0
#> ERR342884     2       0          1  0  1
#> ERR342891     1       0          1  1  0
#> ERR342890     1       0          1  1  0
#> ERR342836     2       0          1  0  1
#> ERR342879     1       0          1  1  0
#> ERR342848     1       0          1  1  0
#> ERR342861     1       0          1  1  0
#> ERR342814     2       0          1  0  1
#> ERR342870     1       0          1  1  0
#> ERR342901     1       0          1  1  0
#> ERR342908     1       0          1  1  0
#> ERR342815     2       0          1  0  1
#> ERR342897     1       0          1  1  0
#> ERR342833     2       0          1  0  1
#> ERR342817     1       0          1  1  0
#> ERR342810     2       0          1  0  1
#> ERR342867     1       0          1  1  0
#> ERR342847     1       0          1  1  0
#> ERR342855     1       0          1  1  0
#> ERR342851     1       0          1  1  0
#> ERR342813     1       0          1  1  0
#> ERR342883     1       0          1  1  0
#> ERR342856     1       0          1  1  0
#> ERR342822     2       0          1  0  1
#> ERR342892     1       0          1  1  0
#> ERR342842     1       0          1  1  0
#> ERR342902     2       0          1  0  1
#> ERR342900     2       0          1  0  1
#> ERR342888     1       0          1  1  0
#> ERR342812     1       0          1  1  0
#> ERR342853     2       0          1  0  1
#> ERR342866     1       0          1  1  0
#> ERR342820     1       0          1  1  0
#> ERR342895     1       0          1  1  0
#> ERR342825     1       0          1  1  0
#> ERR342826     1       0          1  1  0
#> ERR342875     2       0          1  0  1
#> ERR342834     1       0          1  1  0
#> ERR342898     1       0          1  1  0
#> ERR342886     2       0          1  0  1
#> ERR342838     1       0          1  1  0
#> ERR342882     1       0          1  1  0
#> ERR342807     2       0          1  0  1
#> ERR342873     1       0          1  1  0
#> ERR342844     1       0          1  1  0
#> ERR342874     1       0          1  1  0
#> ERR342893     1       0          1  1  0
#> ERR342859     1       0          1  1  0
#> ERR342830     2       0          1  0  1
#> ERR342880     1       0          1  1  0
#> ERR342887     1       0          1  1  0
#> ERR342854     1       0          1  1  0
#> ERR342904     1       0          1  1  0
#> ERR342881     1       0          1  1  0
#> ERR342858     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette p1 p2 p3
#> ERR342845     1       0          1  1  0  0
#> ERR342843     1       0          1  1  0  0
#> ERR342896     1       0          1  1  0  0
#> ERR342827     2       0          1  0  1  0
#> ERR342871     1       0          1  1  0  0
#> ERR342863     2       0          1  0  1  0
#> ERR342839     1       0          1  1  0  0
#> ERR342906     1       0          1  1  0  0
#> ERR342905     2       0          1  0  1  0
#> ERR342816     1       0          1  1  0  0
#> ERR342865     2       0          1  0  1  0
#> ERR342824     1       0          1  1  0  0
#> ERR342841     2       0          1  0  1  0
#> ERR342835     1       0          1  1  0  0
#> ERR342899     2       0          1  0  1  0
#> ERR342829     1       0          1  1  0  0
#> ERR342850     1       0          1  1  0  0
#> ERR342849     2       0          1  0  1  0
#> ERR342811     1       0          1  1  0  0
#> ERR342837     1       0          1  1  0  0
#> ERR342857     1       0          1  1  0  0
#> ERR342869     1       0          1  1  0  0
#> ERR342903     1       0          1  1  0  0
#> ERR342819     1       0          1  1  0  0
#> ERR342885     3       0          1  0  0  1
#> ERR342889     2       0          1  0  1  0
#> ERR342864     1       0          1  1  0  0
#> ERR342860     2       0          1  0  1  0
#> ERR342808     1       0          1  1  0  0
#> ERR342823     1       0          1  1  0  0
#> ERR342907     2       0          1  0  1  0
#> ERR342852     1       0          1  1  0  0
#> ERR342832     2       0          1  0  1  0
#> ERR342868     1       0          1  1  0  0
#> ERR342821     1       0          1  1  0  0
#> ERR342878     2       0          1  0  1  0
#> ERR342876     1       0          1  1  0  0
#> ERR342809     1       0          1  1  0  0
#> ERR342846     3       0          1  0  0  1
#> ERR342872     2       0          1  0  1  0
#> ERR342828     2       0          1  0  1  0
#> ERR342840     1       0          1  1  0  0
#> ERR342831     1       0          1  1  0  0
#> ERR342818     1       0          1  1  0  0
#> ERR342862     1       0          1  1  0  0
#> ERR342894     1       0          1  1  0  0
#> ERR342884     2       0          1  0  1  0
#> ERR342891     1       0          1  1  0  0
#> ERR342890     1       0          1  1  0  0
#> ERR342836     2       0          1  0  1  0
#> ERR342879     1       0          1  1  0  0
#> ERR342848     1       0          1  1  0  0
#> ERR342861     1       0          1  1  0  0
#> ERR342814     2       0          1  0  1  0
#> ERR342870     1       0          1  1  0  0
#> ERR342901     1       0          1  1  0  0
#> ERR342908     1       0          1  1  0  0
#> ERR342815     2       0          1  0  1  0
#> ERR342897     3       0          1  0  0  1
#> ERR342833     2       0          1  0  1  0
#> ERR342817     3       0          1  0  0  1
#> ERR342810     2       0          1  0  1  0
#> ERR342867     1       0          1  1  0  0
#> ERR342847     1       0          1  1  0  0
#> ERR342855     1       0          1  1  0  0
#> ERR342851     1       0          1  1  0  0
#> ERR342813     1       0          1  1  0  0
#> ERR342883     1       0          1  1  0  0
#> ERR342856     3       0          1  0  0  1
#> ERR342822     2       0          1  0  1  0
#> ERR342892     1       0          1  1  0  0
#> ERR342842     1       0          1  1  0  0
#> ERR342902     2       0          1  0  1  0
#> ERR342900     2       0          1  0  1  0
#> ERR342888     1       0          1  1  0  0
#> ERR342812     1       0          1  1  0  0
#> ERR342853     2       0          1  0  1  0
#> ERR342866     1       0          1  1  0  0
#> ERR342820     1       0          1  1  0  0
#> ERR342895     1       0          1  1  0  0
#> ERR342825     3       0          1  0  0  1
#> ERR342826     3       0          1  0  0  1
#> ERR342875     2       0          1  0  1  0
#> ERR342834     3       0          1  0  0  1
#> ERR342898     1       0          1  1  0  0
#> ERR342886     2       0          1  0  1  0
#> ERR342838     1       0          1  1  0  0
#> ERR342882     1       0          1  1  0  0
#> ERR342807     2       0          1  0  1  0
#> ERR342873     1       0          1  1  0  0
#> ERR342844     1       0          1  1  0  0
#> ERR342874     1       0          1  1  0  0
#> ERR342893     1       0          1  1  0  0
#> ERR342859     3       0          1  0  0  1
#> ERR342830     2       0          1  0  1  0
#> ERR342880     1       0          1  1  0  0
#> ERR342887     1       0          1  1  0  0
#> ERR342854     1       0          1  1  0  0
#> ERR342904     1       0          1  1  0  0
#> ERR342881     1       0          1  1  0  0
#> ERR342858     1       0          1  1  0  0

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1 p2 p3    p4
#> ERR342845     1   0.000      0.427 1.000  0  0 0.000
#> ERR342843     1   0.000      0.427 1.000  0  0 0.000
#> ERR342896     1   0.499      0.746 0.532  0  0 0.468
#> ERR342827     2   0.000      1.000 0.000  1  0 0.000
#> ERR342871     4   0.000      0.927 0.000  0  0 1.000
#> ERR342863     2   0.000      1.000 0.000  1  0 0.000
#> ERR342839     1   0.000      0.427 1.000  0  0 0.000
#> ERR342906     4   0.000      0.927 0.000  0  0 1.000
#> ERR342905     2   0.000      1.000 0.000  1  0 0.000
#> ERR342816     4   0.000      0.927 0.000  0  0 1.000
#> ERR342865     2   0.000      1.000 0.000  1  0 0.000
#> ERR342824     1   0.499      0.746 0.532  0  0 0.468
#> ERR342841     2   0.000      1.000 0.000  1  0 0.000
#> ERR342835     1   0.499      0.731 0.520  0  0 0.480
#> ERR342899     2   0.000      1.000 0.000  1  0 0.000
#> ERR342829     1   0.499      0.746 0.532  0  0 0.468
#> ERR342850     4   0.000      0.927 0.000  0  0 1.000
#> ERR342849     2   0.000      1.000 0.000  1  0 0.000
#> ERR342811     4   0.000      0.927 0.000  0  0 1.000
#> ERR342837     1   0.499      0.731 0.520  0  0 0.480
#> ERR342857     4   0.000      0.927 0.000  0  0 1.000
#> ERR342869     4   0.000      0.927 0.000  0  0 1.000
#> ERR342903     1   0.499      0.746 0.532  0  0 0.468
#> ERR342819     1   0.499      0.731 0.520  0  0 0.480
#> ERR342885     3   0.000      1.000 0.000  0  1 0.000
#> ERR342889     2   0.000      1.000 0.000  1  0 0.000
#> ERR342864     4   0.000      0.927 0.000  0  0 1.000
#> ERR342860     2   0.000      1.000 0.000  1  0 0.000
#> ERR342808     4   0.000      0.927 0.000  0  0 1.000
#> ERR342823     1   0.499      0.746 0.532  0  0 0.468
#> ERR342907     2   0.000      1.000 0.000  1  0 0.000
#> ERR342852     4   0.000      0.927 0.000  0  0 1.000
#> ERR342832     2   0.000      1.000 0.000  1  0 0.000
#> ERR342868     1   0.000      0.427 1.000  0  0 0.000
#> ERR342821     4   0.000      0.927 0.000  0  0 1.000
#> ERR342878     2   0.000      1.000 0.000  1  0 0.000
#> ERR342876     1   0.499      0.746 0.532  0  0 0.468
#> ERR342809     1   0.499      0.746 0.532  0  0 0.468
#> ERR342846     3   0.000      1.000 0.000  0  1 0.000
#> ERR342872     2   0.000      1.000 0.000  1  0 0.000
#> ERR342828     2   0.000      1.000 0.000  1  0 0.000
#> ERR342840     1   0.499      0.731 0.520  0  0 0.480
#> ERR342831     1   0.000      0.427 1.000  0  0 0.000
#> ERR342818     4   0.208      0.856 0.084  0  0 0.916
#> ERR342862     1   0.499      0.731 0.520  0  0 0.480
#> ERR342894     1   0.000      0.427 1.000  0  0 0.000
#> ERR342884     2   0.000      1.000 0.000  1  0 0.000
#> ERR342891     1   0.499      0.746 0.532  0  0 0.468
#> ERR342890     1   0.000      0.427 1.000  0  0 0.000
#> ERR342836     2   0.000      1.000 0.000  1  0 0.000
#> ERR342879     4   0.201      0.861 0.080  0  0 0.920
#> ERR342848     4   0.471     -0.212 0.360  0  0 0.640
#> ERR342861     1   0.499      0.746 0.532  0  0 0.468
#> ERR342814     2   0.000      1.000 0.000  1  0 0.000
#> ERR342870     4   0.000      0.927 0.000  0  0 1.000
#> ERR342901     1   0.499      0.746 0.532  0  0 0.468
#> ERR342908     4   0.000      0.927 0.000  0  0 1.000
#> ERR342815     2   0.000      1.000 0.000  1  0 0.000
#> ERR342897     3   0.000      1.000 0.000  0  1 0.000
#> ERR342833     2   0.000      1.000 0.000  1  0 0.000
#> ERR342817     3   0.000      1.000 0.000  0  1 0.000
#> ERR342810     2   0.000      1.000 0.000  1  0 0.000
#> ERR342867     4   0.000      0.927 0.000  0  0 1.000
#> ERR342847     1   0.499      0.731 0.520  0  0 0.480
#> ERR342855     1   0.499      0.746 0.532  0  0 0.468
#> ERR342851     4   0.208      0.856 0.084  0  0 0.916
#> ERR342813     1   0.000      0.427 1.000  0  0 0.000
#> ERR342883     4   0.201      0.861 0.080  0  0 0.920
#> ERR342856     3   0.000      1.000 0.000  0  1 0.000
#> ERR342822     2   0.000      1.000 0.000  1  0 0.000
#> ERR342892     1   0.499      0.746 0.532  0  0 0.468
#> ERR342842     1   0.499      0.746 0.532  0  0 0.468
#> ERR342902     2   0.000      1.000 0.000  1  0 0.000
#> ERR342900     2   0.000      1.000 0.000  1  0 0.000
#> ERR342888     1   0.000      0.427 1.000  0  0 0.000
#> ERR342812     1   0.499      0.746 0.532  0  0 0.468
#> ERR342853     2   0.000      1.000 0.000  1  0 0.000
#> ERR342866     1   0.499      0.731 0.520  0  0 0.480
#> ERR342820     4   0.000      0.927 0.000  0  0 1.000
#> ERR342895     1   0.499      0.746 0.532  0  0 0.468
#> ERR342825     3   0.000      1.000 0.000  0  1 0.000
#> ERR342826     3   0.000      1.000 0.000  0  1 0.000
#> ERR342875     2   0.000      1.000 0.000  1  0 0.000
#> ERR342834     3   0.000      1.000 0.000  0  1 0.000
#> ERR342898     4   0.000      0.927 0.000  0  0 1.000
#> ERR342886     2   0.000      1.000 0.000  1  0 0.000
#> ERR342838     1   0.499      0.746 0.532  0  0 0.468
#> ERR342882     1   0.499      0.746 0.532  0  0 0.468
#> ERR342807     2   0.000      1.000 0.000  1  0 0.000
#> ERR342873     4   0.297      0.731 0.144  0  0 0.856
#> ERR342844     4   0.000      0.927 0.000  0  0 1.000
#> ERR342874     1   0.499      0.731 0.520  0  0 0.480
#> ERR342893     4   0.215      0.849 0.088  0  0 0.912
#> ERR342859     3   0.000      1.000 0.000  0  1 0.000
#> ERR342830     2   0.000      1.000 0.000  1  0 0.000
#> ERR342880     4   0.201      0.861 0.080  0  0 0.920
#> ERR342887     1   0.499      0.746 0.532  0  0 0.468
#> ERR342854     1   0.499      0.746 0.532  0  0 0.468
#> ERR342904     4   0.000      0.927 0.000  0  0 1.000
#> ERR342881     1   0.499      0.731 0.520  0  0 0.480
#> ERR342858     4   0.201      0.861 0.080  0  0 0.920

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1 p2 p3    p4 p5
#> ERR342845     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342843     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342896     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342827     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342871     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342863     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342839     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342906     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342905     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342816     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342865     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342824     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342841     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342835     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342899     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342829     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342850     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342849     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342811     4  0.0510      0.925 0.016  0  0 0.984  0
#> ERR342837     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342857     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342869     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342903     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342819     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342885     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342889     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342864     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342860     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342808     4  0.0510      0.925 0.016  0  0 0.984  0
#> ERR342823     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342907     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342852     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342832     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342868     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342821     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342878     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342876     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342809     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342846     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342872     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342828     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342840     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342831     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342818     4  0.3210      0.761 0.212  0  0 0.788  0
#> ERR342862     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342894     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342884     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342891     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342890     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342836     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342879     4  0.2230      0.868 0.116  0  0 0.884  0
#> ERR342848     1  0.3534      0.622 0.744  0  0 0.256  0
#> ERR342861     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342814     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342870     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342901     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342908     4  0.0510      0.925 0.016  0  0 0.984  0
#> ERR342815     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342897     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342833     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342817     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342810     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342867     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342847     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342855     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342851     4  0.2690      0.828 0.156  0  0 0.844  0
#> ERR342813     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342883     4  0.2179      0.870 0.112  0  0 0.888  0
#> ERR342856     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342822     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342892     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342842     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342902     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342900     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342888     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342812     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342853     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342866     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342820     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342895     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342825     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342826     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342875     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342834     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342898     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342886     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342838     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342882     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342807     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342873     4  0.4235      0.345 0.424  0  0 0.576  0
#> ERR342844     4  0.0000      0.928 0.000  0  0 1.000  0
#> ERR342874     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342893     4  0.2377      0.857 0.128  0  0 0.872  0
#> ERR342859     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342830     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342880     4  0.2230      0.868 0.116  0  0 0.884  0
#> ERR342887     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342854     1  0.0000      0.984 1.000  0  0 0.000  0
#> ERR342904     4  0.0404      0.926 0.012  0  0 0.988  0
#> ERR342881     1  0.0404      0.980 0.988  0  0 0.012  0
#> ERR342858     4  0.2230      0.868 0.116  0  0 0.884  0

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1 p2 p3    p4 p5    p6
#> ERR342845     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342843     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342896     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342827     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342871     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342863     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342839     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342906     4   0.120      0.945 0.000  0  0 0.944  0 0.056
#> ERR342905     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342816     4   0.139      0.942 0.000  0  0 0.932  0 0.068
#> ERR342865     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342824     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342841     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342835     1   0.209      0.906 0.876  0  0 0.000  0 0.124
#> ERR342899     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342829     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342850     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342849     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342811     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342837     1   0.209      0.906 0.876  0  0 0.000  0 0.124
#> ERR342857     4   0.139      0.942 0.000  0  0 0.932  0 0.068
#> ERR342869     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342903     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342819     1   0.214      0.904 0.872  0  0 0.000  0 0.128
#> ERR342885     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342889     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342864     4   0.226      0.889 0.000  0  0 0.860  0 0.140
#> ERR342860     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342808     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342823     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342907     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342852     4   0.181      0.922 0.000  0  0 0.900  0 0.100
#> ERR342832     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342868     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342821     4   0.133      0.943 0.000  0  0 0.936  0 0.064
#> ERR342878     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342876     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342809     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342846     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342872     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342828     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342840     1   0.226      0.895 0.860  0  0 0.000  0 0.140
#> ERR342831     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342818     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342862     1   0.234      0.888 0.852  0  0 0.000  0 0.148
#> ERR342894     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342884     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342891     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342890     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342836     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342879     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342848     6   0.193      0.949 0.036  0  0 0.048  0 0.916
#> ERR342861     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342814     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342870     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342901     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342908     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342815     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342897     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342833     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342817     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342810     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342867     4   0.120      0.945 0.000  0  0 0.944  0 0.056
#> ERR342847     1   0.209      0.906 0.876  0  0 0.000  0 0.124
#> ERR342855     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342851     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342813     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342883     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342856     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342822     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342892     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342842     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342902     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342900     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342888     5   0.000      1.000 0.000  0  0 0.000  1 0.000
#> ERR342812     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342853     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342866     1   0.222      0.898 0.864  0  0 0.000  0 0.136
#> ERR342820     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342895     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342825     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342826     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342875     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342834     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342898     4   0.238      0.876 0.000  0  0 0.848  0 0.152
#> ERR342886     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342838     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342882     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342807     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342873     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342844     4   0.222      0.893 0.000  0  0 0.864  0 0.136
#> ERR342874     1   0.218      0.901 0.868  0  0 0.000  0 0.132
#> ERR342893     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342859     3   0.000      1.000 0.000  0  1 0.000  0 0.000
#> ERR342830     2   0.000      1.000 0.000  1  0 0.000  0 0.000
#> ERR342880     6   0.122      0.994 0.004  0  0 0.048  0 0.948
#> ERR342887     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342854     1   0.000      0.958 1.000  0  0 0.000  0 0.000
#> ERR342904     4   0.000      0.950 0.000  0  0 1.000  0 0.000
#> ERR342881     1   0.218      0.901 0.868  0  0 0.000  0 0.132
#> ERR342858     6   0.122      0.994 0.004  0  0 0.048  0 0.948

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "mclust"]
# you can also extract it by
# res = res_list["SD:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.280           0.373       0.688         0.4218 0.497   0.497
#> 3 3 0.380           0.711       0.777         0.4257 0.623   0.407
#> 4 4 0.683           0.776       0.885         0.1434 0.918   0.794
#> 5 5 0.752           0.740       0.841         0.0944 0.900   0.684
#> 6 6 0.854           0.827       0.886         0.0863 0.930   0.702

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.961     0.2898 0.616 0.384
#> ERR342843     1   0.961     0.2898 0.616 0.384
#> ERR342896     2   0.958     0.1938 0.380 0.620
#> ERR342827     2   0.969     0.3797 0.396 0.604
#> ERR342871     1   0.000     0.6511 1.000 0.000
#> ERR342863     2   0.969     0.3797 0.396 0.604
#> ERR342839     1   0.961     0.2898 0.616 0.384
#> ERR342906     1   0.000     0.6511 1.000 0.000
#> ERR342905     2   0.973     0.3697 0.404 0.596
#> ERR342816     1   0.000     0.6511 1.000 0.000
#> ERR342865     2   0.969     0.3797 0.396 0.604
#> ERR342824     1   0.983    -0.0135 0.576 0.424
#> ERR342841     2   0.969     0.3797 0.396 0.604
#> ERR342835     1   0.961     0.2898 0.616 0.384
#> ERR342899     2   0.973     0.3697 0.404 0.596
#> ERR342829     2   0.958     0.1938 0.380 0.620
#> ERR342850     1   0.000     0.6511 1.000 0.000
#> ERR342849     2   0.973     0.3697 0.404 0.596
#> ERR342811     1   0.000     0.6511 1.000 0.000
#> ERR342837     1   0.961     0.2898 0.616 0.384
#> ERR342857     1   0.000     0.6511 1.000 0.000
#> ERR342869     1   0.000     0.6511 1.000 0.000
#> ERR342903     2   0.958     0.1938 0.380 0.620
#> ERR342819     1   0.961     0.2898 0.616 0.384
#> ERR342885     2   1.000     0.1184 0.488 0.512
#> ERR342889     2   0.969     0.3797 0.396 0.604
#> ERR342864     1   0.000     0.6511 1.000 0.000
#> ERR342860     2   0.973     0.3697 0.404 0.596
#> ERR342808     1   0.000     0.6511 1.000 0.000
#> ERR342823     1   0.983    -0.0135 0.576 0.424
#> ERR342907     2   0.969     0.3797 0.396 0.604
#> ERR342852     1   0.000     0.6511 1.000 0.000
#> ERR342832     2   0.969     0.3797 0.396 0.604
#> ERR342868     1   0.961     0.2898 0.616 0.384
#> ERR342821     1   0.000     0.6511 1.000 0.000
#> ERR342878     2   0.969     0.3797 0.396 0.604
#> ERR342876     2   0.958     0.1938 0.380 0.620
#> ERR342809     2   0.958     0.1938 0.380 0.620
#> ERR342846     2   1.000     0.1184 0.488 0.512
#> ERR342872     2   0.969     0.3797 0.396 0.604
#> ERR342828     2   0.969     0.3797 0.396 0.604
#> ERR342840     1   0.961     0.2898 0.616 0.384
#> ERR342831     1   0.961     0.2898 0.616 0.384
#> ERR342818     1   0.000     0.6511 1.000 0.000
#> ERR342862     1   0.961     0.2898 0.616 0.384
#> ERR342894     1   0.961     0.2898 0.616 0.384
#> ERR342884     2   0.969     0.3797 0.396 0.604
#> ERR342891     2   0.958     0.1938 0.380 0.620
#> ERR342890     1   0.961     0.2898 0.616 0.384
#> ERR342836     2   0.969     0.3797 0.396 0.604
#> ERR342879     1   0.000     0.6511 1.000 0.000
#> ERR342848     1   0.000     0.6511 1.000 0.000
#> ERR342861     2   0.958     0.1938 0.380 0.620
#> ERR342814     2   0.973     0.3697 0.404 0.596
#> ERR342870     1   0.000     0.6511 1.000 0.000
#> ERR342901     2   0.958     0.1938 0.380 0.620
#> ERR342908     1   0.000     0.6511 1.000 0.000
#> ERR342815     2   0.969     0.3797 0.396 0.604
#> ERR342897     2   1.000     0.1184 0.488 0.512
#> ERR342833     2   0.969     0.3797 0.396 0.604
#> ERR342817     2   1.000     0.1184 0.488 0.512
#> ERR342810     2   0.973     0.3697 0.404 0.596
#> ERR342867     1   0.000     0.6511 1.000 0.000
#> ERR342847     1   0.961     0.2898 0.616 0.384
#> ERR342855     2   0.958     0.1938 0.380 0.620
#> ERR342851     1   0.000     0.6511 1.000 0.000
#> ERR342813     1   0.961     0.2898 0.616 0.384
#> ERR342883     1   0.000     0.6511 1.000 0.000
#> ERR342856     2   1.000     0.1184 0.488 0.512
#> ERR342822     2   0.969     0.3797 0.396 0.604
#> ERR342892     2   0.958     0.1938 0.380 0.620
#> ERR342842     2   0.958     0.1938 0.380 0.620
#> ERR342902     2   0.969     0.3797 0.396 0.604
#> ERR342900     2   0.973     0.3697 0.404 0.596
#> ERR342888     1   0.961     0.2898 0.616 0.384
#> ERR342812     2   0.958     0.1938 0.380 0.620
#> ERR342853     2   0.973     0.3697 0.404 0.596
#> ERR342866     1   0.961     0.2898 0.616 0.384
#> ERR342820     1   0.000     0.6511 1.000 0.000
#> ERR342895     2   0.958     0.1938 0.380 0.620
#> ERR342825     2   1.000     0.1184 0.488 0.512
#> ERR342826     2   1.000     0.1184 0.488 0.512
#> ERR342875     2   0.969     0.3797 0.396 0.604
#> ERR342834     2   1.000     0.1184 0.488 0.512
#> ERR342898     1   0.000     0.6511 1.000 0.000
#> ERR342886     2   0.973     0.3697 0.404 0.596
#> ERR342838     2   0.958     0.1938 0.380 0.620
#> ERR342882     2   0.958     0.1938 0.380 0.620
#> ERR342807     2   0.969     0.3797 0.396 0.604
#> ERR342873     1   0.000     0.6511 1.000 0.000
#> ERR342844     1   0.000     0.6511 1.000 0.000
#> ERR342874     1   0.961     0.2898 0.616 0.384
#> ERR342893     1   0.000     0.6511 1.000 0.000
#> ERR342859     2   1.000     0.1184 0.488 0.512
#> ERR342830     2   0.973     0.3697 0.404 0.596
#> ERR342880     1   0.000     0.6511 1.000 0.000
#> ERR342887     2   0.958     0.1938 0.380 0.620
#> ERR342854     2   0.958     0.1938 0.380 0.620
#> ERR342904     1   0.000     0.6511 1.000 0.000
#> ERR342881     1   0.961     0.2898 0.616 0.384
#> ERR342858     1   0.000     0.6511 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     2   0.658      0.304 0.420 0.572 0.008
#> ERR342843     2   0.658      0.304 0.420 0.572 0.008
#> ERR342896     3   0.000      0.983 0.000 0.000 1.000
#> ERR342827     2   0.347      0.693 0.056 0.904 0.040
#> ERR342871     1   0.635      0.926 0.768 0.140 0.092
#> ERR342863     2   0.456      0.669 0.112 0.852 0.036
#> ERR342839     2   0.658      0.304 0.420 0.572 0.008
#> ERR342906     1   0.643      0.927 0.764 0.140 0.096
#> ERR342905     2   0.437      0.682 0.096 0.864 0.040
#> ERR342816     1   0.643      0.927 0.764 0.140 0.096
#> ERR342865     2   0.456      0.669 0.112 0.852 0.036
#> ERR342824     3   0.375      0.836 0.020 0.096 0.884
#> ERR342841     2   0.347      0.693 0.056 0.904 0.040
#> ERR342835     2   0.930      0.170 0.376 0.460 0.164
#> ERR342899     2   0.437      0.682 0.096 0.864 0.040
#> ERR342829     3   0.000      0.983 0.000 0.000 1.000
#> ERR342850     1   0.635      0.926 0.768 0.140 0.092
#> ERR342849     2   0.437      0.682 0.096 0.864 0.040
#> ERR342811     1   0.635      0.926 0.768 0.140 0.092
#> ERR342837     2   0.930      0.170 0.376 0.460 0.164
#> ERR342857     1   0.643      0.927 0.764 0.140 0.096
#> ERR342869     1   0.635      0.926 0.768 0.140 0.092
#> ERR342903     3   0.000      0.983 0.000 0.000 1.000
#> ERR342819     2   0.930      0.170 0.376 0.460 0.164
#> ERR342885     2   0.478      0.629 0.200 0.796 0.004
#> ERR342889     2   0.456      0.669 0.112 0.852 0.036
#> ERR342864     1   0.643      0.927 0.764 0.140 0.096
#> ERR342860     2   0.437      0.682 0.096 0.864 0.040
#> ERR342808     1   0.635      0.926 0.768 0.140 0.092
#> ERR342823     3   0.375      0.836 0.020 0.096 0.884
#> ERR342907     2   0.347      0.693 0.056 0.904 0.040
#> ERR342852     1   0.643      0.927 0.764 0.140 0.096
#> ERR342832     2   0.456      0.669 0.112 0.852 0.036
#> ERR342868     2   0.658      0.304 0.420 0.572 0.008
#> ERR342821     1   0.643      0.927 0.764 0.140 0.096
#> ERR342878     2   0.347      0.693 0.056 0.904 0.040
#> ERR342876     3   0.000      0.983 0.000 0.000 1.000
#> ERR342809     3   0.000      0.983 0.000 0.000 1.000
#> ERR342846     2   0.478      0.629 0.200 0.796 0.004
#> ERR342872     2   0.347      0.693 0.056 0.904 0.040
#> ERR342828     2   0.456      0.669 0.112 0.852 0.036
#> ERR342840     2   0.930      0.170 0.376 0.460 0.164
#> ERR342831     2   0.658      0.304 0.420 0.572 0.008
#> ERR342818     1   0.797      0.857 0.656 0.140 0.204
#> ERR342862     2   0.930      0.170 0.376 0.460 0.164
#> ERR342894     2   0.658      0.304 0.420 0.572 0.008
#> ERR342884     2   0.347      0.693 0.056 0.904 0.040
#> ERR342891     3   0.000      0.983 0.000 0.000 1.000
#> ERR342890     2   0.658      0.304 0.420 0.572 0.008
#> ERR342836     2   0.456      0.669 0.112 0.852 0.036
#> ERR342879     1   0.797      0.857 0.656 0.140 0.204
#> ERR342848     1   0.815      0.855 0.640 0.144 0.216
#> ERR342861     3   0.000      0.983 0.000 0.000 1.000
#> ERR342814     2   0.437      0.682 0.096 0.864 0.040
#> ERR342870     1   0.635      0.926 0.768 0.140 0.092
#> ERR342901     3   0.000      0.983 0.000 0.000 1.000
#> ERR342908     1   0.635      0.926 0.768 0.140 0.092
#> ERR342815     2   0.456      0.669 0.112 0.852 0.036
#> ERR342897     2   0.478      0.629 0.200 0.796 0.004
#> ERR342833     2   0.347      0.693 0.056 0.904 0.040
#> ERR342817     2   0.478      0.629 0.200 0.796 0.004
#> ERR342810     2   0.437      0.682 0.096 0.864 0.040
#> ERR342867     1   0.643      0.927 0.764 0.140 0.096
#> ERR342847     2   0.930      0.170 0.376 0.460 0.164
#> ERR342855     3   0.000      0.983 0.000 0.000 1.000
#> ERR342851     1   0.797      0.857 0.656 0.140 0.204
#> ERR342813     2   0.658      0.304 0.420 0.572 0.008
#> ERR342883     1   0.797      0.857 0.656 0.140 0.204
#> ERR342856     2   0.478      0.629 0.200 0.796 0.004
#> ERR342822     2   0.456      0.669 0.112 0.852 0.036
#> ERR342892     3   0.000      0.983 0.000 0.000 1.000
#> ERR342842     3   0.000      0.983 0.000 0.000 1.000
#> ERR342902     2   0.347      0.693 0.056 0.904 0.040
#> ERR342900     2   0.437      0.682 0.096 0.864 0.040
#> ERR342888     2   0.658      0.304 0.420 0.572 0.008
#> ERR342812     3   0.000      0.983 0.000 0.000 1.000
#> ERR342853     2   0.437      0.682 0.096 0.864 0.040
#> ERR342866     2   0.930      0.170 0.376 0.460 0.164
#> ERR342820     1   0.635      0.926 0.768 0.140 0.092
#> ERR342895     3   0.000      0.983 0.000 0.000 1.000
#> ERR342825     2   0.478      0.629 0.200 0.796 0.004
#> ERR342826     2   0.478      0.629 0.200 0.796 0.004
#> ERR342875     2   0.456      0.669 0.112 0.852 0.036
#> ERR342834     2   0.478      0.629 0.200 0.796 0.004
#> ERR342898     1   0.643      0.927 0.764 0.140 0.096
#> ERR342886     2   0.437      0.682 0.096 0.864 0.040
#> ERR342838     3   0.000      0.983 0.000 0.000 1.000
#> ERR342882     3   0.000      0.983 0.000 0.000 1.000
#> ERR342807     2   0.347      0.693 0.056 0.904 0.040
#> ERR342873     1   0.797      0.857 0.656 0.140 0.204
#> ERR342844     1   0.643      0.927 0.764 0.140 0.096
#> ERR342874     2   0.930      0.170 0.376 0.460 0.164
#> ERR342893     1   0.797      0.857 0.656 0.140 0.204
#> ERR342859     2   0.478      0.629 0.200 0.796 0.004
#> ERR342830     2   0.437      0.682 0.096 0.864 0.040
#> ERR342880     1   0.797      0.857 0.656 0.140 0.204
#> ERR342887     3   0.000      0.983 0.000 0.000 1.000
#> ERR342854     3   0.000      0.983 0.000 0.000 1.000
#> ERR342904     1   0.635      0.926 0.768 0.140 0.092
#> ERR342881     2   0.930      0.170 0.376 0.460 0.164
#> ERR342858     1   0.797      0.857 0.656 0.140 0.204

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> ERR342845     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342843     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342896     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342827     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342871     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342863     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342839     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342906     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342905     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342816     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342865     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342841     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342835     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342899     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342829     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342850     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342849     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342811     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342837     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342857     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342869     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342903     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342819     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342889     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342864     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342860     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342808     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342823     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342907     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342852     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342832     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342868     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342821     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342878     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342876     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342872     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342828     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342840     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342831     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342818     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342862     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342894     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342884     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342891     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342890     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342836     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342879     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342848     4  0.5578      0.704 0.128 0.144  0 0.728
#> ERR342861     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342814     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342870     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342901     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342908     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342815     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342833     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342810     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342867     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342847     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342855     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342851     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342813     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342883     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342822     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342902     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342900     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342888     2  0.5155      0.360 0.004 0.528  0 0.468
#> ERR342812     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342853     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342866     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342820     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342895     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342875     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342898     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342886     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342838     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342807     2  0.0000      0.730 0.000 1.000  0 0.000
#> ERR342873     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342844     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342874     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342893     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000
#> ERR342830     2  0.1978      0.718 0.004 0.928  0 0.068
#> ERR342880     4  0.4181      0.840 0.128 0.052  0 0.820
#> ERR342887     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000  0 0.000
#> ERR342904     4  0.0188      0.924 0.000 0.004  0 0.996
#> ERR342881     2  0.7143      0.307 0.132 0.460  0 0.408
#> ERR342858     4  0.4181      0.840 0.128 0.052  0 0.820

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2 p3    p4    p5
#> ERR342845     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342843     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342896     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342827     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342871     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342863     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342839     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342906     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342905     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342816     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342865     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342824     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342841     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342835     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342899     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342829     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342850     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342849     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342811     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342837     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342857     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342869     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342903     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342819     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342885     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342889     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342864     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342860     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342808     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342823     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342907     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342852     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342832     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342868     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342821     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342878     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342876     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342809     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342846     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342872     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342828     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342840     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342831     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342818     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342862     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342894     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342884     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342891     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342890     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342836     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342879     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342848     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342861     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342814     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342870     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342901     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342908     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342815     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342897     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342833     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342817     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342810     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342867     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342847     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342855     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342851     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342813     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342883     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342856     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342822     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342892     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342842     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342902     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342900     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342888     5  0.0510    0.65691 0.000 0.000  0 0.016 0.984
#> ERR342812     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342853     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342866     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342820     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342895     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342825     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342826     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342875     2  0.4446    0.55229 0.000 0.592  0 0.008 0.400
#> ERR342834     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342898     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342886     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342838     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342882     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342807     2  0.0000    0.69303 0.000 1.000  0 0.000 0.000
#> ERR342873     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342844     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342874     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342893     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342859     3  0.0000    1.00000 0.000 0.000  1 0.000 0.000
#> ERR342830     5  0.6758   -0.00348 0.000 0.300  0 0.296 0.404
#> ERR342880     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476
#> ERR342887     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342854     1  0.0000    1.00000 1.000 0.000  0 0.000 0.000
#> ERR342904     4  0.3752    0.91611 0.000 0.000  0 0.708 0.292
#> ERR342881     5  0.0609    0.64961 0.000 0.000  0 0.020 0.980
#> ERR342858     4  0.4655    0.81088 0.012 0.000  0 0.512 0.476

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette p1    p2 p3    p4    p5    p6
#> ERR342845     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342843     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342896     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342827     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342871     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342863     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342839     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342906     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342905     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342816     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342865     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342824     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342841     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342835     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342899     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342829     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342850     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342849     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342811     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342837     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342857     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342869     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342903     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342819     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342885     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342889     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342864     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342860     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342808     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342823     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342907     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342852     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342832     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342868     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342821     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342878     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342876     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342809     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342846     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342872     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342828     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342840     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342831     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342818     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342862     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342894     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342884     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342891     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342890     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342836     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342879     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342848     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342861     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342814     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342870     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342901     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342908     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342815     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342897     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342833     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342817     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342810     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342867     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342847     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342855     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342851     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342813     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342883     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342856     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342822     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342892     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342842     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342902     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342900     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342888     5   0.397      0.778  0 0.000  0 0.224 0.728 0.048
#> ERR342812     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342853     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342866     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342820     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342895     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342825     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342826     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342875     2   0.368      0.644  0 0.628  0 0.000 0.000 0.372
#> ERR342834     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342898     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342886     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342838     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342882     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342807     6   0.107      1.000  0 0.048  0 0.000 0.000 0.952
#> ERR342873     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342844     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342874     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342893     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342859     3   0.000      1.000  0 0.000  1 0.000 0.000 0.000
#> ERR342830     2   0.000      0.765  0 1.000  0 0.000 0.000 0.000
#> ERR342880     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000
#> ERR342887     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342854     1   0.000      1.000  1 0.000  0 0.000 0.000 0.000
#> ERR342904     4   0.000      0.810  0 0.000  0 1.000 0.000 0.000
#> ERR342881     5   0.107      0.788  0 0.000  0 0.048 0.952 0.000
#> ERR342858     4   0.383      0.489  0 0.000  0 0.556 0.444 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:NMF*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "NMF"]
# you can also extract it by
# res = res_list["SD:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.919           0.932       0.967         0.4464 0.531   0.531
#> 3 3 0.944           0.970       0.982         0.1979 0.950   0.906
#> 4 4 0.742           0.783       0.857         0.3487 0.755   0.501
#> 5 5 0.876           0.950       0.939         0.0777 0.930   0.742
#> 6 6 0.850           0.815       0.805         0.0478 0.966   0.843

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      1.000 1.000 0.000
#> ERR342843     1   0.000      1.000 1.000 0.000
#> ERR342896     1   0.000      1.000 1.000 0.000
#> ERR342827     2   0.000      0.905 0.000 1.000
#> ERR342871     1   0.000      1.000 1.000 0.000
#> ERR342863     2   0.000      0.905 0.000 1.000
#> ERR342839     1   0.000      1.000 1.000 0.000
#> ERR342906     1   0.000      1.000 1.000 0.000
#> ERR342905     2   0.000      0.905 0.000 1.000
#> ERR342816     1   0.000      1.000 1.000 0.000
#> ERR342865     2   0.000      0.905 0.000 1.000
#> ERR342824     1   0.000      1.000 1.000 0.000
#> ERR342841     2   0.000      0.905 0.000 1.000
#> ERR342835     1   0.000      1.000 1.000 0.000
#> ERR342899     2   0.000      0.905 0.000 1.000
#> ERR342829     1   0.000      1.000 1.000 0.000
#> ERR342850     1   0.000      1.000 1.000 0.000
#> ERR342849     2   0.000      0.905 0.000 1.000
#> ERR342811     1   0.000      1.000 1.000 0.000
#> ERR342837     1   0.000      1.000 1.000 0.000
#> ERR342857     1   0.000      1.000 1.000 0.000
#> ERR342869     1   0.000      1.000 1.000 0.000
#> ERR342903     1   0.000      1.000 1.000 0.000
#> ERR342819     1   0.000      1.000 1.000 0.000
#> ERR342885     2   0.971      0.472 0.400 0.600
#> ERR342889     2   0.000      0.905 0.000 1.000
#> ERR342864     1   0.000      1.000 1.000 0.000
#> ERR342860     2   0.000      0.905 0.000 1.000
#> ERR342808     1   0.000      1.000 1.000 0.000
#> ERR342823     1   0.000      1.000 1.000 0.000
#> ERR342907     2   0.000      0.905 0.000 1.000
#> ERR342852     1   0.000      1.000 1.000 0.000
#> ERR342832     2   0.000      0.905 0.000 1.000
#> ERR342868     1   0.000      1.000 1.000 0.000
#> ERR342821     1   0.000      1.000 1.000 0.000
#> ERR342878     2   0.000      0.905 0.000 1.000
#> ERR342876     1   0.000      1.000 1.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000
#> ERR342846     2   0.891      0.629 0.308 0.692
#> ERR342872     2   0.000      0.905 0.000 1.000
#> ERR342828     2   0.000      0.905 0.000 1.000
#> ERR342840     1   0.000      1.000 1.000 0.000
#> ERR342831     1   0.000      1.000 1.000 0.000
#> ERR342818     1   0.000      1.000 1.000 0.000
#> ERR342862     1   0.000      1.000 1.000 0.000
#> ERR342894     1   0.000      1.000 1.000 0.000
#> ERR342884     2   0.000      0.905 0.000 1.000
#> ERR342891     1   0.000      1.000 1.000 0.000
#> ERR342890     1   0.000      1.000 1.000 0.000
#> ERR342836     2   0.000      0.905 0.000 1.000
#> ERR342879     1   0.000      1.000 1.000 0.000
#> ERR342848     1   0.000      1.000 1.000 0.000
#> ERR342861     1   0.000      1.000 1.000 0.000
#> ERR342814     2   0.000      0.905 0.000 1.000
#> ERR342870     1   0.000      1.000 1.000 0.000
#> ERR342901     1   0.000      1.000 1.000 0.000
#> ERR342908     1   0.000      1.000 1.000 0.000
#> ERR342815     2   0.000      0.905 0.000 1.000
#> ERR342897     2   0.936      0.564 0.352 0.648
#> ERR342833     2   0.000      0.905 0.000 1.000
#> ERR342817     2   0.966      0.490 0.392 0.608
#> ERR342810     2   0.000      0.905 0.000 1.000
#> ERR342867     1   0.000      1.000 1.000 0.000
#> ERR342847     1   0.000      1.000 1.000 0.000
#> ERR342855     1   0.000      1.000 1.000 0.000
#> ERR342851     1   0.000      1.000 1.000 0.000
#> ERR342813     1   0.000      1.000 1.000 0.000
#> ERR342883     1   0.000      1.000 1.000 0.000
#> ERR342856     2   0.929      0.576 0.344 0.656
#> ERR342822     2   0.000      0.905 0.000 1.000
#> ERR342892     1   0.000      1.000 1.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000
#> ERR342902     2   0.000      0.905 0.000 1.000
#> ERR342900     2   0.000      0.905 0.000 1.000
#> ERR342888     1   0.000      1.000 1.000 0.000
#> ERR342812     1   0.000      1.000 1.000 0.000
#> ERR342853     2   0.000      0.905 0.000 1.000
#> ERR342866     1   0.000      1.000 1.000 0.000
#> ERR342820     1   0.000      1.000 1.000 0.000
#> ERR342895     1   0.000      1.000 1.000 0.000
#> ERR342825     2   0.969      0.481 0.396 0.604
#> ERR342826     2   0.952      0.529 0.372 0.628
#> ERR342875     2   0.000      0.905 0.000 1.000
#> ERR342834     2   0.980      0.435 0.416 0.584
#> ERR342898     1   0.000      1.000 1.000 0.000
#> ERR342886     2   0.000      0.905 0.000 1.000
#> ERR342838     1   0.000      1.000 1.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000
#> ERR342807     2   0.000      0.905 0.000 1.000
#> ERR342873     1   0.000      1.000 1.000 0.000
#> ERR342844     1   0.000      1.000 1.000 0.000
#> ERR342874     1   0.000      1.000 1.000 0.000
#> ERR342893     1   0.000      1.000 1.000 0.000
#> ERR342859     2   0.891      0.629 0.308 0.692
#> ERR342830     2   0.000      0.905 0.000 1.000
#> ERR342880     1   0.000      1.000 1.000 0.000
#> ERR342887     1   0.000      1.000 1.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000
#> ERR342904     1   0.000      1.000 1.000 0.000
#> ERR342881     1   0.000      1.000 1.000 0.000
#> ERR342858     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.3267      0.883 0.884 0.000 0.116
#> ERR342843     1  0.4931      0.744 0.768 0.000 0.232
#> ERR342896     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342827     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342871     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342863     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342839     1  0.3551      0.868 0.868 0.000 0.132
#> ERR342906     1  0.0592      0.968 0.988 0.000 0.012
#> ERR342905     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342816     1  0.0424      0.971 0.992 0.000 0.008
#> ERR342865     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342824     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342841     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342835     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342899     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342829     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342850     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342849     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342811     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342837     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342857     1  0.1529      0.949 0.960 0.000 0.040
#> ERR342869     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342903     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342819     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342885     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342889     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342864     1  0.0424      0.971 0.992 0.000 0.008
#> ERR342860     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342808     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342823     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342907     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342852     1  0.0747      0.966 0.984 0.000 0.016
#> ERR342832     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342868     1  0.4555      0.789 0.800 0.000 0.200
#> ERR342821     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342878     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342876     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342809     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342846     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342872     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342828     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342840     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342831     1  0.3192      0.887 0.888 0.000 0.112
#> ERR342818     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342862     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342894     1  0.4121      0.829 0.832 0.000 0.168
#> ERR342884     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342891     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342890     1  0.3412      0.876 0.876 0.000 0.124
#> ERR342836     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342879     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342848     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342861     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342814     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342870     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342901     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342908     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342815     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342897     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342833     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342817     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342810     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342867     1  0.0424      0.971 0.992 0.000 0.008
#> ERR342847     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342855     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342851     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342813     1  0.4291      0.815 0.820 0.000 0.180
#> ERR342883     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342856     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342822     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342892     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342842     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342902     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342900     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342888     1  0.4346      0.810 0.816 0.000 0.184
#> ERR342812     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342853     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342866     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342820     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342895     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342825     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342826     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342875     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342834     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342898     1  0.0424      0.971 0.992 0.000 0.008
#> ERR342886     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342838     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342882     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342807     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342873     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342844     1  0.0892      0.964 0.980 0.000 0.020
#> ERR342874     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342893     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342859     3  0.0237      1.000 0.000 0.004 0.996
#> ERR342830     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342880     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342887     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342854     1  0.0424      0.972 0.992 0.000 0.008
#> ERR342904     1  0.0237      0.972 0.996 0.000 0.004
#> ERR342881     1  0.0000      0.973 1.000 0.000 0.000
#> ERR342858     1  0.0000      0.973 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     1  0.7830     -0.179 0.404 0.000 0.324 0.272
#> ERR342843     3  0.7806      0.313 0.332 0.000 0.408 0.260
#> ERR342896     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342827     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342871     4  0.1733      0.946 0.028 0.000 0.024 0.948
#> ERR342863     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342839     3  0.7844      0.221 0.368 0.000 0.368 0.264
#> ERR342906     4  0.2376      0.923 0.016 0.000 0.068 0.916
#> ERR342905     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342816     4  0.2222      0.929 0.016 0.000 0.060 0.924
#> ERR342865     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342824     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342841     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342835     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342899     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342829     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342850     4  0.1733      0.946 0.028 0.000 0.024 0.948
#> ERR342849     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342811     4  0.1677      0.943 0.040 0.000 0.012 0.948
#> ERR342837     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342857     4  0.2611      0.889 0.008 0.000 0.096 0.896
#> ERR342869     4  0.1936      0.945 0.028 0.000 0.032 0.940
#> ERR342903     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342819     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342885     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342889     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342864     4  0.1798      0.938 0.016 0.000 0.040 0.944
#> ERR342860     2  0.0469      0.987 0.012 0.988 0.000 0.000
#> ERR342808     4  0.1854      0.939 0.048 0.000 0.012 0.940
#> ERR342823     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342907     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342852     4  0.2255      0.919 0.012 0.000 0.068 0.920
#> ERR342832     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342868     3  0.7818      0.310 0.332 0.000 0.404 0.264
#> ERR342821     4  0.1798      0.941 0.016 0.000 0.040 0.944
#> ERR342878     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342876     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342809     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342846     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342872     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342828     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342840     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342831     1  0.7811     -0.163 0.412 0.000 0.320 0.268
#> ERR342818     4  0.1118      0.933 0.036 0.000 0.000 0.964
#> ERR342862     1  0.5587      0.485 0.600 0.000 0.028 0.372
#> ERR342894     3  0.7824      0.283 0.348 0.000 0.392 0.260
#> ERR342884     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342891     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342890     1  0.7835     -0.210 0.396 0.000 0.336 0.268
#> ERR342836     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342879     4  0.1211      0.932 0.040 0.000 0.000 0.960
#> ERR342848     4  0.1211      0.933 0.040 0.000 0.000 0.960
#> ERR342861     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342814     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342870     4  0.1733      0.946 0.028 0.000 0.024 0.948
#> ERR342901     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342908     4  0.1854      0.939 0.048 0.000 0.012 0.940
#> ERR342815     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342897     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342833     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342817     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342810     2  0.0336      0.989 0.008 0.992 0.000 0.000
#> ERR342867     4  0.1938      0.932 0.012 0.000 0.052 0.936
#> ERR342847     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342855     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342851     4  0.1211      0.932 0.040 0.000 0.000 0.960
#> ERR342813     3  0.7824      0.283 0.348 0.000 0.392 0.260
#> ERR342883     4  0.1118      0.933 0.036 0.000 0.000 0.964
#> ERR342856     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342822     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342892     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342842     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342902     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342900     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342888     3  0.7818      0.310 0.332 0.000 0.404 0.264
#> ERR342812     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342853     2  0.0188      0.991 0.004 0.996 0.000 0.000
#> ERR342866     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342820     4  0.1733      0.946 0.028 0.000 0.024 0.948
#> ERR342895     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342825     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342826     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342875     2  0.0000      0.992 0.000 1.000 0.000 0.000
#> ERR342834     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342898     4  0.2179      0.923 0.012 0.000 0.064 0.924
#> ERR342886     2  0.0469      0.987 0.012 0.988 0.000 0.000
#> ERR342838     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342882     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342807     2  0.0804      0.987 0.012 0.980 0.000 0.008
#> ERR342873     4  0.1118      0.933 0.036 0.000 0.000 0.964
#> ERR342844     4  0.2480      0.899 0.008 0.000 0.088 0.904
#> ERR342874     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342893     4  0.1211      0.932 0.040 0.000 0.000 0.960
#> ERR342859     3  0.0921      0.714 0.000 0.000 0.972 0.028
#> ERR342830     2  0.0469      0.987 0.012 0.988 0.000 0.000
#> ERR342880     4  0.1211      0.932 0.040 0.000 0.000 0.960
#> ERR342887     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342854     1  0.2408      0.746 0.896 0.000 0.000 0.104
#> ERR342904     4  0.1820      0.945 0.036 0.000 0.020 0.944
#> ERR342881     1  0.5573      0.490 0.604 0.000 0.028 0.368
#> ERR342858     4  0.1118      0.933 0.036 0.000 0.000 0.964

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.4774      0.876 0.036 0.000 0.068 0.128 0.768
#> ERR342843     5  0.4789      0.873 0.036 0.000 0.072 0.124 0.768
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342871     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342863     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5  0.4774      0.876 0.036 0.000 0.068 0.128 0.768
#> ERR342906     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342905     2  0.2020      0.903 0.000 0.900 0.000 0.000 0.100
#> ERR342816     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342865     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342835     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342899     2  0.1197      0.932 0.000 0.952 0.000 0.000 0.048
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342849     2  0.1121      0.933 0.000 0.956 0.000 0.000 0.044
#> ERR342811     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342837     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342857     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342869     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342885     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342889     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342860     2  0.1851      0.909 0.000 0.912 0.000 0.000 0.088
#> ERR342808     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342852     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342832     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342868     5  0.4774      0.876 0.036 0.000 0.068 0.128 0.768
#> ERR342821     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342878     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342872     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342828     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342831     5  0.4774      0.876 0.036 0.000 0.068 0.128 0.768
#> ERR342818     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342862     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342894     5  0.4789      0.873 0.036 0.000 0.072 0.124 0.768
#> ERR342884     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.4788      0.876 0.040 0.000 0.064 0.128 0.768
#> ERR342836     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342879     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342848     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.1270      0.930 0.000 0.948 0.000 0.000 0.052
#> ERR342870     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342815     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342833     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342810     2  0.2074      0.899 0.000 0.896 0.000 0.000 0.104
#> ERR342867     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342847     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342813     5  0.4789      0.873 0.036 0.000 0.072 0.124 0.768
#> ERR342883     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342856     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342822     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342900     2  0.1043      0.934 0.000 0.960 0.000 0.000 0.040
#> ERR342888     5  0.4774      0.876 0.036 0.000 0.068 0.128 0.768
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.1197      0.932 0.000 0.952 0.000 0.000 0.048
#> ERR342866     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342820     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342875     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342898     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342886     2  0.1908      0.907 0.000 0.908 0.000 0.000 0.092
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.2127      0.916 0.000 0.892 0.000 0.000 0.108
#> ERR342873     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342844     4  0.0290      0.975 0.000 0.000 0.000 0.992 0.008
#> ERR342874     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342893     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342859     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> ERR342830     2  0.1792      0.912 0.000 0.916 0.000 0.000 0.084
#> ERR342880     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.0404      0.975 0.000 0.000 0.000 0.988 0.012
#> ERR342881     5  0.4025      0.882 0.076 0.000 0.000 0.132 0.792
#> ERR342858     4  0.1043      0.961 0.000 0.000 0.000 0.960 0.040

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342843     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342871     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342863     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342839     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342906     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342905     2  0.2058      0.582 0.000 0.908 0.000 0.008 0.012 0.072
#> ERR342816     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342865     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342835     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342899     2  0.1065      0.637 0.000 0.964 0.000 0.008 0.008 0.020
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342849     2  0.0622      0.634 0.000 0.980 0.000 0.008 0.000 0.012
#> ERR342811     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342837     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342857     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342869     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342885     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342889     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342864     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342860     2  0.0984      0.637 0.000 0.968 0.000 0.008 0.012 0.012
#> ERR342808     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342852     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342832     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342868     5  0.0964      0.679 0.000 0.000 0.016 0.012 0.968 0.004
#> ERR342821     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342878     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342872     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342828     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342840     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342831     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342818     4  0.2573      0.862 0.000 0.012 0.000 0.872 0.012 0.104
#> ERR342862     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342894     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342884     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342836     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342879     4  0.2525      0.863 0.000 0.012 0.000 0.876 0.012 0.100
#> ERR342848     4  0.2620      0.859 0.000 0.012 0.000 0.868 0.012 0.108
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.0862      0.639 0.000 0.972 0.000 0.008 0.004 0.016
#> ERR342870     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342815     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342897     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342833     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342810     2  0.2114      0.577 0.000 0.904 0.000 0.008 0.012 0.076
#> ERR342867     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342847     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.2620      0.859 0.000 0.012 0.000 0.868 0.012 0.108
#> ERR342813     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342883     4  0.2525      0.863 0.000 0.012 0.000 0.876 0.012 0.100
#> ERR342856     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342822     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342900     2  0.0622      0.634 0.000 0.980 0.000 0.008 0.000 0.012
#> ERR342888     5  0.0820      0.682 0.000 0.000 0.016 0.012 0.972 0.000
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.1268      0.630 0.000 0.952 0.000 0.008 0.004 0.036
#> ERR342866     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342820     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342875     2  0.3076      0.376 0.000 0.760 0.000 0.000 0.000 0.240
#> ERR342834     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342898     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342886     2  0.1577      0.620 0.000 0.940 0.000 0.008 0.016 0.036
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     6  0.3866      1.000 0.000 0.484 0.000 0.000 0.000 0.516
#> ERR342873     4  0.2573      0.862 0.000 0.012 0.000 0.872 0.012 0.104
#> ERR342844     4  0.0653      0.890 0.000 0.004 0.000 0.980 0.004 0.012
#> ERR342874     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342893     4  0.2573      0.862 0.000 0.012 0.000 0.872 0.012 0.104
#> ERR342859     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342830     2  0.1251      0.633 0.000 0.956 0.000 0.008 0.012 0.024
#> ERR342880     4  0.2573      0.862 0.000 0.012 0.000 0.872 0.012 0.104
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.3139      0.844 0.000 0.000 0.000 0.816 0.032 0.152
#> ERR342881     5  0.6874      0.692 0.016 0.236 0.000 0.032 0.444 0.272
#> ERR342858     4  0.2525      0.863 0.000 0.012 0.000 0.876 0.012 0.100

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:hclust**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "hclust"]
# you can also extract it by
# res = res_list["CV:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.531           0.953       0.918         0.3516 0.595   0.595
#> 3 3 1.000           1.000       1.000         0.4770 0.886   0.808
#> 4 4 1.000           0.978       0.979         0.2030 0.902   0.796
#> 5 5 0.852           0.894       0.946         0.1763 0.868   0.656
#> 6 6 0.868           0.921       0.925         0.0573 0.984   0.936

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3

There is also optional best \(k\) = 3 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      0.964 1.000 0.000
#> ERR342843     1   0.000      0.964 1.000 0.000
#> ERR342896     1   0.000      0.964 1.000 0.000
#> ERR342827     2   0.767      1.000 0.224 0.776
#> ERR342871     1   0.000      0.964 1.000 0.000
#> ERR342863     2   0.767      1.000 0.224 0.776
#> ERR342839     1   0.000      0.964 1.000 0.000
#> ERR342906     1   0.000      0.964 1.000 0.000
#> ERR342905     2   0.767      1.000 0.224 0.776
#> ERR342816     1   0.000      0.964 1.000 0.000
#> ERR342865     2   0.767      1.000 0.224 0.776
#> ERR342824     1   0.000      0.964 1.000 0.000
#> ERR342841     2   0.767      1.000 0.224 0.776
#> ERR342835     1   0.000      0.964 1.000 0.000
#> ERR342899     2   0.767      1.000 0.224 0.776
#> ERR342829     1   0.000      0.964 1.000 0.000
#> ERR342850     1   0.000      0.964 1.000 0.000
#> ERR342849     2   0.767      1.000 0.224 0.776
#> ERR342811     1   0.000      0.964 1.000 0.000
#> ERR342837     1   0.000      0.964 1.000 0.000
#> ERR342857     1   0.000      0.964 1.000 0.000
#> ERR342869     1   0.000      0.964 1.000 0.000
#> ERR342903     1   0.000      0.964 1.000 0.000
#> ERR342819     1   0.000      0.964 1.000 0.000
#> ERR342885     1   0.767      0.734 0.776 0.224
#> ERR342889     2   0.767      1.000 0.224 0.776
#> ERR342864     1   0.000      0.964 1.000 0.000
#> ERR342860     2   0.767      1.000 0.224 0.776
#> ERR342808     1   0.000      0.964 1.000 0.000
#> ERR342823     1   0.000      0.964 1.000 0.000
#> ERR342907     2   0.767      1.000 0.224 0.776
#> ERR342852     1   0.000      0.964 1.000 0.000
#> ERR342832     2   0.767      1.000 0.224 0.776
#> ERR342868     1   0.000      0.964 1.000 0.000
#> ERR342821     1   0.000      0.964 1.000 0.000
#> ERR342878     2   0.767      1.000 0.224 0.776
#> ERR342876     1   0.000      0.964 1.000 0.000
#> ERR342809     1   0.000      0.964 1.000 0.000
#> ERR342846     1   0.767      0.734 0.776 0.224
#> ERR342872     2   0.767      1.000 0.224 0.776
#> ERR342828     2   0.767      1.000 0.224 0.776
#> ERR342840     1   0.000      0.964 1.000 0.000
#> ERR342831     1   0.000      0.964 1.000 0.000
#> ERR342818     1   0.000      0.964 1.000 0.000
#> ERR342862     1   0.000      0.964 1.000 0.000
#> ERR342894     1   0.000      0.964 1.000 0.000
#> ERR342884     2   0.767      1.000 0.224 0.776
#> ERR342891     1   0.000      0.964 1.000 0.000
#> ERR342890     1   0.000      0.964 1.000 0.000
#> ERR342836     2   0.767      1.000 0.224 0.776
#> ERR342879     1   0.000      0.964 1.000 0.000
#> ERR342848     1   0.000      0.964 1.000 0.000
#> ERR342861     1   0.000      0.964 1.000 0.000
#> ERR342814     2   0.767      1.000 0.224 0.776
#> ERR342870     1   0.000      0.964 1.000 0.000
#> ERR342901     1   0.000      0.964 1.000 0.000
#> ERR342908     1   0.000      0.964 1.000 0.000
#> ERR342815     2   0.767      1.000 0.224 0.776
#> ERR342897     1   0.767      0.734 0.776 0.224
#> ERR342833     2   0.767      1.000 0.224 0.776
#> ERR342817     1   0.767      0.734 0.776 0.224
#> ERR342810     2   0.767      1.000 0.224 0.776
#> ERR342867     1   0.000      0.964 1.000 0.000
#> ERR342847     1   0.000      0.964 1.000 0.000
#> ERR342855     1   0.000      0.964 1.000 0.000
#> ERR342851     1   0.000      0.964 1.000 0.000
#> ERR342813     1   0.000      0.964 1.000 0.000
#> ERR342883     1   0.000      0.964 1.000 0.000
#> ERR342856     1   0.767      0.734 0.776 0.224
#> ERR342822     2   0.767      1.000 0.224 0.776
#> ERR342892     1   0.000      0.964 1.000 0.000
#> ERR342842     1   0.000      0.964 1.000 0.000
#> ERR342902     2   0.767      1.000 0.224 0.776
#> ERR342900     2   0.767      1.000 0.224 0.776
#> ERR342888     1   0.000      0.964 1.000 0.000
#> ERR342812     1   0.000      0.964 1.000 0.000
#> ERR342853     2   0.767      1.000 0.224 0.776
#> ERR342866     1   0.000      0.964 1.000 0.000
#> ERR342820     1   0.000      0.964 1.000 0.000
#> ERR342895     1   0.000      0.964 1.000 0.000
#> ERR342825     1   0.767      0.734 0.776 0.224
#> ERR342826     1   0.767      0.734 0.776 0.224
#> ERR342875     2   0.767      1.000 0.224 0.776
#> ERR342834     1   0.767      0.734 0.776 0.224
#> ERR342898     1   0.000      0.964 1.000 0.000
#> ERR342886     2   0.767      1.000 0.224 0.776
#> ERR342838     1   0.000      0.964 1.000 0.000
#> ERR342882     1   0.000      0.964 1.000 0.000
#> ERR342807     2   0.767      1.000 0.224 0.776
#> ERR342873     1   0.000      0.964 1.000 0.000
#> ERR342844     1   0.000      0.964 1.000 0.000
#> ERR342874     1   0.000      0.964 1.000 0.000
#> ERR342893     1   0.000      0.964 1.000 0.000
#> ERR342859     1   0.767      0.734 0.776 0.224
#> ERR342830     2   0.767      1.000 0.224 0.776
#> ERR342880     1   0.000      0.964 1.000 0.000
#> ERR342887     1   0.000      0.964 1.000 0.000
#> ERR342854     1   0.000      0.964 1.000 0.000
#> ERR342904     1   0.000      0.964 1.000 0.000
#> ERR342881     1   0.000      0.964 1.000 0.000
#> ERR342858     1   0.000      0.964 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette p1 p2 p3
#> ERR342845     1       0          1  1  0  0
#> ERR342843     1       0          1  1  0  0
#> ERR342896     1       0          1  1  0  0
#> ERR342827     2       0          1  0  1  0
#> ERR342871     1       0          1  1  0  0
#> ERR342863     2       0          1  0  1  0
#> ERR342839     1       0          1  1  0  0
#> ERR342906     1       0          1  1  0  0
#> ERR342905     2       0          1  0  1  0
#> ERR342816     1       0          1  1  0  0
#> ERR342865     2       0          1  0  1  0
#> ERR342824     1       0          1  1  0  0
#> ERR342841     2       0          1  0  1  0
#> ERR342835     1       0          1  1  0  0
#> ERR342899     2       0          1  0  1  0
#> ERR342829     1       0          1  1  0  0
#> ERR342850     1       0          1  1  0  0
#> ERR342849     2       0          1  0  1  0
#> ERR342811     1       0          1  1  0  0
#> ERR342837     1       0          1  1  0  0
#> ERR342857     1       0          1  1  0  0
#> ERR342869     1       0          1  1  0  0
#> ERR342903     1       0          1  1  0  0
#> ERR342819     1       0          1  1  0  0
#> ERR342885     3       0          1  0  0  1
#> ERR342889     2       0          1  0  1  0
#> ERR342864     1       0          1  1  0  0
#> ERR342860     2       0          1  0  1  0
#> ERR342808     1       0          1  1  0  0
#> ERR342823     1       0          1  1  0  0
#> ERR342907     2       0          1  0  1  0
#> ERR342852     1       0          1  1  0  0
#> ERR342832     2       0          1  0  1  0
#> ERR342868     1       0          1  1  0  0
#> ERR342821     1       0          1  1  0  0
#> ERR342878     2       0          1  0  1  0
#> ERR342876     1       0          1  1  0  0
#> ERR342809     1       0          1  1  0  0
#> ERR342846     3       0          1  0  0  1
#> ERR342872     2       0          1  0  1  0
#> ERR342828     2       0          1  0  1  0
#> ERR342840     1       0          1  1  0  0
#> ERR342831     1       0          1  1  0  0
#> ERR342818     1       0          1  1  0  0
#> ERR342862     1       0          1  1  0  0
#> ERR342894     1       0          1  1  0  0
#> ERR342884     2       0          1  0  1  0
#> ERR342891     1       0          1  1  0  0
#> ERR342890     1       0          1  1  0  0
#> ERR342836     2       0          1  0  1  0
#> ERR342879     1       0          1  1  0  0
#> ERR342848     1       0          1  1  0  0
#> ERR342861     1       0          1  1  0  0
#> ERR342814     2       0          1  0  1  0
#> ERR342870     1       0          1  1  0  0
#> ERR342901     1       0          1  1  0  0
#> ERR342908     1       0          1  1  0  0
#> ERR342815     2       0          1  0  1  0
#> ERR342897     3       0          1  0  0  1
#> ERR342833     2       0          1  0  1  0
#> ERR342817     3       0          1  0  0  1
#> ERR342810     2       0          1  0  1  0
#> ERR342867     1       0          1  1  0  0
#> ERR342847     1       0          1  1  0  0
#> ERR342855     1       0          1  1  0  0
#> ERR342851     1       0          1  1  0  0
#> ERR342813     1       0          1  1  0  0
#> ERR342883     1       0          1  1  0  0
#> ERR342856     3       0          1  0  0  1
#> ERR342822     2       0          1  0  1  0
#> ERR342892     1       0          1  1  0  0
#> ERR342842     1       0          1  1  0  0
#> ERR342902     2       0          1  0  1  0
#> ERR342900     2       0          1  0  1  0
#> ERR342888     1       0          1  1  0  0
#> ERR342812     1       0          1  1  0  0
#> ERR342853     2       0          1  0  1  0
#> ERR342866     1       0          1  1  0  0
#> ERR342820     1       0          1  1  0  0
#> ERR342895     1       0          1  1  0  0
#> ERR342825     3       0          1  0  0  1
#> ERR342826     3       0          1  0  0  1
#> ERR342875     2       0          1  0  1  0
#> ERR342834     3       0          1  0  0  1
#> ERR342898     1       0          1  1  0  0
#> ERR342886     2       0          1  0  1  0
#> ERR342838     1       0          1  1  0  0
#> ERR342882     1       0          1  1  0  0
#> ERR342807     2       0          1  0  1  0
#> ERR342873     1       0          1  1  0  0
#> ERR342844     1       0          1  1  0  0
#> ERR342874     1       0          1  1  0  0
#> ERR342893     1       0          1  1  0  0
#> ERR342859     3       0          1  0  0  1
#> ERR342830     2       0          1  0  1  0
#> ERR342880     1       0          1  1  0  0
#> ERR342887     1       0          1  1  0  0
#> ERR342854     1       0          1  1  0  0
#> ERR342904     1       0          1  1  0  0
#> ERR342881     1       0          1  1  0  0
#> ERR342858     1       0          1  1  0  0

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1 p2 p3    p4
#> ERR342845     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342843     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342896     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342827     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342871     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342863     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342839     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342906     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342905     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342816     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342865     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342824     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342841     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342835     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342899     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342829     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342850     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342849     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342811     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342837     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342857     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342869     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342903     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342819     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342885     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342889     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342864     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342860     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342808     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342823     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342907     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342852     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342832     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342868     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342821     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342878     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342876     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342809     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342846     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342872     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342828     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342840     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342831     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342818     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342862     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342894     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342884     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342891     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342890     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342836     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342879     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342848     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342861     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342814     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342870     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342901     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342908     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342815     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342897     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342833     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342817     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342810     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342867     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342847     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342855     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342851     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342813     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342883     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342856     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342822     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342892     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342842     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342902     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342900     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342888     1  0.0000      1.000 1.000  0  0 0.000
#> ERR342812     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342853     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342866     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342820     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342895     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342825     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342826     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342875     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342834     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342898     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342886     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342838     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342882     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342807     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342873     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342844     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342874     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342893     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342859     3  0.0000      1.000 0.000  0  1 0.000
#> ERR342830     2  0.0000      1.000 0.000  1  0 0.000
#> ERR342880     4  0.0000      0.959 0.000  0  0 1.000
#> ERR342887     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342854     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342904     4  0.0188      0.958 0.004  0  0 0.996
#> ERR342881     4  0.1867      0.960 0.072  0  0 0.928
#> ERR342858     4  0.0000      0.959 0.000  0  0 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1 p2 p3    p4 p5
#> ERR342845     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342843     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342896     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342827     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342871     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342863     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342839     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342906     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342905     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342816     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342865     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342824     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342841     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342835     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342899     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342829     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342850     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342849     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342811     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342837     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342857     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342869     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342903     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342819     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342885     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342889     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342864     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342860     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342808     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342823     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342907     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342852     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342832     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342868     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342821     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342878     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342876     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342809     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342846     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342872     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342828     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342840     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342831     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342818     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342862     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342894     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342884     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342891     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342890     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342836     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342879     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342848     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342861     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342814     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342870     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342901     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342908     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342815     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342897     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342833     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342817     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342810     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342867     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342847     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342855     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342851     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342813     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342883     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342856     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342822     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342892     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342842     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342902     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342900     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342888     5   0.000      1.000 0.000  0  0 0.000  1
#> ERR342812     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342853     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342866     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342820     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342895     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342825     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342826     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342875     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342834     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342898     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342886     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342838     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342882     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342807     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342873     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342844     4   0.000      0.685 0.000  0  0 1.000  0
#> ERR342874     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342893     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342859     3   0.000      1.000 0.000  0  1 0.000  0
#> ERR342830     2   0.000      1.000 0.000  1  0 0.000  0
#> ERR342880     1   0.324      0.723 0.784  0  0 0.216  0
#> ERR342887     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342854     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342904     4   0.415      0.629 0.388  0  0 0.612  0
#> ERR342881     1   0.000      0.928 1.000  0  0 0.000  0
#> ERR342858     1   0.324      0.723 0.784  0  0 0.216  0

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3    p4 p5    p6
#> ERR342845     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342843     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342896     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342827     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342871     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342863     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342839     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342906     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342905     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342816     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342865     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342824     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342841     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342835     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342899     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342829     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342850     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342849     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342811     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342837     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342857     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342869     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342903     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342819     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342889     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342864     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342860     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342808     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342823     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342907     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342852     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342832     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342868     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342821     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342878     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342876     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342809     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342872     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342828     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342840     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342831     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342818     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342862     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342894     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342884     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342891     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342890     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342836     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342879     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342848     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342861     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342814     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342870     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342901     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342908     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342815     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342833     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342810     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342867     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342847     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342855     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342851     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342813     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342883     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342822     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342892     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342842     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342902     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342900     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342888     5  0.0000      1.000 0.000 0.000  0 0.000  1 0.000
#> ERR342812     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342853     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342866     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342820     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342895     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342875     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342898     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342886     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342838     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342882     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342807     2  0.3618      0.840 0.000 0.768  0 0.040  0 0.192
#> ERR342873     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342844     6  0.2996      1.000 0.000 0.000  0 0.228  0 0.772
#> ERR342874     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342893     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000  0 0.000
#> ERR342830     2  0.0000      0.929 0.000 1.000  0 0.000  0 0.000
#> ERR342880     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160
#> ERR342887     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342854     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342904     4  0.0937      1.000 0.040 0.000  0 0.960  0 0.000
#> ERR342881     1  0.0000      0.917 1.000 0.000  0 0.000  0 0.000
#> ERR342858     1  0.4671      0.678 0.688 0.000  0 0.152  0 0.160

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "kmeans"]
# you can also extract it by
# res = res_list["CV:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.185           0.576       0.731         0.3574 0.531   0.531
#> 3 3 0.132           0.680       0.764         0.4878 0.754   0.609
#> 4 4 0.373           0.582       0.709         0.1948 1.000   1.000
#> 5 5 0.495           0.471       0.653         0.1034 0.902   0.796
#> 6 6 0.595           0.596       0.601         0.0741 0.786   0.524

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.808      0.617 0.752 0.248
#> ERR342843     1   0.808      0.617 0.752 0.248
#> ERR342896     1   0.975      0.740 0.592 0.408
#> ERR342827     2   0.141      0.752 0.020 0.980
#> ERR342871     1   0.955      0.703 0.624 0.376
#> ERR342863     2   0.000      0.757 0.000 1.000
#> ERR342839     1   0.808      0.617 0.752 0.248
#> ERR342906     2   0.998     -0.464 0.472 0.528
#> ERR342905     2   0.278      0.740 0.048 0.952
#> ERR342816     2   0.998     -0.464 0.472 0.528
#> ERR342865     2   0.000      0.757 0.000 1.000
#> ERR342824     1   0.975      0.740 0.592 0.408
#> ERR342841     2   0.141      0.752 0.020 0.980
#> ERR342835     1   0.973      0.728 0.596 0.404
#> ERR342899     2   0.278      0.740 0.048 0.952
#> ERR342829     1   0.975      0.740 0.592 0.408
#> ERR342850     1   0.955      0.703 0.624 0.376
#> ERR342849     2   0.278      0.740 0.048 0.952
#> ERR342811     1   0.955      0.703 0.624 0.376
#> ERR342837     1   0.973      0.728 0.596 0.404
#> ERR342857     2   0.998     -0.464 0.472 0.528
#> ERR342869     1   0.955      0.703 0.624 0.376
#> ERR342903     1   0.975      0.740 0.592 0.408
#> ERR342819     1   0.973      0.728 0.596 0.404
#> ERR342885     1   0.814      0.381 0.748 0.252
#> ERR342889     2   0.000      0.757 0.000 1.000
#> ERR342864     2   0.998     -0.464 0.472 0.528
#> ERR342860     2   0.278      0.740 0.048 0.952
#> ERR342808     1   0.955      0.703 0.624 0.376
#> ERR342823     1   0.975      0.740 0.592 0.408
#> ERR342907     2   0.141      0.752 0.020 0.980
#> ERR342852     2   0.998     -0.464 0.472 0.528
#> ERR342832     2   0.000      0.757 0.000 1.000
#> ERR342868     1   0.808      0.617 0.752 0.248
#> ERR342821     2   0.998     -0.464 0.472 0.528
#> ERR342878     2   0.141      0.752 0.020 0.980
#> ERR342876     1   0.975      0.740 0.592 0.408
#> ERR342809     1   0.975      0.740 0.592 0.408
#> ERR342846     1   0.814      0.381 0.748 0.252
#> ERR342872     2   0.141      0.752 0.020 0.980
#> ERR342828     2   0.000      0.757 0.000 1.000
#> ERR342840     1   0.973      0.728 0.596 0.404
#> ERR342831     1   0.808      0.617 0.752 0.248
#> ERR342818     1   1.000      0.605 0.508 0.492
#> ERR342862     1   0.973      0.728 0.596 0.404
#> ERR342894     1   0.808      0.617 0.752 0.248
#> ERR342884     2   0.141      0.752 0.020 0.980
#> ERR342891     1   0.975      0.740 0.592 0.408
#> ERR342890     1   0.808      0.617 0.752 0.248
#> ERR342836     2   0.000      0.757 0.000 1.000
#> ERR342879     1   1.000      0.605 0.508 0.492
#> ERR342848     1   1.000      0.605 0.508 0.492
#> ERR342861     1   0.975      0.740 0.592 0.408
#> ERR342814     2   0.278      0.740 0.048 0.952
#> ERR342870     1   0.955      0.703 0.624 0.376
#> ERR342901     1   0.975      0.740 0.592 0.408
#> ERR342908     1   0.955      0.703 0.624 0.376
#> ERR342815     2   0.000      0.757 0.000 1.000
#> ERR342897     1   0.814      0.381 0.748 0.252
#> ERR342833     2   0.141      0.752 0.020 0.980
#> ERR342817     1   0.814      0.381 0.748 0.252
#> ERR342810     2   0.278      0.740 0.048 0.952
#> ERR342867     2   0.998     -0.464 0.472 0.528
#> ERR342847     1   0.973      0.728 0.596 0.404
#> ERR342855     1   0.975      0.740 0.592 0.408
#> ERR342851     1   1.000      0.605 0.508 0.492
#> ERR342813     1   0.808      0.617 0.752 0.248
#> ERR342883     1   1.000      0.605 0.508 0.492
#> ERR342856     1   0.814      0.381 0.748 0.252
#> ERR342822     2   0.000      0.757 0.000 1.000
#> ERR342892     1   0.975      0.740 0.592 0.408
#> ERR342842     1   0.975      0.740 0.592 0.408
#> ERR342902     2   0.141      0.752 0.020 0.980
#> ERR342900     2   0.278      0.740 0.048 0.952
#> ERR342888     1   0.808      0.617 0.752 0.248
#> ERR342812     1   0.975      0.740 0.592 0.408
#> ERR342853     2   0.278      0.740 0.048 0.952
#> ERR342866     1   0.973      0.728 0.596 0.404
#> ERR342820     1   0.955      0.703 0.624 0.376
#> ERR342895     1   0.975      0.740 0.592 0.408
#> ERR342825     1   0.814      0.381 0.748 0.252
#> ERR342826     1   0.814      0.381 0.748 0.252
#> ERR342875     2   0.000      0.757 0.000 1.000
#> ERR342834     1   0.814      0.381 0.748 0.252
#> ERR342898     2   0.998     -0.464 0.472 0.528
#> ERR342886     2   0.278      0.740 0.048 0.952
#> ERR342838     1   0.975      0.740 0.592 0.408
#> ERR342882     1   0.975      0.740 0.592 0.408
#> ERR342807     2   0.141      0.752 0.020 0.980
#> ERR342873     1   1.000      0.605 0.508 0.492
#> ERR342844     2   0.998     -0.464 0.472 0.528
#> ERR342874     1   0.973      0.728 0.596 0.404
#> ERR342893     1   1.000      0.605 0.508 0.492
#> ERR342859     1   0.814      0.381 0.748 0.252
#> ERR342830     2   0.278      0.740 0.048 0.952
#> ERR342880     1   1.000      0.605 0.508 0.492
#> ERR342887     1   0.975      0.740 0.592 0.408
#> ERR342854     1   0.975      0.740 0.592 0.408
#> ERR342904     1   0.955      0.703 0.624 0.376
#> ERR342881     1   0.973      0.728 0.596 0.404
#> ERR342858     1   1.000      0.605 0.508 0.492

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1   0.792      0.325 0.644 0.108 0.248
#> ERR342843     1   0.792      0.325 0.644 0.108 0.248
#> ERR342896     1   0.232      0.669 0.944 0.028 0.028
#> ERR342827     2   0.579      0.891 0.116 0.800 0.084
#> ERR342871     1   0.651      0.539 0.756 0.088 0.156
#> ERR342863     2   0.392      0.909 0.120 0.868 0.012
#> ERR342839     1   0.792      0.325 0.644 0.108 0.248
#> ERR342906     1   0.856      0.387 0.604 0.232 0.164
#> ERR342905     2   0.639      0.874 0.184 0.752 0.064
#> ERR342816     1   0.856      0.387 0.604 0.232 0.164
#> ERR342865     2   0.392      0.909 0.120 0.868 0.012
#> ERR342824     1   0.232      0.669 0.944 0.028 0.028
#> ERR342841     2   0.579      0.891 0.116 0.800 0.084
#> ERR342835     1   0.602      0.626 0.788 0.092 0.120
#> ERR342899     2   0.639      0.874 0.184 0.752 0.064
#> ERR342829     1   0.232      0.669 0.944 0.028 0.028
#> ERR342850     1   0.651      0.539 0.756 0.088 0.156
#> ERR342849     2   0.639      0.874 0.184 0.752 0.064
#> ERR342811     1   0.651      0.539 0.756 0.088 0.156
#> ERR342837     1   0.602      0.626 0.788 0.092 0.120
#> ERR342857     1   0.856      0.387 0.604 0.232 0.164
#> ERR342869     1   0.651      0.539 0.756 0.088 0.156
#> ERR342903     1   0.232      0.669 0.944 0.028 0.028
#> ERR342819     1   0.602      0.626 0.788 0.092 0.120
#> ERR342885     3   0.829      0.994 0.308 0.104 0.588
#> ERR342889     2   0.392      0.909 0.120 0.868 0.012
#> ERR342864     1   0.856      0.387 0.604 0.232 0.164
#> ERR342860     2   0.639      0.874 0.184 0.752 0.064
#> ERR342808     1   0.651      0.539 0.756 0.088 0.156
#> ERR342823     1   0.232      0.669 0.944 0.028 0.028
#> ERR342907     2   0.579      0.891 0.116 0.800 0.084
#> ERR342852     1   0.856      0.387 0.604 0.232 0.164
#> ERR342832     2   0.392      0.909 0.120 0.868 0.012
#> ERR342868     1   0.792      0.325 0.644 0.108 0.248
#> ERR342821     1   0.856      0.387 0.604 0.232 0.164
#> ERR342878     2   0.579      0.891 0.116 0.800 0.084
#> ERR342876     1   0.232      0.669 0.944 0.028 0.028
#> ERR342809     1   0.232      0.669 0.944 0.028 0.028
#> ERR342846     3   0.853      0.992 0.308 0.120 0.572
#> ERR342872     2   0.579      0.891 0.116 0.800 0.084
#> ERR342828     2   0.392      0.909 0.120 0.868 0.012
#> ERR342840     1   0.601      0.626 0.788 0.088 0.124
#> ERR342831     1   0.792      0.325 0.644 0.108 0.248
#> ERR342818     1   0.744      0.577 0.700 0.136 0.164
#> ERR342862     1   0.601      0.626 0.788 0.088 0.124
#> ERR342894     1   0.792      0.325 0.644 0.108 0.248
#> ERR342884     2   0.579      0.891 0.116 0.800 0.084
#> ERR342891     1   0.232      0.669 0.944 0.028 0.028
#> ERR342890     1   0.792      0.325 0.644 0.108 0.248
#> ERR342836     2   0.392      0.909 0.120 0.868 0.012
#> ERR342879     1   0.744      0.577 0.700 0.136 0.164
#> ERR342848     1   0.744      0.577 0.700 0.136 0.164
#> ERR342861     1   0.232      0.669 0.944 0.028 0.028
#> ERR342814     2   0.639      0.874 0.184 0.752 0.064
#> ERR342870     1   0.651      0.539 0.756 0.088 0.156
#> ERR342901     1   0.232      0.669 0.944 0.028 0.028
#> ERR342908     1   0.651      0.539 0.756 0.088 0.156
#> ERR342815     2   0.392      0.909 0.120 0.868 0.012
#> ERR342897     3   0.853      0.992 0.308 0.120 0.572
#> ERR342833     2   0.579      0.891 0.116 0.800 0.084
#> ERR342817     3   0.829      0.994 0.308 0.104 0.588
#> ERR342810     2   0.639      0.874 0.184 0.752 0.064
#> ERR342867     1   0.856      0.387 0.604 0.232 0.164
#> ERR342847     1   0.602      0.626 0.788 0.092 0.120
#> ERR342855     1   0.232      0.669 0.944 0.028 0.028
#> ERR342851     1   0.744      0.577 0.700 0.136 0.164
#> ERR342813     1   0.792      0.325 0.644 0.108 0.248
#> ERR342883     1   0.744      0.577 0.700 0.136 0.164
#> ERR342856     3   0.853      0.992 0.308 0.120 0.572
#> ERR342822     2   0.392      0.909 0.120 0.868 0.012
#> ERR342892     1   0.232      0.669 0.944 0.028 0.028
#> ERR342842     1   0.232      0.669 0.944 0.028 0.028
#> ERR342902     2   0.579      0.891 0.116 0.800 0.084
#> ERR342900     2   0.639      0.874 0.184 0.752 0.064
#> ERR342888     1   0.792      0.325 0.644 0.108 0.248
#> ERR342812     1   0.232      0.669 0.944 0.028 0.028
#> ERR342853     2   0.639      0.874 0.184 0.752 0.064
#> ERR342866     1   0.601      0.626 0.788 0.088 0.124
#> ERR342820     1   0.651      0.539 0.756 0.088 0.156
#> ERR342895     1   0.232      0.669 0.944 0.028 0.028
#> ERR342825     3   0.829      0.994 0.308 0.104 0.588
#> ERR342826     3   0.829      0.994 0.308 0.104 0.588
#> ERR342875     2   0.392      0.909 0.120 0.868 0.012
#> ERR342834     3   0.829      0.994 0.308 0.104 0.588
#> ERR342898     1   0.856      0.387 0.604 0.232 0.164
#> ERR342886     2   0.639      0.874 0.184 0.752 0.064
#> ERR342838     1   0.232      0.669 0.944 0.028 0.028
#> ERR342882     1   0.232      0.669 0.944 0.028 0.028
#> ERR342807     2   0.579      0.891 0.116 0.800 0.084
#> ERR342873     1   0.744      0.577 0.700 0.136 0.164
#> ERR342844     1   0.856      0.387 0.604 0.232 0.164
#> ERR342874     1   0.601      0.626 0.788 0.088 0.124
#> ERR342893     1   0.744      0.577 0.700 0.136 0.164
#> ERR342859     3   0.853      0.992 0.308 0.120 0.572
#> ERR342830     2   0.639      0.874 0.184 0.752 0.064
#> ERR342880     1   0.744      0.577 0.700 0.136 0.164
#> ERR342887     1   0.232      0.669 0.944 0.028 0.028
#> ERR342854     1   0.232      0.669 0.944 0.028 0.028
#> ERR342904     1   0.651      0.539 0.756 0.088 0.156
#> ERR342881     1   0.601      0.626 0.788 0.088 0.124
#> ERR342858     1   0.744      0.577 0.700 0.136 0.164

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> ERR342845     1  0.7845      0.192 0.476 0.008 0.288 NA
#> ERR342843     1  0.7845      0.192 0.476 0.008 0.288 NA
#> ERR342896     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342827     2  0.5108      0.819 0.032 0.768 0.024 NA
#> ERR342871     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342863     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342839     1  0.8058      0.192 0.476 0.020 0.300 NA
#> ERR342906     1  0.9685      0.165 0.384 0.208 0.200 NA
#> ERR342905     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342816     1  0.9685      0.165 0.384 0.208 0.200 NA
#> ERR342865     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342824     1  0.0524      0.585 0.988 0.008 0.000 NA
#> ERR342841     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342835     1  0.7051      0.501 0.620 0.040 0.080 NA
#> ERR342899     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342829     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342850     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342849     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342811     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342837     1  0.7051      0.501 0.620 0.040 0.080 NA
#> ERR342857     1  0.9686      0.165 0.384 0.208 0.204 NA
#> ERR342869     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342903     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342819     1  0.7051      0.501 0.620 0.040 0.080 NA
#> ERR342885     3  0.5109      0.990 0.196 0.060 0.744 NA
#> ERR342889     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342864     1  0.9686      0.165 0.384 0.208 0.204 NA
#> ERR342860     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342808     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342823     1  0.0524      0.585 0.988 0.008 0.000 NA
#> ERR342907     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342852     1  0.9686      0.165 0.384 0.208 0.204 NA
#> ERR342832     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342868     1  0.8058      0.192 0.476 0.020 0.300 NA
#> ERR342821     1  0.9685      0.165 0.384 0.208 0.200 NA
#> ERR342878     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342876     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342809     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342846     3  0.5969      0.986 0.196 0.060 0.716 NA
#> ERR342872     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342828     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342840     1  0.6979      0.501 0.620 0.040 0.072 NA
#> ERR342831     1  0.7845      0.192 0.476 0.008 0.288 NA
#> ERR342818     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342862     1  0.6979      0.501 0.620 0.040 0.072 NA
#> ERR342894     1  0.7845      0.192 0.476 0.008 0.288 NA
#> ERR342884     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342891     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342890     1  0.8058      0.192 0.476 0.020 0.300 NA
#> ERR342836     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342879     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342848     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342861     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342814     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342870     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342901     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342908     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342815     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342897     3  0.5913      0.986 0.196 0.068 0.716 NA
#> ERR342833     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342817     3  0.5109      0.990 0.196 0.060 0.744 NA
#> ERR342810     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342867     1  0.9685      0.165 0.384 0.208 0.200 NA
#> ERR342847     1  0.7051      0.501 0.620 0.040 0.080 NA
#> ERR342855     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342851     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342813     1  0.7845      0.192 0.476 0.008 0.288 NA
#> ERR342883     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342856     3  0.5913      0.986 0.196 0.068 0.716 NA
#> ERR342822     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342892     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342842     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342902     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342900     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342888     1  0.8058      0.192 0.476 0.020 0.300 NA
#> ERR342812     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342853     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342866     1  0.6979      0.501 0.620 0.040 0.072 NA
#> ERR342820     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342895     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342825     3  0.5109      0.990 0.196 0.060 0.744 NA
#> ERR342826     3  0.5109      0.990 0.196 0.060 0.744 NA
#> ERR342875     2  0.1833      0.862 0.032 0.944 0.000 NA
#> ERR342834     3  0.5109      0.990 0.196 0.060 0.744 NA
#> ERR342898     1  0.9686      0.165 0.384 0.208 0.204 NA
#> ERR342886     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342838     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342882     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342807     2  0.5048      0.819 0.032 0.768 0.020 NA
#> ERR342873     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342844     1  0.9686      0.165 0.384 0.208 0.204 NA
#> ERR342874     1  0.6979      0.501 0.620 0.040 0.072 NA
#> ERR342893     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342859     3  0.5969      0.986 0.196 0.060 0.716 NA
#> ERR342830     2  0.5164      0.831 0.104 0.796 0.044 NA
#> ERR342880     1  0.8165      0.478 0.560 0.120 0.088 NA
#> ERR342887     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342854     1  0.0336      0.585 0.992 0.008 0.000 NA
#> ERR342904     1  0.7467      0.375 0.576 0.024 0.256 NA
#> ERR342881     1  0.6979      0.501 0.620 0.040 0.072 NA
#> ERR342858     1  0.8165      0.478 0.560 0.120 0.088 NA

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> ERR342845     1  0.8070     0.1661 0.444 0.004 0.156 0.144 NA
#> ERR342843     1  0.8070     0.1661 0.444 0.004 0.156 0.144 NA
#> ERR342896     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342827     2  0.1095     0.7116 0.012 0.968 0.008 0.012 NA
#> ERR342871     1  0.8095     0.1186 0.484 0.020 0.228 0.152 NA
#> ERR342863     2  0.5615     0.7880 0.016 0.660 0.012 0.056 NA
#> ERR342839     1  0.7831     0.1649 0.444 0.004 0.152 0.100 NA
#> ERR342906     1  0.9596    -0.0925 0.308 0.100 0.204 0.236 NA
#> ERR342905     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342816     1  0.9596    -0.0925 0.308 0.100 0.204 0.236 NA
#> ERR342865     2  0.5615     0.7880 0.016 0.660 0.012 0.056 NA
#> ERR342824     1  0.0162     0.3684 0.996 0.000 0.000 0.000 NA
#> ERR342841     2  0.0566     0.7115 0.012 0.984 0.004 0.000 NA
#> ERR342835     1  0.7090     0.0271 0.528 0.008 0.072 0.304 NA
#> ERR342899     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342829     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342850     1  0.8087     0.1188 0.484 0.020 0.228 0.156 NA
#> ERR342849     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342811     1  0.8095     0.1189 0.484 0.020 0.228 0.152 NA
#> ERR342837     1  0.7090     0.0271 0.528 0.008 0.072 0.304 NA
#> ERR342857     1  0.9584    -0.0924 0.308 0.100 0.204 0.240 NA
#> ERR342869     1  0.8087     0.1188 0.484 0.020 0.228 0.156 NA
#> ERR342903     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342819     1  0.7090     0.0271 0.528 0.008 0.072 0.304 NA
#> ERR342885     3  0.2351     0.9692 0.088 0.016 0.896 0.000 NA
#> ERR342889     2  0.5615     0.7880 0.016 0.660 0.012 0.056 NA
#> ERR342864     1  0.9584    -0.0924 0.308 0.100 0.204 0.240 NA
#> ERR342860     2  0.6694     0.7386 0.072 0.468 0.024 0.020 NA
#> ERR342808     1  0.8101     0.1186 0.484 0.020 0.228 0.148 NA
#> ERR342823     1  0.0162     0.3684 0.996 0.000 0.000 0.000 NA
#> ERR342907     2  0.0693     0.7115 0.012 0.980 0.008 0.000 NA
#> ERR342852     1  0.9584    -0.0924 0.308 0.100 0.204 0.240 NA
#> ERR342832     2  0.5615     0.7880 0.016 0.660 0.012 0.056 NA
#> ERR342868     1  0.7831     0.1649 0.444 0.004 0.152 0.100 NA
#> ERR342821     1  0.9596    -0.0925 0.308 0.100 0.204 0.236 NA
#> ERR342878     2  0.0566     0.7115 0.012 0.984 0.004 0.000 NA
#> ERR342876     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342809     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342846     3  0.4514     0.9601 0.088 0.024 0.808 0.056 NA
#> ERR342872     2  0.0727     0.7115 0.012 0.980 0.004 0.004 NA
#> ERR342828     2  0.5652     0.7880 0.016 0.660 0.012 0.060 NA
#> ERR342840     1  0.6963     0.0268 0.528 0.004 0.076 0.312 NA
#> ERR342831     1  0.8070     0.1661 0.444 0.004 0.156 0.144 NA
#> ERR342818     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342862     1  0.7057     0.0261 0.528 0.004 0.076 0.300 NA
#> ERR342894     1  0.8070     0.1661 0.444 0.004 0.156 0.144 NA
#> ERR342884     2  0.0566     0.7115 0.012 0.984 0.004 0.000 NA
#> ERR342891     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342890     1  0.7831     0.1649 0.444 0.004 0.152 0.100 NA
#> ERR342836     2  0.5615     0.7880 0.016 0.660 0.012 0.056 NA
#> ERR342879     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342848     4  0.7133     0.9916 0.404 0.064 0.060 0.452 NA
#> ERR342861     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342814     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342870     1  0.8095     0.1189 0.484 0.020 0.228 0.152 NA
#> ERR342901     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342908     1  0.8101     0.1186 0.484 0.020 0.228 0.148 NA
#> ERR342815     2  0.5652     0.7880 0.016 0.660 0.012 0.060 NA
#> ERR342897     3  0.4447     0.9612 0.088 0.024 0.812 0.052 NA
#> ERR342833     2  0.0566     0.7115 0.012 0.984 0.004 0.000 NA
#> ERR342817     3  0.2351     0.9692 0.088 0.016 0.896 0.000 NA
#> ERR342810     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342867     1  0.9596    -0.0925 0.308 0.100 0.204 0.236 NA
#> ERR342847     1  0.7090     0.0271 0.528 0.008 0.072 0.304 NA
#> ERR342855     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342851     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342813     1  0.8070     0.1661 0.444 0.004 0.156 0.144 NA
#> ERR342883     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342856     3  0.4447     0.9612 0.088 0.024 0.812 0.052 NA
#> ERR342822     2  0.5652     0.7880 0.016 0.660 0.012 0.060 NA
#> ERR342892     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342842     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342902     2  0.0566     0.7115 0.012 0.984 0.004 0.000 NA
#> ERR342900     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342888     1  0.7831     0.1649 0.444 0.004 0.152 0.100 NA
#> ERR342812     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342853     2  0.6621     0.7387 0.072 0.468 0.020 0.020 NA
#> ERR342866     1  0.6963     0.0268 0.528 0.004 0.076 0.312 NA
#> ERR342820     1  0.8087     0.1188 0.484 0.020 0.228 0.156 NA
#> ERR342895     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342825     3  0.2351     0.9692 0.088 0.016 0.896 0.000 NA
#> ERR342826     3  0.2351     0.9692 0.088 0.016 0.896 0.000 NA
#> ERR342875     2  0.5652     0.7880 0.016 0.660 0.012 0.060 NA
#> ERR342834     3  0.2351     0.9692 0.088 0.016 0.896 0.000 NA
#> ERR342898     1  0.9584    -0.0924 0.308 0.100 0.204 0.240 NA
#> ERR342886     2  0.6694     0.7386 0.072 0.468 0.024 0.020 NA
#> ERR342838     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342882     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342807     2  0.0968     0.7116 0.012 0.972 0.012 0.004 NA
#> ERR342873     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342844     1  0.9584    -0.0924 0.308 0.100 0.204 0.240 NA
#> ERR342874     1  0.7057     0.0261 0.528 0.004 0.076 0.300 NA
#> ERR342893     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342859     3  0.4514     0.9601 0.088 0.024 0.808 0.056 NA
#> ERR342830     2  0.6694     0.7386 0.072 0.468 0.024 0.020 NA
#> ERR342880     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA
#> ERR342887     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342854     1  0.0000     0.3698 1.000 0.000 0.000 0.000 NA
#> ERR342904     1  0.8095     0.1189 0.484 0.020 0.228 0.152 NA
#> ERR342881     1  0.7057     0.0261 0.528 0.004 0.076 0.300 NA
#> ERR342858     4  0.6966     0.9990 0.404 0.064 0.060 0.460 NA

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> ERR342845     5  0.7232      0.969 0.272 0.004 0.136 0.152 0.436 NA
#> ERR342843     5  0.7232      0.969 0.272 0.004 0.136 0.152 0.436 NA
#> ERR342896     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342827     2  0.4991      0.656 0.004 0.580 0.000 0.020 0.032 NA
#> ERR342871     1  0.8496      0.178 0.300 0.004 0.160 0.228 0.056 NA
#> ERR342863     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.004 NA
#> ERR342839     5  0.8095      0.960 0.272 0.004 0.140 0.184 0.364 NA
#> ERR342906     4  0.8931      0.991 0.176 0.048 0.224 0.360 0.076 NA
#> ERR342905     2  0.7132      0.658 0.076 0.572 0.012 0.056 0.172 NA
#> ERR342816     4  0.8931      0.991 0.176 0.048 0.224 0.360 0.076 NA
#> ERR342865     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.004 NA
#> ERR342824     1  0.4323      0.467 0.508 0.000 0.000 0.476 0.008 NA
#> ERR342841     2  0.3923      0.657 0.004 0.580 0.000 0.000 0.000 NA
#> ERR342835     1  0.0696      0.298 0.980 0.004 0.008 0.000 0.004 NA
#> ERR342899     2  0.6891      0.658 0.076 0.572 0.004 0.044 0.196 NA
#> ERR342829     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342850     1  0.8494      0.178 0.300 0.004 0.160 0.224 0.056 NA
#> ERR342849     2  0.6856      0.658 0.076 0.572 0.004 0.040 0.200 NA
#> ERR342811     1  0.8494      0.178 0.300 0.004 0.160 0.224 0.056 NA
#> ERR342837     1  0.0696      0.298 0.980 0.004 0.008 0.000 0.004 NA
#> ERR342857     4  0.8814      0.993 0.176 0.048 0.224 0.376 0.072 NA
#> ERR342869     1  0.8494      0.178 0.300 0.004 0.160 0.224 0.056 NA
#> ERR342903     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342819     1  0.0551      0.298 0.984 0.004 0.008 0.000 0.004 NA
#> ERR342885     3  0.1341      0.966 0.028 0.000 0.948 0.024 0.000 NA
#> ERR342889     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.004 NA
#> ERR342864     4  0.8814      0.993 0.176 0.048 0.224 0.376 0.072 NA
#> ERR342860     2  0.6934      0.658 0.076 0.572 0.004 0.044 0.180 NA
#> ERR342808     1  0.8496      0.178 0.300 0.004 0.160 0.228 0.056 NA
#> ERR342823     1  0.4323      0.467 0.508 0.000 0.000 0.476 0.008 NA
#> ERR342907     2  0.4049      0.657 0.004 0.580 0.000 0.000 0.004 NA
#> ERR342852     4  0.8814      0.993 0.176 0.048 0.224 0.376 0.072 NA
#> ERR342832     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.004 NA
#> ERR342868     5  0.8057      0.960 0.272 0.004 0.140 0.188 0.364 NA
#> ERR342821     4  0.8931      0.991 0.176 0.048 0.224 0.360 0.076 NA
#> ERR342878     2  0.4049      0.657 0.004 0.580 0.004 0.000 0.000 NA
#> ERR342876     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342809     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342846     3  0.3090      0.958 0.028 0.000 0.872 0.048 0.020 NA
#> ERR342872     2  0.4352      0.657 0.004 0.580 0.000 0.004 0.012 NA
#> ERR342828     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.000 NA
#> ERR342840     1  0.0551      0.298 0.984 0.004 0.008 0.000 0.000 NA
#> ERR342831     5  0.7232      0.969 0.272 0.004 0.136 0.152 0.436 NA
#> ERR342818     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342862     1  0.0810      0.298 0.976 0.004 0.008 0.000 0.008 NA
#> ERR342894     5  0.7232      0.969 0.272 0.004 0.136 0.152 0.436 NA
#> ERR342884     2  0.4049      0.657 0.004 0.580 0.000 0.000 0.004 NA
#> ERR342891     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342890     5  0.8057      0.960 0.272 0.004 0.140 0.188 0.364 NA
#> ERR342836     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.004 NA
#> ERR342879     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342848     1  0.7747      0.187 0.420 0.016 0.012 0.192 0.252 NA
#> ERR342861     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342814     2  0.6856      0.658 0.076 0.572 0.004 0.040 0.200 NA
#> ERR342870     1  0.8496      0.177 0.300 0.004 0.160 0.228 0.056 NA
#> ERR342901     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342908     1  0.8496      0.178 0.300 0.004 0.160 0.228 0.056 NA
#> ERR342815     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.000 NA
#> ERR342897     3  0.3090      0.958 0.028 0.000 0.872 0.048 0.020 NA
#> ERR342833     2  0.4049      0.657 0.004 0.580 0.004 0.000 0.000 NA
#> ERR342817     3  0.1341      0.966 0.028 0.000 0.948 0.024 0.000 NA
#> ERR342810     2  0.7132      0.658 0.076 0.572 0.012 0.056 0.172 NA
#> ERR342867     4  0.8931      0.991 0.176 0.048 0.224 0.360 0.076 NA
#> ERR342847     1  0.0551      0.298 0.984 0.004 0.008 0.000 0.004 NA
#> ERR342855     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342851     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342813     5  0.7232      0.969 0.272 0.004 0.136 0.152 0.436 NA
#> ERR342883     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342856     3  0.3090      0.958 0.028 0.000 0.872 0.048 0.020 NA
#> ERR342822     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.000 NA
#> ERR342892     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342842     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342902     2  0.4049      0.657 0.004 0.580 0.004 0.000 0.000 NA
#> ERR342900     2  0.6856      0.658 0.076 0.572 0.004 0.040 0.200 NA
#> ERR342888     5  0.8057      0.960 0.272 0.004 0.140 0.188 0.364 NA
#> ERR342812     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342853     2  0.6915      0.658 0.076 0.572 0.004 0.044 0.188 NA
#> ERR342866     1  0.0810      0.298 0.976 0.004 0.008 0.000 0.004 NA
#> ERR342820     1  0.8494      0.178 0.300 0.004 0.160 0.224 0.056 NA
#> ERR342895     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342825     3  0.1341      0.966 0.028 0.000 0.948 0.024 0.000 NA
#> ERR342826     3  0.1485      0.966 0.028 0.000 0.944 0.024 0.004 NA
#> ERR342875     2  0.0146      0.725 0.000 0.996 0.000 0.000 0.000 NA
#> ERR342834     3  0.1341      0.966 0.028 0.000 0.948 0.024 0.000 NA
#> ERR342898     4  0.8814      0.993 0.176 0.048 0.224 0.376 0.072 NA
#> ERR342886     2  0.6934      0.658 0.076 0.572 0.004 0.044 0.180 NA
#> ERR342838     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342882     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342807     2  0.4664      0.657 0.004 0.580 0.012 0.008 0.008 NA
#> ERR342873     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342844     4  0.8814      0.993 0.176 0.048 0.224 0.376 0.072 NA
#> ERR342874     1  0.0810      0.298 0.976 0.004 0.008 0.000 0.008 NA
#> ERR342893     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342859     3  0.3090      0.958 0.028 0.000 0.872 0.048 0.020 NA
#> ERR342830     2  0.6934      0.658 0.076 0.572 0.004 0.044 0.180 NA
#> ERR342880     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA
#> ERR342887     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342854     1  0.3868      0.472 0.508 0.000 0.000 0.492 0.000 NA
#> ERR342904     1  0.8496      0.177 0.300 0.004 0.160 0.228 0.056 NA
#> ERR342881     1  0.0810      0.298 0.976 0.004 0.008 0.000 0.008 NA
#> ERR342858     1  0.7669      0.190 0.420 0.016 0.012 0.196 0.264 NA

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "skmeans"]
# you can also extract it by
# res = res_list["CV:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.688           0.925       0.959         0.4853 0.499   0.499
#> 3 3 0.706           0.692       0.872         0.3569 0.704   0.475
#> 4 4 0.706           0.811       0.873         0.1279 0.854   0.598
#> 5 5 0.806           0.770       0.827         0.0561 0.918   0.691
#> 6 6 0.852           0.846       0.776         0.0369 0.984   0.920

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      1.000 1.000 0.000
#> ERR342843     1   0.000      1.000 1.000 0.000
#> ERR342896     1   0.000      1.000 1.000 0.000
#> ERR342827     2   0.000      0.906 0.000 1.000
#> ERR342871     1   0.000      1.000 1.000 0.000
#> ERR342863     2   0.000      0.906 0.000 1.000
#> ERR342839     1   0.000      1.000 1.000 0.000
#> ERR342906     2   0.936      0.581 0.352 0.648
#> ERR342905     2   0.000      0.906 0.000 1.000
#> ERR342816     2   0.936      0.581 0.352 0.648
#> ERR342865     2   0.000      0.906 0.000 1.000
#> ERR342824     1   0.000      1.000 1.000 0.000
#> ERR342841     2   0.000      0.906 0.000 1.000
#> ERR342835     1   0.000      1.000 1.000 0.000
#> ERR342899     2   0.000      0.906 0.000 1.000
#> ERR342829     1   0.000      1.000 1.000 0.000
#> ERR342850     1   0.000      1.000 1.000 0.000
#> ERR342849     2   0.000      0.906 0.000 1.000
#> ERR342811     1   0.000      1.000 1.000 0.000
#> ERR342837     1   0.000      1.000 1.000 0.000
#> ERR342857     2   0.936      0.581 0.352 0.648
#> ERR342869     1   0.000      1.000 1.000 0.000
#> ERR342903     1   0.000      1.000 1.000 0.000
#> ERR342819     1   0.000      1.000 1.000 0.000
#> ERR342885     2   0.482      0.865 0.104 0.896
#> ERR342889     2   0.000      0.906 0.000 1.000
#> ERR342864     2   0.936      0.581 0.352 0.648
#> ERR342860     2   0.000      0.906 0.000 1.000
#> ERR342808     1   0.000      1.000 1.000 0.000
#> ERR342823     1   0.000      1.000 1.000 0.000
#> ERR342907     2   0.000      0.906 0.000 1.000
#> ERR342852     2   0.936      0.581 0.352 0.648
#> ERR342832     2   0.000      0.906 0.000 1.000
#> ERR342868     1   0.000      1.000 1.000 0.000
#> ERR342821     2   0.936      0.581 0.352 0.648
#> ERR342878     2   0.000      0.906 0.000 1.000
#> ERR342876     1   0.000      1.000 1.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000
#> ERR342846     2   0.482      0.865 0.104 0.896
#> ERR342872     2   0.000      0.906 0.000 1.000
#> ERR342828     2   0.000      0.906 0.000 1.000
#> ERR342840     1   0.000      1.000 1.000 0.000
#> ERR342831     1   0.000      1.000 1.000 0.000
#> ERR342818     1   0.000      1.000 1.000 0.000
#> ERR342862     1   0.000      1.000 1.000 0.000
#> ERR342894     1   0.000      1.000 1.000 0.000
#> ERR342884     2   0.000      0.906 0.000 1.000
#> ERR342891     1   0.000      1.000 1.000 0.000
#> ERR342890     1   0.000      1.000 1.000 0.000
#> ERR342836     2   0.000      0.906 0.000 1.000
#> ERR342879     1   0.000      1.000 1.000 0.000
#> ERR342848     1   0.000      1.000 1.000 0.000
#> ERR342861     1   0.000      1.000 1.000 0.000
#> ERR342814     2   0.000      0.906 0.000 1.000
#> ERR342870     1   0.000      1.000 1.000 0.000
#> ERR342901     1   0.000      1.000 1.000 0.000
#> ERR342908     1   0.000      1.000 1.000 0.000
#> ERR342815     2   0.000      0.906 0.000 1.000
#> ERR342897     2   0.482      0.865 0.104 0.896
#> ERR342833     2   0.000      0.906 0.000 1.000
#> ERR342817     2   0.482      0.865 0.104 0.896
#> ERR342810     2   0.000      0.906 0.000 1.000
#> ERR342867     2   0.936      0.581 0.352 0.648
#> ERR342847     1   0.000      1.000 1.000 0.000
#> ERR342855     1   0.000      1.000 1.000 0.000
#> ERR342851     1   0.000      1.000 1.000 0.000
#> ERR342813     1   0.000      1.000 1.000 0.000
#> ERR342883     1   0.000      1.000 1.000 0.000
#> ERR342856     2   0.482      0.865 0.104 0.896
#> ERR342822     2   0.000      0.906 0.000 1.000
#> ERR342892     1   0.000      1.000 1.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000
#> ERR342902     2   0.000      0.906 0.000 1.000
#> ERR342900     2   0.000      0.906 0.000 1.000
#> ERR342888     1   0.000      1.000 1.000 0.000
#> ERR342812     1   0.000      1.000 1.000 0.000
#> ERR342853     2   0.000      0.906 0.000 1.000
#> ERR342866     1   0.000      1.000 1.000 0.000
#> ERR342820     1   0.000      1.000 1.000 0.000
#> ERR342895     1   0.000      1.000 1.000 0.000
#> ERR342825     2   0.482      0.865 0.104 0.896
#> ERR342826     2   0.482      0.865 0.104 0.896
#> ERR342875     2   0.000      0.906 0.000 1.000
#> ERR342834     2   0.482      0.865 0.104 0.896
#> ERR342898     2   0.936      0.581 0.352 0.648
#> ERR342886     2   0.000      0.906 0.000 1.000
#> ERR342838     1   0.000      1.000 1.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000
#> ERR342807     2   0.000      0.906 0.000 1.000
#> ERR342873     1   0.000      1.000 1.000 0.000
#> ERR342844     2   0.936      0.581 0.352 0.648
#> ERR342874     1   0.000      1.000 1.000 0.000
#> ERR342893     1   0.000      1.000 1.000 0.000
#> ERR342859     2   0.482      0.865 0.104 0.896
#> ERR342830     2   0.000      0.906 0.000 1.000
#> ERR342880     1   0.000      1.000 1.000 0.000
#> ERR342887     1   0.000      1.000 1.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000
#> ERR342904     1   0.000      1.000 1.000 0.000
#> ERR342881     1   0.000      1.000 1.000 0.000
#> ERR342858     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342843     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342896     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342827     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342871     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342863     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342839     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342906     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342905     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342816     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342865     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342824     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342841     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342835     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342899     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342829     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342850     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342849     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342811     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342837     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342857     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342869     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342903     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342819     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342885     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342889     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342864     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342860     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342808     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342823     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342907     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342852     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342832     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342868     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342821     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342878     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342876     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342809     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342846     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342872     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342828     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342840     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342831     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342818     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342862     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342894     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342884     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342891     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342890     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342836     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342879     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342848     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342861     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342814     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342870     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342901     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342908     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342815     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342897     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342833     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342817     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342810     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342867     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342847     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342855     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342851     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342813     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342883     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342856     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342822     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342892     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342842     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342902     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342900     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342888     3  0.6267      0.313 0.452 0.000 0.548
#> ERR342812     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342853     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342866     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342820     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342895     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342825     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342826     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342875     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342834     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342898     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342886     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342838     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342882     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342807     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342873     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342844     3  0.1491      0.693 0.016 0.016 0.968
#> ERR342874     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342893     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342859     3  0.2313      0.693 0.024 0.032 0.944
#> ERR342830     2  0.0000      1.000 0.000 1.000 0.000
#> ERR342880     1  0.6823      0.094 0.504 0.012 0.484
#> ERR342887     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342854     1  0.0237      0.819 0.996 0.000 0.004
#> ERR342904     3  0.6026      0.319 0.376 0.000 0.624
#> ERR342881     1  0.0892      0.813 0.980 0.000 0.020
#> ERR342858     1  0.6823      0.094 0.504 0.012 0.484

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342843     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342896     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342827     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342871     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342863     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342839     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342906     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342905     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342816     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342865     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342841     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342835     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342899     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342829     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342850     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342849     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342811     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342837     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342857     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342869     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342903     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342819     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342885     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342889     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342864     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342860     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342808     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342823     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342907     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342852     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342832     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342868     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342821     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342878     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342876     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342846     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342872     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342828     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342840     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342831     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342818     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342862     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342894     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342884     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342891     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342890     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342836     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342879     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342848     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342861     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342814     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342870     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342901     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342908     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342815     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342897     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342833     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342817     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342810     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342867     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342847     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342855     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342851     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342813     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342883     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342856     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342822     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342902     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342900     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342888     3  0.5722      0.775 0.148 0.000 0.716 0.136
#> ERR342812     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342853     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342866     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342820     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342895     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342825     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342826     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342875     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342834     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342898     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342886     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342838     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342807     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342873     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342844     4  0.5376      0.553 0.000 0.016 0.396 0.588
#> ERR342874     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342893     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342859     3  0.1545      0.769 0.000 0.008 0.952 0.040
#> ERR342830     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342880     4  0.2450      0.700 0.072 0.000 0.016 0.912
#> ERR342887     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.868 1.000 0.000 0.000 0.000
#> ERR342904     4  0.5578      0.701 0.128 0.000 0.144 0.728
#> ERR342881     1  0.5639      0.661 0.636 0.000 0.040 0.324
#> ERR342858     4  0.2450      0.700 0.072 0.000 0.016 0.912

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342843     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342871     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342863     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342839     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342906     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342905     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342816     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342865     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342835     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342899     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342849     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342811     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342837     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342857     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342869     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342885     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342889     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342860     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342808     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342852     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342832     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342868     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342821     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342878     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342872     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342828     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342831     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342818     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342862     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342894     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342884     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342836     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342879     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342848     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342870     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342815     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342897     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342833     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342817     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342810     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342867     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342847     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342813     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342883     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342856     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342822     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342900     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342888     3  0.5479      0.793 0.036 0.000 0.688 0.064 0.212
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342866     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342820     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342826     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342875     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342898     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342886     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.0613      0.989 0.000 0.984 0.008 0.004 0.004
#> ERR342873     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342844     4  0.1544      0.663 0.000 0.000 0.068 0.932 0.000
#> ERR342874     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342893     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342859     3  0.1608      0.790 0.000 0.000 0.928 0.072 0.000
#> ERR342830     2  0.0290      0.992 0.000 0.992 0.000 0.000 0.008
#> ERR342880     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.6273      0.615 0.032 0.000 0.076 0.532 0.360
#> ERR342881     5  0.5093      0.448 0.340 0.000 0.020 0.020 0.620
#> ERR342858     5  0.5256      0.133 0.024 0.000 0.012 0.472 0.492

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342843     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342896     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342871     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342863     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342839     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342906     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342905     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342816     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342865     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342824     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342835     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342899     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342829     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342849     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342811     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342837     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342857     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342869     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342903     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342885     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342889     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342864     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342860     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342808     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342823     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342852     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342832     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342868     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342821     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342878     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342876     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342872     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342828     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342840     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342831     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342818     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342862     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342894     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342884     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342891     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342836     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342879     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342848     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342861     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342870     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342901     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342815     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342897     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342833     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342817     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342810     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342867     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342847     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342855     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342813     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342883     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342856     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342822     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342892     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342900     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342888     3   0.630      0.716 0.012 0.000 0.520 0.152 0.292 0.024
#> ERR342812     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342866     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342820     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342895     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342826     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342875     2   0.000      0.967 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342834     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342898     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342886     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342838     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2   0.164      0.951 0.000 0.936 0.004 0.024 0.036 0.000
#> ERR342873     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342844     4   0.345      0.500 0.000 0.000 0.012 0.744 0.000 0.244
#> ERR342874     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342893     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342859     3   0.101      0.729 0.000 0.000 0.960 0.036 0.000 0.004
#> ERR342830     2   0.115      0.961 0.000 0.956 0.000 0.012 0.032 0.000
#> ERR342880     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR342887     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4   0.745      0.448 0.016 0.000 0.068 0.320 0.288 0.308
#> ERR342881     5   0.571      1.000 0.184 0.000 0.004 0.000 0.536 0.276
#> ERR342858     6   0.000      1.000 0.000 0.000 0.000 0.000 0.000 1.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:pam*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "pam"]
# you can also extract it by
# res = res_list["CV:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4053 0.595   0.595
#> 3 3 1.000           1.000       1.000         0.2811 0.886   0.808
#> 4 4 1.000           0.987       0.986         0.1886 0.902   0.796
#> 5 5 0.929           0.967       0.977         0.1480 0.918   0.786
#> 6 6 0.884           0.946       0.936         0.0865 0.934   0.781

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 3 4

There is also optional best \(k\) = 2 3 4 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette p1 p2
#> ERR342845     1       0          1  1  0
#> ERR342843     1       0          1  1  0
#> ERR342896     1       0          1  1  0
#> ERR342827     2       0          1  0  1
#> ERR342871     1       0          1  1  0
#> ERR342863     2       0          1  0  1
#> ERR342839     1       0          1  1  0
#> ERR342906     1       0          1  1  0
#> ERR342905     2       0          1  0  1
#> ERR342816     1       0          1  1  0
#> ERR342865     2       0          1  0  1
#> ERR342824     1       0          1  1  0
#> ERR342841     2       0          1  0  1
#> ERR342835     1       0          1  1  0
#> ERR342899     2       0          1  0  1
#> ERR342829     1       0          1  1  0
#> ERR342850     1       0          1  1  0
#> ERR342849     2       0          1  0  1
#> ERR342811     1       0          1  1  0
#> ERR342837     1       0          1  1  0
#> ERR342857     1       0          1  1  0
#> ERR342869     1       0          1  1  0
#> ERR342903     1       0          1  1  0
#> ERR342819     1       0          1  1  0
#> ERR342885     1       0          1  1  0
#> ERR342889     2       0          1  0  1
#> ERR342864     1       0          1  1  0
#> ERR342860     2       0          1  0  1
#> ERR342808     1       0          1  1  0
#> ERR342823     1       0          1  1  0
#> ERR342907     2       0          1  0  1
#> ERR342852     1       0          1  1  0
#> ERR342832     2       0          1  0  1
#> ERR342868     1       0          1  1  0
#> ERR342821     1       0          1  1  0
#> ERR342878     2       0          1  0  1
#> ERR342876     1       0          1  1  0
#> ERR342809     1       0          1  1  0
#> ERR342846     1       0          1  1  0
#> ERR342872     2       0          1  0  1
#> ERR342828     2       0          1  0  1
#> ERR342840     1       0          1  1  0
#> ERR342831     1       0          1  1  0
#> ERR342818     1       0          1  1  0
#> ERR342862     1       0          1  1  0
#> ERR342894     1       0          1  1  0
#> ERR342884     2       0          1  0  1
#> ERR342891     1       0          1  1  0
#> ERR342890     1       0          1  1  0
#> ERR342836     2       0          1  0  1
#> ERR342879     1       0          1  1  0
#> ERR342848     1       0          1  1  0
#> ERR342861     1       0          1  1  0
#> ERR342814     2       0          1  0  1
#> ERR342870     1       0          1  1  0
#> ERR342901     1       0          1  1  0
#> ERR342908     1       0          1  1  0
#> ERR342815     2       0          1  0  1
#> ERR342897     1       0          1  1  0
#> ERR342833     2       0          1  0  1
#> ERR342817     1       0          1  1  0
#> ERR342810     2       0          1  0  1
#> ERR342867     1       0          1  1  0
#> ERR342847     1       0          1  1  0
#> ERR342855     1       0          1  1  0
#> ERR342851     1       0          1  1  0
#> ERR342813     1       0          1  1  0
#> ERR342883     1       0          1  1  0
#> ERR342856     1       0          1  1  0
#> ERR342822     2       0          1  0  1
#> ERR342892     1       0          1  1  0
#> ERR342842     1       0          1  1  0
#> ERR342902     2       0          1  0  1
#> ERR342900     2       0          1  0  1
#> ERR342888     1       0          1  1  0
#> ERR342812     1       0          1  1  0
#> ERR342853     2       0          1  0  1
#> ERR342866     1       0          1  1  0
#> ERR342820     1       0          1  1  0
#> ERR342895     1       0          1  1  0
#> ERR342825     1       0          1  1  0
#> ERR342826     1       0          1  1  0
#> ERR342875     2       0          1  0  1
#> ERR342834     1       0          1  1  0
#> ERR342898     1       0          1  1  0
#> ERR342886     2       0          1  0  1
#> ERR342838     1       0          1  1  0
#> ERR342882     1       0          1  1  0
#> ERR342807     2       0          1  0  1
#> ERR342873     1       0          1  1  0
#> ERR342844     1       0          1  1  0
#> ERR342874     1       0          1  1  0
#> ERR342893     1       0          1  1  0
#> ERR342859     1       0          1  1  0
#> ERR342830     2       0          1  0  1
#> ERR342880     1       0          1  1  0
#> ERR342887     1       0          1  1  0
#> ERR342854     1       0          1  1  0
#> ERR342904     1       0          1  1  0
#> ERR342881     1       0          1  1  0
#> ERR342858     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette p1 p2 p3
#> ERR342845     1       0          1  1  0  0
#> ERR342843     1       0          1  1  0  0
#> ERR342896     1       0          1  1  0  0
#> ERR342827     2       0          1  0  1  0
#> ERR342871     1       0          1  1  0  0
#> ERR342863     2       0          1  0  1  0
#> ERR342839     1       0          1  1  0  0
#> ERR342906     1       0          1  1  0  0
#> ERR342905     2       0          1  0  1  0
#> ERR342816     1       0          1  1  0  0
#> ERR342865     2       0          1  0  1  0
#> ERR342824     1       0          1  1  0  0
#> ERR342841     2       0          1  0  1  0
#> ERR342835     1       0          1  1  0  0
#> ERR342899     2       0          1  0  1  0
#> ERR342829     1       0          1  1  0  0
#> ERR342850     1       0          1  1  0  0
#> ERR342849     2       0          1  0  1  0
#> ERR342811     1       0          1  1  0  0
#> ERR342837     1       0          1  1  0  0
#> ERR342857     1       0          1  1  0  0
#> ERR342869     1       0          1  1  0  0
#> ERR342903     1       0          1  1  0  0
#> ERR342819     1       0          1  1  0  0
#> ERR342885     3       0          1  0  0  1
#> ERR342889     2       0          1  0  1  0
#> ERR342864     1       0          1  1  0  0
#> ERR342860     2       0          1  0  1  0
#> ERR342808     1       0          1  1  0  0
#> ERR342823     1       0          1  1  0  0
#> ERR342907     2       0          1  0  1  0
#> ERR342852     1       0          1  1  0  0
#> ERR342832     2       0          1  0  1  0
#> ERR342868     1       0          1  1  0  0
#> ERR342821     1       0          1  1  0  0
#> ERR342878     2       0          1  0  1  0
#> ERR342876     1       0          1  1  0  0
#> ERR342809     1       0          1  1  0  0
#> ERR342846     3       0          1  0  0  1
#> ERR342872     2       0          1  0  1  0
#> ERR342828     2       0          1  0  1  0
#> ERR342840     1       0          1  1  0  0
#> ERR342831     1       0          1  1  0  0
#> ERR342818     1       0          1  1  0  0
#> ERR342862     1       0          1  1  0  0
#> ERR342894     1       0          1  1  0  0
#> ERR342884     2       0          1  0  1  0
#> ERR342891     1       0          1  1  0  0
#> ERR342890     1       0          1  1  0  0
#> ERR342836     2       0          1  0  1  0
#> ERR342879     1       0          1  1  0  0
#> ERR342848     1       0          1  1  0  0
#> ERR342861     1       0          1  1  0  0
#> ERR342814     2       0          1  0  1  0
#> ERR342870     1       0          1  1  0  0
#> ERR342901     1       0          1  1  0  0
#> ERR342908     1       0          1  1  0  0
#> ERR342815     2       0          1  0  1  0
#> ERR342897     3       0          1  0  0  1
#> ERR342833     2       0          1  0  1  0
#> ERR342817     3       0          1  0  0  1
#> ERR342810     2       0          1  0  1  0
#> ERR342867     1       0          1  1  0  0
#> ERR342847     1       0          1  1  0  0
#> ERR342855     1       0          1  1  0  0
#> ERR342851     1       0          1  1  0  0
#> ERR342813     1       0          1  1  0  0
#> ERR342883     1       0          1  1  0  0
#> ERR342856     3       0          1  0  0  1
#> ERR342822     2       0          1  0  1  0
#> ERR342892     1       0          1  1  0  0
#> ERR342842     1       0          1  1  0  0
#> ERR342902     2       0          1  0  1  0
#> ERR342900     2       0          1  0  1  0
#> ERR342888     1       0          1  1  0  0
#> ERR342812     1       0          1  1  0  0
#> ERR342853     2       0          1  0  1  0
#> ERR342866     1       0          1  1  0  0
#> ERR342820     1       0          1  1  0  0
#> ERR342895     1       0          1  1  0  0
#> ERR342825     3       0          1  0  0  1
#> ERR342826     3       0          1  0  0  1
#> ERR342875     2       0          1  0  1  0
#> ERR342834     3       0          1  0  0  1
#> ERR342898     1       0          1  1  0  0
#> ERR342886     2       0          1  0  1  0
#> ERR342838     1       0          1  1  0  0
#> ERR342882     1       0          1  1  0  0
#> ERR342807     2       0          1  0  1  0
#> ERR342873     1       0          1  1  0  0
#> ERR342844     1       0          1  1  0  0
#> ERR342874     1       0          1  1  0  0
#> ERR342893     1       0          1  1  0  0
#> ERR342859     3       0          1  0  0  1
#> ERR342830     2       0          1  0  1  0
#> ERR342880     1       0          1  1  0  0
#> ERR342887     1       0          1  1  0  0
#> ERR342854     1       0          1  1  0  0
#> ERR342904     1       0          1  1  0  0
#> ERR342881     1       0          1  1  0  0
#> ERR342858     1       0          1  1  0  0

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette   p1 p2 p3   p4
#> ERR342845     1   0.201      1.000 0.92  0  0 0.08
#> ERR342843     1   0.201      1.000 0.92  0  0 0.08
#> ERR342896     4   0.000      0.986 0.00  0  0 1.00
#> ERR342827     2   0.000      1.000 0.00  1  0 0.00
#> ERR342871     4   0.000      0.986 0.00  0  0 1.00
#> ERR342863     2   0.000      1.000 0.00  1  0 0.00
#> ERR342839     1   0.201      1.000 0.92  0  0 0.08
#> ERR342906     4   0.201      0.923 0.08  0  0 0.92
#> ERR342905     2   0.000      1.000 0.00  1  0 0.00
#> ERR342816     4   0.201      0.923 0.08  0  0 0.92
#> ERR342865     2   0.000      1.000 0.00  1  0 0.00
#> ERR342824     4   0.000      0.986 0.00  0  0 1.00
#> ERR342841     2   0.000      1.000 0.00  1  0 0.00
#> ERR342835     4   0.000      0.986 0.00  0  0 1.00
#> ERR342899     2   0.000      1.000 0.00  1  0 0.00
#> ERR342829     4   0.000      0.986 0.00  0  0 1.00
#> ERR342850     4   0.000      0.986 0.00  0  0 1.00
#> ERR342849     2   0.000      1.000 0.00  1  0 0.00
#> ERR342811     4   0.000      0.986 0.00  0  0 1.00
#> ERR342837     4   0.000      0.986 0.00  0  0 1.00
#> ERR342857     4   0.201      0.923 0.08  0  0 0.92
#> ERR342869     4   0.000      0.986 0.00  0  0 1.00
#> ERR342903     4   0.000      0.986 0.00  0  0 1.00
#> ERR342819     4   0.000      0.986 0.00  0  0 1.00
#> ERR342885     3   0.000      1.000 0.00  0  1 0.00
#> ERR342889     2   0.000      1.000 0.00  1  0 0.00
#> ERR342864     4   0.201      0.923 0.08  0  0 0.92
#> ERR342860     2   0.000      1.000 0.00  1  0 0.00
#> ERR342808     4   0.000      0.986 0.00  0  0 1.00
#> ERR342823     4   0.000      0.986 0.00  0  0 1.00
#> ERR342907     2   0.000      1.000 0.00  1  0 0.00
#> ERR342852     4   0.201      0.923 0.08  0  0 0.92
#> ERR342832     2   0.000      1.000 0.00  1  0 0.00
#> ERR342868     1   0.201      1.000 0.92  0  0 0.08
#> ERR342821     4   0.201      0.923 0.08  0  0 0.92
#> ERR342878     2   0.000      1.000 0.00  1  0 0.00
#> ERR342876     4   0.000      0.986 0.00  0  0 1.00
#> ERR342809     4   0.000      0.986 0.00  0  0 1.00
#> ERR342846     3   0.000      1.000 0.00  0  1 0.00
#> ERR342872     2   0.000      1.000 0.00  1  0 0.00
#> ERR342828     2   0.000      1.000 0.00  1  0 0.00
#> ERR342840     4   0.000      0.986 0.00  0  0 1.00
#> ERR342831     1   0.201      1.000 0.92  0  0 0.08
#> ERR342818     4   0.000      0.986 0.00  0  0 1.00
#> ERR342862     4   0.000      0.986 0.00  0  0 1.00
#> ERR342894     1   0.201      1.000 0.92  0  0 0.08
#> ERR342884     2   0.000      1.000 0.00  1  0 0.00
#> ERR342891     4   0.000      0.986 0.00  0  0 1.00
#> ERR342890     1   0.201      1.000 0.92  0  0 0.08
#> ERR342836     2   0.000      1.000 0.00  1  0 0.00
#> ERR342879     4   0.000      0.986 0.00  0  0 1.00
#> ERR342848     4   0.000      0.986 0.00  0  0 1.00
#> ERR342861     4   0.000      0.986 0.00  0  0 1.00
#> ERR342814     2   0.000      1.000 0.00  1  0 0.00
#> ERR342870     4   0.000      0.986 0.00  0  0 1.00
#> ERR342901     4   0.000      0.986 0.00  0  0 1.00
#> ERR342908     4   0.000      0.986 0.00  0  0 1.00
#> ERR342815     2   0.000      1.000 0.00  1  0 0.00
#> ERR342897     3   0.000      1.000 0.00  0  1 0.00
#> ERR342833     2   0.000      1.000 0.00  1  0 0.00
#> ERR342817     3   0.000      1.000 0.00  0  1 0.00
#> ERR342810     2   0.000      1.000 0.00  1  0 0.00
#> ERR342867     4   0.201      0.923 0.08  0  0 0.92
#> ERR342847     4   0.000      0.986 0.00  0  0 1.00
#> ERR342855     4   0.000      0.986 0.00  0  0 1.00
#> ERR342851     4   0.000      0.986 0.00  0  0 1.00
#> ERR342813     1   0.201      1.000 0.92  0  0 0.08
#> ERR342883     4   0.000      0.986 0.00  0  0 1.00
#> ERR342856     3   0.000      1.000 0.00  0  1 0.00
#> ERR342822     2   0.000      1.000 0.00  1  0 0.00
#> ERR342892     4   0.000      0.986 0.00  0  0 1.00
#> ERR342842     4   0.000      0.986 0.00  0  0 1.00
#> ERR342902     2   0.000      1.000 0.00  1  0 0.00
#> ERR342900     2   0.000      1.000 0.00  1  0 0.00
#> ERR342888     1   0.201      1.000 0.92  0  0 0.08
#> ERR342812     4   0.000      0.986 0.00  0  0 1.00
#> ERR342853     2   0.000      1.000 0.00  1  0 0.00
#> ERR342866     4   0.000      0.986 0.00  0  0 1.00
#> ERR342820     4   0.000      0.986 0.00  0  0 1.00
#> ERR342895     4   0.000      0.986 0.00  0  0 1.00
#> ERR342825     3   0.000      1.000 0.00  0  1 0.00
#> ERR342826     3   0.000      1.000 0.00  0  1 0.00
#> ERR342875     2   0.000      1.000 0.00  1  0 0.00
#> ERR342834     3   0.000      1.000 0.00  0  1 0.00
#> ERR342898     4   0.201      0.923 0.08  0  0 0.92
#> ERR342886     2   0.000      1.000 0.00  1  0 0.00
#> ERR342838     4   0.000      0.986 0.00  0  0 1.00
#> ERR342882     4   0.000      0.986 0.00  0  0 1.00
#> ERR342807     2   0.000      1.000 0.00  1  0 0.00
#> ERR342873     4   0.000      0.986 0.00  0  0 1.00
#> ERR342844     4   0.201      0.923 0.08  0  0 0.92
#> ERR342874     4   0.000      0.986 0.00  0  0 1.00
#> ERR342893     4   0.000      0.986 0.00  0  0 1.00
#> ERR342859     3   0.000      1.000 0.00  0  1 0.00
#> ERR342830     2   0.000      1.000 0.00  1  0 0.00
#> ERR342880     4   0.000      0.986 0.00  0  0 1.00
#> ERR342887     4   0.000      0.986 0.00  0  0 1.00
#> ERR342854     4   0.000      0.986 0.00  0  0 1.00
#> ERR342904     4   0.000      0.986 0.00  0  0 1.00
#> ERR342881     4   0.000      0.986 0.00  0  0 1.00
#> ERR342858     4   0.000      0.986 0.00  0  0 1.00

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1 p2 p3    p4 p5
#> ERR342845     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342843     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342896     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342827     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342871     1  0.1732      0.925 0.920  0  0 0.080  0
#> ERR342863     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342839     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342906     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342905     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342816     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342865     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342824     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342841     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342835     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342899     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342829     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342850     1  0.1671      0.927 0.924  0  0 0.076  0
#> ERR342849     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342811     1  0.1544      0.930 0.932  0  0 0.068  0
#> ERR342837     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342857     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342869     1  0.1792      0.923 0.916  0  0 0.084  0
#> ERR342903     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342819     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342885     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342889     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342864     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342860     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342808     1  0.1608      0.929 0.928  0  0 0.072  0
#> ERR342823     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342907     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342852     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342832     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342868     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342821     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342878     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342876     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342809     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342846     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342872     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342828     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342840     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342831     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342818     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342862     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342894     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342884     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342891     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342890     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342836     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342879     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342848     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342861     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342814     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342870     1  0.1671      0.927 0.924  0  0 0.076  0
#> ERR342901     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342908     1  0.1544      0.930 0.932  0  0 0.068  0
#> ERR342815     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342897     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342833     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342817     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342810     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342867     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342847     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342855     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342851     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342813     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342883     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342856     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342822     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342892     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342842     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342902     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342900     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342888     5  0.0000      1.000 0.000  0  0 0.000  1
#> ERR342812     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342853     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342866     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342820     1  0.1671      0.927 0.924  0  0 0.076  0
#> ERR342895     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342825     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342826     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342875     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342834     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342898     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342886     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342838     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342882     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342807     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342873     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342844     4  0.0290      1.000 0.008  0  0 0.992  0
#> ERR342874     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342893     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342859     3  0.0000      1.000 0.000  0  1 0.000  0
#> ERR342830     2  0.0000      1.000 0.000  1  0 0.000  0
#> ERR342880     1  0.2852      0.862 0.828  0  0 0.172  0
#> ERR342887     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342854     1  0.0000      0.950 1.000  0  0 0.000  0
#> ERR342904     1  0.1732      0.925 0.920  0  0 0.080  0
#> ERR342881     1  0.0162      0.950 0.996  0  0 0.004  0
#> ERR342858     1  0.2852      0.862 0.828  0  0 0.172  0

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1 p2 p3   p4 p5    p6
#> ERR342845     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342843     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342896     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342827     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342871     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342863     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342839     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342906     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342905     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342816     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342865     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342824     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342841     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342835     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342899     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342829     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342850     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342849     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342811     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342837     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342857     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342869     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342903     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342819     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342885     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342889     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342864     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342860     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342808     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342823     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342907     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342852     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342832     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342868     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342821     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342878     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342876     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342809     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342846     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342872     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342828     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342840     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342831     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342818     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342862     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342894     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342884     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342891     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342890     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342836     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342879     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342848     6   0.472      0.993 0.180  0  0 0.14  0 0.680
#> ERR342861     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342814     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342870     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342901     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342908     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342815     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342897     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342833     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342817     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342810     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342867     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342847     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342855     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342851     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342813     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342883     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342856     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342822     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342892     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342842     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342902     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342900     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342888     5   0.000      1.000 0.000  0  0 0.00  1 0.000
#> ERR342812     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342853     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342866     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342820     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342895     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342825     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342826     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342875     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342834     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342898     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342886     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342838     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342882     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342807     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342873     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342844     4   0.000      1.000 0.000  0  0 1.00  0 0.000
#> ERR342874     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342893     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342859     3   0.000      1.000 0.000  0  1 0.00  0 0.000
#> ERR342830     2   0.000      1.000 0.000  1  0 0.00  0 0.000
#> ERR342880     6   0.469      0.999 0.176  0  0 0.14  0 0.684
#> ERR342887     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342854     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342904     1   0.350      0.687 0.680  0  0 0.00  0 0.320
#> ERR342881     1   0.000      0.907 1.000  0  0 0.00  0 0.000
#> ERR342858     6   0.469      0.999 0.176  0  0 0.14  0 0.684

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "mclust"]
# you can also extract it by
# res = res_list["CV:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.203           0.759       0.817         0.4527 0.499   0.499
#> 3 3 0.554           0.548       0.700         0.3909 0.636   0.391
#> 4 4 0.702           0.769       0.845         0.0926 0.950   0.849
#> 5 5 0.838           0.872       0.898         0.1161 0.952   0.829
#> 6 6 0.786           0.807       0.823         0.0467 0.882   0.582

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     2  0.9710      0.281 0.400 0.600
#> ERR342843     2  0.9710      0.281 0.400 0.600
#> ERR342896     1  0.5737      0.778 0.864 0.136
#> ERR342827     2  0.0672      0.865 0.008 0.992
#> ERR342871     1  0.7883      0.759 0.764 0.236
#> ERR342863     2  0.0376      0.865 0.004 0.996
#> ERR342839     2  0.9710      0.281 0.400 0.600
#> ERR342906     1  0.8443      0.774 0.728 0.272
#> ERR342905     2  0.0672      0.865 0.008 0.992
#> ERR342816     1  0.8443      0.774 0.728 0.272
#> ERR342865     2  0.0376      0.865 0.004 0.996
#> ERR342824     1  0.7453      0.794 0.788 0.212
#> ERR342841     2  0.0672      0.865 0.008 0.992
#> ERR342835     1  0.7883      0.790 0.764 0.236
#> ERR342899     2  0.0672      0.865 0.008 0.992
#> ERR342829     1  0.5737      0.778 0.864 0.136
#> ERR342850     1  0.7883      0.759 0.764 0.236
#> ERR342849     2  0.0672      0.865 0.008 0.992
#> ERR342811     1  0.7883      0.759 0.764 0.236
#> ERR342837     1  0.7883      0.790 0.764 0.236
#> ERR342857     1  0.8443      0.774 0.728 0.272
#> ERR342869     1  0.7883      0.759 0.764 0.236
#> ERR342903     1  0.5737      0.778 0.864 0.136
#> ERR342819     1  0.7883      0.790 0.764 0.236
#> ERR342885     2  0.5408      0.811 0.124 0.876
#> ERR342889     2  0.0376      0.865 0.004 0.996
#> ERR342864     1  0.8443      0.774 0.728 0.272
#> ERR342860     2  0.0672      0.865 0.008 0.992
#> ERR342808     1  0.7883      0.759 0.764 0.236
#> ERR342823     1  0.7453      0.794 0.788 0.212
#> ERR342907     2  0.0672      0.865 0.008 0.992
#> ERR342852     1  0.8443      0.774 0.728 0.272
#> ERR342832     2  0.0376      0.865 0.004 0.996
#> ERR342868     2  0.9710      0.281 0.400 0.600
#> ERR342821     1  0.8443      0.774 0.728 0.272
#> ERR342878     2  0.0672      0.865 0.008 0.992
#> ERR342876     1  0.5737      0.778 0.864 0.136
#> ERR342809     1  0.5737      0.778 0.864 0.136
#> ERR342846     2  0.5408      0.811 0.124 0.876
#> ERR342872     2  0.0672      0.865 0.008 0.992
#> ERR342828     2  0.0376      0.865 0.004 0.996
#> ERR342840     1  0.7883      0.790 0.764 0.236
#> ERR342831     2  0.9710      0.281 0.400 0.600
#> ERR342818     1  0.7528      0.770 0.784 0.216
#> ERR342862     1  0.7883      0.790 0.764 0.236
#> ERR342894     2  0.9710      0.281 0.400 0.600
#> ERR342884     2  0.0672      0.865 0.008 0.992
#> ERR342891     1  0.5737      0.778 0.864 0.136
#> ERR342890     2  0.9710      0.281 0.400 0.600
#> ERR342836     2  0.0376      0.865 0.004 0.996
#> ERR342879     1  0.7528      0.770 0.784 0.216
#> ERR342848     1  0.7528      0.770 0.784 0.216
#> ERR342861     1  0.5737      0.778 0.864 0.136
#> ERR342814     2  0.0672      0.865 0.008 0.992
#> ERR342870     1  0.7883      0.759 0.764 0.236
#> ERR342901     1  0.5737      0.778 0.864 0.136
#> ERR342908     1  0.7883      0.759 0.764 0.236
#> ERR342815     2  0.0376      0.865 0.004 0.996
#> ERR342897     2  0.5408      0.811 0.124 0.876
#> ERR342833     2  0.0672      0.865 0.008 0.992
#> ERR342817     2  0.5408      0.811 0.124 0.876
#> ERR342810     2  0.0672      0.865 0.008 0.992
#> ERR342867     1  0.8443      0.774 0.728 0.272
#> ERR342847     1  0.7883      0.790 0.764 0.236
#> ERR342855     1  0.5737      0.778 0.864 0.136
#> ERR342851     1  0.7528      0.770 0.784 0.216
#> ERR342813     2  0.9710      0.281 0.400 0.600
#> ERR342883     1  0.7528      0.770 0.784 0.216
#> ERR342856     2  0.5408      0.811 0.124 0.876
#> ERR342822     2  0.0376      0.865 0.004 0.996
#> ERR342892     1  0.5737      0.778 0.864 0.136
#> ERR342842     1  0.5737      0.778 0.864 0.136
#> ERR342902     2  0.0672      0.865 0.008 0.992
#> ERR342900     2  0.0672      0.865 0.008 0.992
#> ERR342888     2  0.9710      0.281 0.400 0.600
#> ERR342812     1  0.5737      0.778 0.864 0.136
#> ERR342853     2  0.0672      0.865 0.008 0.992
#> ERR342866     1  0.7883      0.790 0.764 0.236
#> ERR342820     1  0.7883      0.759 0.764 0.236
#> ERR342895     1  0.5737      0.778 0.864 0.136
#> ERR342825     2  0.5408      0.811 0.124 0.876
#> ERR342826     2  0.5408      0.811 0.124 0.876
#> ERR342875     2  0.0376      0.865 0.004 0.996
#> ERR342834     2  0.5408      0.811 0.124 0.876
#> ERR342898     1  0.8443      0.774 0.728 0.272
#> ERR342886     2  0.0672      0.865 0.008 0.992
#> ERR342838     1  0.5737      0.778 0.864 0.136
#> ERR342882     1  0.5737      0.778 0.864 0.136
#> ERR342807     2  0.0672      0.865 0.008 0.992
#> ERR342873     1  0.7528      0.770 0.784 0.216
#> ERR342844     1  0.8443      0.774 0.728 0.272
#> ERR342874     1  0.7883      0.790 0.764 0.236
#> ERR342893     1  0.7528      0.770 0.784 0.216
#> ERR342859     2  0.5408      0.811 0.124 0.876
#> ERR342830     2  0.0672      0.865 0.008 0.992
#> ERR342880     1  0.7528      0.770 0.784 0.216
#> ERR342887     1  0.5737      0.778 0.864 0.136
#> ERR342854     1  0.5737      0.778 0.864 0.136
#> ERR342904     1  0.7950      0.755 0.760 0.240
#> ERR342881     1  0.7883      0.790 0.764 0.236
#> ERR342858     1  0.7528      0.770 0.784 0.216

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342843     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342896     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342827     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342871     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342863     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342839     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342906     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342905     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342816     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342865     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342824     3  0.6396      0.507 0.320 0.016 0.664
#> ERR342841     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342835     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342899     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342829     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342850     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342849     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342811     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342837     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342857     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342869     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342903     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342819     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342885     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342889     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342864     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342860     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342808     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342823     3  0.6396      0.507 0.320 0.016 0.664
#> ERR342907     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342852     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342832     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342868     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342821     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342878     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342876     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342809     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342846     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342872     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342828     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342840     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342831     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342818     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342862     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342894     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342884     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342891     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342890     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342836     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342879     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342848     1  0.6026      0.474 0.732 0.024 0.244
#> ERR342861     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342814     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342870     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342901     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342908     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342815     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342897     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342833     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342817     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342810     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342867     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342847     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342855     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342851     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342813     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342883     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342856     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342822     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342892     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342842     3  0.6897      0.542 0.292 0.040 0.668
#> ERR342902     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342900     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342888     1  0.9964      0.148 0.372 0.328 0.300
#> ERR342812     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342853     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342866     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342820     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342895     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342825     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342826     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342875     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342834     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342898     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342886     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342838     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342882     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342807     2  0.0747      0.982 0.016 0.984 0.000
#> ERR342873     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342844     1  0.5874      0.507 0.760 0.032 0.208
#> ERR342874     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342893     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342859     3  0.9975     -0.108 0.312 0.320 0.368
#> ERR342830     2  0.0424      0.992 0.000 0.992 0.008
#> ERR342880     1  0.6026      0.485 0.732 0.024 0.244
#> ERR342887     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342854     3  0.6967      0.543 0.288 0.044 0.668
#> ERR342904     1  0.1399      0.526 0.968 0.028 0.004
#> ERR342881     3  0.7389      0.384 0.408 0.036 0.556
#> ERR342858     1  0.6026      0.485 0.732 0.024 0.244

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342843     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342896     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342827     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342871     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342863     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342839     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342906     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342905     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342816     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342865     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0817      0.772 0.976 0.000 0.000 0.024
#> ERR342841     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342835     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342899     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342829     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342850     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342849     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342811     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342837     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342857     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342869     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342903     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342819     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342885     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342889     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342864     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342860     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342808     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342823     1  0.0817      0.772 0.976 0.000 0.000 0.024
#> ERR342907     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342852     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342832     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342868     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342821     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342878     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342876     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342872     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342828     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342840     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342831     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342818     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342862     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342894     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342884     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342891     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342890     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342836     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342879     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342848     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342861     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342814     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342870     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342901     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342908     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342815     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342833     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342817     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342810     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342867     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342847     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342855     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342851     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342813     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342883     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342856     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342822     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342902     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342900     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342888     4  0.6696      0.404 0.104 0.064 0.132 0.700
#> ERR342812     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342853     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342866     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342820     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342895     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342875     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342898     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342886     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342838     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342807     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342873     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342844     4  0.4072      0.761 0.252 0.000 0.000 0.748
#> ERR342874     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342893     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342859     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> ERR342830     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342880     4  0.4382      0.722 0.296 0.000 0.000 0.704
#> ERR342887     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.788 1.000 0.000 0.000 0.000
#> ERR342904     4  0.3942      0.765 0.236 0.000 0.000 0.764
#> ERR342881     1  0.5548      0.207 0.588 0.024 0.000 0.388
#> ERR342858     4  0.4382      0.722 0.296 0.000 0.000 0.704

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2 p3    p4    p5
#> ERR342845     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342843     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342896     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342827     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342871     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342863     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342839     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342906     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342905     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342816     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342865     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342824     1  0.0703      0.776 0.976 0.000  0 0.024 0.000
#> ERR342841     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342835     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342899     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342829     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342850     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342849     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342811     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342837     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342857     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342869     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342903     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342819     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342889     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342864     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342860     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342808     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342823     1  0.0703      0.776 0.976 0.000  0 0.024 0.000
#> ERR342907     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342852     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342832     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342868     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342821     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342878     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342876     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342809     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342872     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342828     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342840     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342831     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342818     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342862     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342894     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342884     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342891     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342890     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342836     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342879     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342848     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342861     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342814     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342870     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342901     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342908     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342815     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342833     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342810     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342867     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342847     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342855     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342851     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342813     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342883     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342822     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342892     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342842     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342902     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342900     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342888     5  0.3143      1.000 0.000 0.000  0 0.204 0.796
#> ERR342812     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342853     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342866     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342820     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342895     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342875     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342898     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342886     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342838     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342882     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342807     2  0.0000      0.991 0.000 1.000  0 0.000 0.000
#> ERR342873     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342844     4  0.2329      0.854 0.000 0.000  0 0.876 0.124
#> ERR342874     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342893     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000 0.000
#> ERR342830     2  0.0794      0.983 0.000 0.972  0 0.000 0.028
#> ERR342880     4  0.0000      0.929 0.000 0.000  0 1.000 0.000
#> ERR342887     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342854     1  0.0290      0.784 0.992 0.000  0 0.008 0.000
#> ERR342904     4  0.0404      0.925 0.000 0.000  0 0.988 0.012
#> ERR342881     1  0.6952      0.349 0.388 0.012  0 0.216 0.384
#> ERR342858     4  0.0000      0.929 0.000 0.000  0 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3    p4    p5    p6
#> ERR342845     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342843     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342896     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342827     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342871     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342863     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342839     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342906     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342905     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342816     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342865     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342824     1  0.3508      0.993 0.704 0.000  0 0.004 0.292 0.000
#> ERR342841     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342835     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342899     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342829     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342850     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342849     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342811     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342837     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342857     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342869     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342903     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342819     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342889     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342864     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342860     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342808     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342823     1  0.3508      0.993 0.704 0.000  0 0.004 0.292 0.000
#> ERR342907     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342852     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342832     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342868     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342821     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342878     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342876     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342809     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342872     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342828     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342840     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342831     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342818     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342862     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342894     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342884     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342891     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342890     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342836     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342879     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342848     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342861     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342814     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342870     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342901     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342908     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342815     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342833     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342810     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342867     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342847     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342855     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342851     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342813     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342883     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342822     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342892     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342842     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342902     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342900     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342888     4  0.7650      0.124 0.292 0.000  0 0.296 0.204 0.208
#> ERR342812     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342853     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342866     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342820     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342895     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342875     2  0.3175      0.747 0.000 0.744  0 0.000 0.000 0.256
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342898     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342886     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342838     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342882     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342807     2  0.0000      0.798 0.000 1.000  0 0.000 0.000 0.000
#> ERR342873     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342844     4  0.0458      0.715 0.000 0.000  0 0.984 0.000 0.016
#> ERR342874     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342893     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342830     6  0.2854      1.000 0.000 0.208  0 0.000 0.000 0.792
#> ERR342880     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000
#> ERR342887     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342854     1  0.3371      0.999 0.708 0.000  0 0.000 0.292 0.000
#> ERR342904     4  0.2092      0.727 0.000 0.000  0 0.876 0.124 0.000
#> ERR342881     5  0.0937      1.000 0.000 0.000  0 0.040 0.960 0.000
#> ERR342858     4  0.1957      0.731 0.000 0.000  0 0.888 0.112 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "NMF"]
# you can also extract it by
# res = res_list["CV:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.836           0.932       0.970         0.4269 0.595   0.595
#> 3 3 0.895           0.958       0.957         0.4321 0.804   0.671
#> 4 4 0.841           0.942       0.941         0.2055 0.850   0.625
#> 5 5 0.804           0.822       0.857         0.0583 0.934   0.752
#> 6 6 0.820           0.838       0.801         0.0441 0.984   0.926

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      0.956 1.000 0.000
#> ERR342843     1   0.000      0.956 1.000 0.000
#> ERR342896     1   0.000      0.956 1.000 0.000
#> ERR342827     2   0.000      1.000 0.000 1.000
#> ERR342871     1   0.000      0.956 1.000 0.000
#> ERR342863     2   0.000      1.000 0.000 1.000
#> ERR342839     1   0.000      0.956 1.000 0.000
#> ERR342906     1   0.000      0.956 1.000 0.000
#> ERR342905     2   0.000      1.000 0.000 1.000
#> ERR342816     1   0.000      0.956 1.000 0.000
#> ERR342865     2   0.000      1.000 0.000 1.000
#> ERR342824     1   0.000      0.956 1.000 0.000
#> ERR342841     2   0.000      1.000 0.000 1.000
#> ERR342835     1   0.000      0.956 1.000 0.000
#> ERR342899     2   0.000      1.000 0.000 1.000
#> ERR342829     1   0.000      0.956 1.000 0.000
#> ERR342850     1   0.000      0.956 1.000 0.000
#> ERR342849     2   0.000      1.000 0.000 1.000
#> ERR342811     1   0.000      0.956 1.000 0.000
#> ERR342837     1   0.000      0.956 1.000 0.000
#> ERR342857     1   0.000      0.956 1.000 0.000
#> ERR342869     1   0.000      0.956 1.000 0.000
#> ERR342903     1   0.000      0.956 1.000 0.000
#> ERR342819     1   0.000      0.956 1.000 0.000
#> ERR342885     1   0.921      0.550 0.664 0.336
#> ERR342889     2   0.000      1.000 0.000 1.000
#> ERR342864     1   0.000      0.956 1.000 0.000
#> ERR342860     2   0.000      1.000 0.000 1.000
#> ERR342808     1   0.000      0.956 1.000 0.000
#> ERR342823     1   0.000      0.956 1.000 0.000
#> ERR342907     2   0.000      1.000 0.000 1.000
#> ERR342852     1   0.000      0.956 1.000 0.000
#> ERR342832     2   0.000      1.000 0.000 1.000
#> ERR342868     1   0.000      0.956 1.000 0.000
#> ERR342821     1   0.000      0.956 1.000 0.000
#> ERR342878     2   0.000      1.000 0.000 1.000
#> ERR342876     1   0.000      0.956 1.000 0.000
#> ERR342809     1   0.000      0.956 1.000 0.000
#> ERR342846     1   0.921      0.550 0.664 0.336
#> ERR342872     2   0.000      1.000 0.000 1.000
#> ERR342828     2   0.000      1.000 0.000 1.000
#> ERR342840     1   0.000      0.956 1.000 0.000
#> ERR342831     1   0.000      0.956 1.000 0.000
#> ERR342818     1   0.000      0.956 1.000 0.000
#> ERR342862     1   0.000      0.956 1.000 0.000
#> ERR342894     1   0.000      0.956 1.000 0.000
#> ERR342884     2   0.000      1.000 0.000 1.000
#> ERR342891     1   0.000      0.956 1.000 0.000
#> ERR342890     1   0.000      0.956 1.000 0.000
#> ERR342836     2   0.000      1.000 0.000 1.000
#> ERR342879     1   0.000      0.956 1.000 0.000
#> ERR342848     1   0.000      0.956 1.000 0.000
#> ERR342861     1   0.000      0.956 1.000 0.000
#> ERR342814     2   0.000      1.000 0.000 1.000
#> ERR342870     1   0.000      0.956 1.000 0.000
#> ERR342901     1   0.000      0.956 1.000 0.000
#> ERR342908     1   0.000      0.956 1.000 0.000
#> ERR342815     2   0.000      1.000 0.000 1.000
#> ERR342897     1   0.921      0.550 0.664 0.336
#> ERR342833     2   0.000      1.000 0.000 1.000
#> ERR342817     1   0.921      0.550 0.664 0.336
#> ERR342810     2   0.000      1.000 0.000 1.000
#> ERR342867     1   0.000      0.956 1.000 0.000
#> ERR342847     1   0.000      0.956 1.000 0.000
#> ERR342855     1   0.000      0.956 1.000 0.000
#> ERR342851     1   0.000      0.956 1.000 0.000
#> ERR342813     1   0.000      0.956 1.000 0.000
#> ERR342883     1   0.000      0.956 1.000 0.000
#> ERR342856     1   0.921      0.550 0.664 0.336
#> ERR342822     2   0.000      1.000 0.000 1.000
#> ERR342892     1   0.000      0.956 1.000 0.000
#> ERR342842     1   0.000      0.956 1.000 0.000
#> ERR342902     2   0.000      1.000 0.000 1.000
#> ERR342900     2   0.000      1.000 0.000 1.000
#> ERR342888     1   0.000      0.956 1.000 0.000
#> ERR342812     1   0.000      0.956 1.000 0.000
#> ERR342853     2   0.000      1.000 0.000 1.000
#> ERR342866     1   0.000      0.956 1.000 0.000
#> ERR342820     1   0.000      0.956 1.000 0.000
#> ERR342895     1   0.000      0.956 1.000 0.000
#> ERR342825     1   0.921      0.550 0.664 0.336
#> ERR342826     1   0.921      0.550 0.664 0.336
#> ERR342875     2   0.000      1.000 0.000 1.000
#> ERR342834     1   0.921      0.550 0.664 0.336
#> ERR342898     1   0.000      0.956 1.000 0.000
#> ERR342886     2   0.000      1.000 0.000 1.000
#> ERR342838     1   0.000      0.956 1.000 0.000
#> ERR342882     1   0.000      0.956 1.000 0.000
#> ERR342807     2   0.000      1.000 0.000 1.000
#> ERR342873     1   0.000      0.956 1.000 0.000
#> ERR342844     1   0.000      0.956 1.000 0.000
#> ERR342874     1   0.000      0.956 1.000 0.000
#> ERR342893     1   0.000      0.956 1.000 0.000
#> ERR342859     1   0.921      0.550 0.664 0.336
#> ERR342830     2   0.000      1.000 0.000 1.000
#> ERR342880     1   0.000      0.956 1.000 0.000
#> ERR342887     1   0.000      0.956 1.000 0.000
#> ERR342854     1   0.000      0.956 1.000 0.000
#> ERR342904     1   0.000      0.956 1.000 0.000
#> ERR342881     1   0.000      0.956 1.000 0.000
#> ERR342858     1   0.000      0.956 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1 p2    p3
#> ERR342845     3  0.1163      0.975 0.028  0 0.972
#> ERR342843     3  0.1031      0.975 0.024  0 0.976
#> ERR342896     1  0.1643      0.943 0.956  0 0.044
#> ERR342827     2  0.0000      1.000 0.000  1 0.000
#> ERR342871     1  0.1964      0.937 0.944  0 0.056
#> ERR342863     2  0.0000      1.000 0.000  1 0.000
#> ERR342839     3  0.1163      0.975 0.028  0 0.972
#> ERR342906     1  0.3752      0.874 0.856  0 0.144
#> ERR342905     2  0.0000      1.000 0.000  1 0.000
#> ERR342816     1  0.3686      0.877 0.860  0 0.140
#> ERR342865     2  0.0000      1.000 0.000  1 0.000
#> ERR342824     1  0.1643      0.943 0.956  0 0.044
#> ERR342841     2  0.0000      1.000 0.000  1 0.000
#> ERR342835     1  0.0237      0.948 0.996  0 0.004
#> ERR342899     2  0.0000      1.000 0.000  1 0.000
#> ERR342829     1  0.1643      0.943 0.956  0 0.044
#> ERR342850     1  0.1964      0.937 0.944  0 0.056
#> ERR342849     2  0.0000      1.000 0.000  1 0.000
#> ERR342811     1  0.1964      0.937 0.944  0 0.056
#> ERR342837     1  0.0237      0.948 0.996  0 0.004
#> ERR342857     1  0.4121      0.848 0.832  0 0.168
#> ERR342869     1  0.1964      0.937 0.944  0 0.056
#> ERR342903     1  0.1643      0.943 0.956  0 0.044
#> ERR342819     1  0.0237      0.948 0.996  0 0.004
#> ERR342885     3  0.0747      0.976 0.016  0 0.984
#> ERR342889     2  0.0000      1.000 0.000  1 0.000
#> ERR342864     1  0.3752      0.874 0.856  0 0.144
#> ERR342860     2  0.0000      1.000 0.000  1 0.000
#> ERR342808     1  0.1964      0.937 0.944  0 0.056
#> ERR342823     1  0.1643      0.943 0.956  0 0.044
#> ERR342907     2  0.0000      1.000 0.000  1 0.000
#> ERR342852     1  0.3816      0.870 0.852  0 0.148
#> ERR342832     2  0.0000      1.000 0.000  1 0.000
#> ERR342868     3  0.1163      0.975 0.028  0 0.972
#> ERR342821     1  0.3686      0.877 0.860  0 0.140
#> ERR342878     2  0.0000      1.000 0.000  1 0.000
#> ERR342876     1  0.1643      0.943 0.956  0 0.044
#> ERR342809     1  0.1643      0.943 0.956  0 0.044
#> ERR342846     3  0.0747      0.976 0.016  0 0.984
#> ERR342872     2  0.0000      1.000 0.000  1 0.000
#> ERR342828     2  0.0000      1.000 0.000  1 0.000
#> ERR342840     1  0.0237      0.948 0.996  0 0.004
#> ERR342831     3  0.1163      0.975 0.028  0 0.972
#> ERR342818     1  0.0892      0.946 0.980  0 0.020
#> ERR342862     1  0.0237      0.948 0.996  0 0.004
#> ERR342894     3  0.1163      0.975 0.028  0 0.972
#> ERR342884     2  0.0000      1.000 0.000  1 0.000
#> ERR342891     1  0.1643      0.943 0.956  0 0.044
#> ERR342890     3  0.1163      0.975 0.028  0 0.972
#> ERR342836     2  0.0000      1.000 0.000  1 0.000
#> ERR342879     1  0.0892      0.946 0.980  0 0.020
#> ERR342848     1  0.0892      0.946 0.980  0 0.020
#> ERR342861     1  0.1643      0.943 0.956  0 0.044
#> ERR342814     2  0.0000      1.000 0.000  1 0.000
#> ERR342870     1  0.1964      0.937 0.944  0 0.056
#> ERR342901     1  0.1643      0.943 0.956  0 0.044
#> ERR342908     1  0.1964      0.937 0.944  0 0.056
#> ERR342815     2  0.0000      1.000 0.000  1 0.000
#> ERR342897     3  0.0747      0.976 0.016  0 0.984
#> ERR342833     2  0.0000      1.000 0.000  1 0.000
#> ERR342817     3  0.0747      0.976 0.016  0 0.984
#> ERR342810     2  0.0000      1.000 0.000  1 0.000
#> ERR342867     1  0.3752      0.874 0.856  0 0.144
#> ERR342847     1  0.0237      0.948 0.996  0 0.004
#> ERR342855     1  0.1643      0.943 0.956  0 0.044
#> ERR342851     1  0.0892      0.946 0.980  0 0.020
#> ERR342813     3  0.0892      0.974 0.020  0 0.980
#> ERR342883     1  0.0892      0.946 0.980  0 0.020
#> ERR342856     3  0.0747      0.976 0.016  0 0.984
#> ERR342822     2  0.0000      1.000 0.000  1 0.000
#> ERR342892     1  0.1643      0.943 0.956  0 0.044
#> ERR342842     1  0.1643      0.943 0.956  0 0.044
#> ERR342902     2  0.0000      1.000 0.000  1 0.000
#> ERR342900     2  0.0000      1.000 0.000  1 0.000
#> ERR342888     3  0.1163      0.975 0.028  0 0.972
#> ERR342812     1  0.1643      0.943 0.956  0 0.044
#> ERR342853     2  0.0000      1.000 0.000  1 0.000
#> ERR342866     1  0.0237      0.948 0.996  0 0.004
#> ERR342820     1  0.1964      0.937 0.944  0 0.056
#> ERR342895     1  0.1643      0.943 0.956  0 0.044
#> ERR342825     3  0.0747      0.976 0.016  0 0.984
#> ERR342826     3  0.0747      0.976 0.016  0 0.984
#> ERR342875     2  0.0000      1.000 0.000  1 0.000
#> ERR342834     3  0.0747      0.976 0.016  0 0.984
#> ERR342898     1  0.3752      0.874 0.856  0 0.144
#> ERR342886     2  0.0000      1.000 0.000  1 0.000
#> ERR342838     1  0.1643      0.943 0.956  0 0.044
#> ERR342882     1  0.1643      0.943 0.956  0 0.044
#> ERR342807     2  0.0000      1.000 0.000  1 0.000
#> ERR342873     1  0.0892      0.946 0.980  0 0.020
#> ERR342844     1  0.3879      0.866 0.848  0 0.152
#> ERR342874     1  0.0237      0.948 0.996  0 0.004
#> ERR342893     1  0.0892      0.946 0.980  0 0.020
#> ERR342859     3  0.0747      0.976 0.016  0 0.984
#> ERR342830     2  0.0000      1.000 0.000  1 0.000
#> ERR342880     1  0.0892      0.946 0.980  0 0.020
#> ERR342887     1  0.1643      0.943 0.956  0 0.044
#> ERR342854     1  0.1643      0.943 0.956  0 0.044
#> ERR342904     1  0.1964      0.937 0.944  0 0.056
#> ERR342881     1  0.0237      0.948 0.996  0 0.004
#> ERR342858     1  0.0892      0.946 0.980  0 0.020

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.5464      0.832 0.072 0.000 0.716 0.212
#> ERR342843     3  0.5397      0.833 0.068 0.000 0.720 0.212
#> ERR342896     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342827     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342871     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342863     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342839     3  0.5464      0.832 0.072 0.000 0.716 0.212
#> ERR342906     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342905     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342816     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342865     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342824     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342841     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342835     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342899     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342829     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342850     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342849     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342811     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342837     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342857     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342869     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342903     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342819     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342885     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342889     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342864     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342860     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342808     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342823     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342907     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342852     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342832     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342868     3  0.5397      0.833 0.068 0.000 0.720 0.212
#> ERR342821     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342878     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342876     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342809     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342846     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342872     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342828     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342840     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342831     3  0.5464      0.832 0.072 0.000 0.716 0.212
#> ERR342818     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342862     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342894     3  0.5397      0.833 0.068 0.000 0.720 0.212
#> ERR342884     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342891     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342890     3  0.5464      0.832 0.072 0.000 0.716 0.212
#> ERR342836     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342879     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342848     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342861     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342814     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342870     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342901     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342908     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342815     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342897     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342833     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342817     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342810     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342867     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342847     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342855     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342851     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342813     3  0.5397      0.833 0.068 0.000 0.720 0.212
#> ERR342883     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342856     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342822     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342892     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342842     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342902     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342900     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342888     3  0.5397      0.833 0.068 0.000 0.720 0.212
#> ERR342812     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342853     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342866     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342820     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342895     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342825     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342826     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342875     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342834     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342898     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342886     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342838     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342882     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342807     2  0.1398      0.974 0.000 0.956 0.004 0.040
#> ERR342873     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342844     4  0.0657      0.942 0.000 0.012 0.004 0.984
#> ERR342874     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342893     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342859     3  0.0524      0.859 0.008 0.000 0.988 0.004
#> ERR342830     2  0.0000      0.988 0.000 1.000 0.000 0.000
#> ERR342880     4  0.1637      0.964 0.060 0.000 0.000 0.940
#> ERR342887     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342854     1  0.1637      0.963 0.940 0.000 0.000 0.060
#> ERR342904     4  0.1978      0.962 0.068 0.000 0.004 0.928
#> ERR342881     1  0.1576      0.919 0.948 0.000 0.004 0.048
#> ERR342858     4  0.1637      0.964 0.060 0.000 0.000 0.940

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342843     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342871     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342863     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342906     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342905     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342816     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342865     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342835     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342899     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342849     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342811     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342837     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342857     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342869     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342885     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342889     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342860     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342808     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342852     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342832     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342868     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342821     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342878     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342872     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342828     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342831     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342818     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342862     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342894     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342884     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342836     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342879     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342848     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342870     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342815     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342897     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342833     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342817     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342810     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342867     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342847     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342813     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342883     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342856     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342822     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342900     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342888     5  0.6495      0.501 0.036 0.000 0.196 0.168 0.600
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342866     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342820     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342826     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342875     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342898     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342886     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.3475      0.868 0.000 0.804 0.004 0.012 0.180
#> ERR342873     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342844     4  0.2280      0.797 0.000 0.000 0.000 0.880 0.120
#> ERR342874     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342893     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342859     3  0.0162      1.000 0.004 0.000 0.996 0.000 0.000
#> ERR342830     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000
#> ERR342880     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.3278      0.781 0.020 0.000 0.000 0.824 0.156
#> ERR342881     5  0.5601      0.406 0.448 0.000 0.000 0.072 0.480
#> ERR342858     4  0.2930      0.775 0.004 0.000 0.000 0.832 0.164

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.2415      0.995 0.024 0.000 0.036 0.040 0.900 0.000
#> ERR342843     5  0.2403      0.996 0.020 0.000 0.040 0.040 0.900 0.000
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342871     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342863     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342839     5  0.2415      0.995 0.024 0.000 0.036 0.040 0.900 0.000
#> ERR342906     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342905     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342816     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342865     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342835     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342899     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342849     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342811     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342837     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342857     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342869     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342885     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342889     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342864     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342860     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342808     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342852     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342832     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342868     5  0.2403      0.996 0.020 0.000 0.040 0.040 0.900 0.000
#> ERR342821     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342878     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342872     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342828     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342840     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342831     5  0.2415      0.995 0.024 0.000 0.036 0.040 0.900 0.000
#> ERR342818     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342862     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342894     5  0.2403      0.996 0.020 0.000 0.040 0.040 0.900 0.000
#> ERR342884     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.2415      0.995 0.024 0.000 0.036 0.040 0.900 0.000
#> ERR342836     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342879     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342848     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342870     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342815     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342897     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342833     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342817     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342810     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342867     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342847     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342813     5  0.2403      0.996 0.020 0.000 0.040 0.040 0.900 0.000
#> ERR342883     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342856     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342822     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342900     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342888     5  0.2403      0.996 0.020 0.000 0.040 0.040 0.900 0.000
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342866     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342820     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342826     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342875     2  0.0146      0.890 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR342834     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342898     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342886     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.4617      0.747 0.000 0.652 0.000 0.004 0.060 0.284
#> ERR342873     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342844     4  0.5029      0.588 0.000 0.000 0.004 0.656 0.172 0.168
#> ERR342874     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342893     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342859     3  0.0146      1.000 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR342830     2  0.0000      0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342880     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.2926      0.586 0.004 0.000 0.000 0.844 0.124 0.028
#> ERR342881     6  0.6239      1.000 0.152 0.000 0.000 0.036 0.316 0.496
#> ERR342858     4  0.4509      0.493 0.000 0.000 0.000 0.532 0.032 0.436

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "hclust"]
# you can also extract it by
# res = res_list["MAD:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.674           0.929       0.956          0.442 0.531   0.531
#> 3 3 0.642           0.921       0.957          0.194 0.950   0.906
#> 4 4 0.561           0.764       0.847          0.293 0.836   0.659
#> 5 5 0.613           0.672       0.791          0.064 0.868   0.670
#> 6 6 0.834           0.828       0.917          0.107 0.868   0.622

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      0.991 1.000 0.000
#> ERR342843     1   0.000      0.991 1.000 0.000
#> ERR342896     1   0.000      0.991 1.000 0.000
#> ERR342827     2   0.000      0.882 0.000 1.000
#> ERR342871     1   0.184      0.976 0.972 0.028
#> ERR342863     2   0.000      0.882 0.000 1.000
#> ERR342839     1   0.000      0.991 1.000 0.000
#> ERR342906     1   0.184      0.976 0.972 0.028
#> ERR342905     2   0.584      0.846 0.140 0.860
#> ERR342816     1   0.184      0.976 0.972 0.028
#> ERR342865     2   0.000      0.882 0.000 1.000
#> ERR342824     1   0.000      0.991 1.000 0.000
#> ERR342841     2   0.000      0.882 0.000 1.000
#> ERR342835     1   0.000      0.991 1.000 0.000
#> ERR342899     2   0.584      0.846 0.140 0.860
#> ERR342829     1   0.000      0.991 1.000 0.000
#> ERR342850     1   0.184      0.976 0.972 0.028
#> ERR342849     2   0.584      0.846 0.140 0.860
#> ERR342811     1   0.184      0.976 0.972 0.028
#> ERR342837     1   0.000      0.991 1.000 0.000
#> ERR342857     1   0.184      0.976 0.972 0.028
#> ERR342869     1   0.184      0.976 0.972 0.028
#> ERR342903     1   0.000      0.991 1.000 0.000
#> ERR342819     1   0.000      0.991 1.000 0.000
#> ERR342885     2   0.855      0.704 0.280 0.720
#> ERR342889     2   0.000      0.882 0.000 1.000
#> ERR342864     1   0.184      0.976 0.972 0.028
#> ERR342860     2   0.584      0.846 0.140 0.860
#> ERR342808     1   0.184      0.976 0.972 0.028
#> ERR342823     1   0.000      0.991 1.000 0.000
#> ERR342907     2   0.000      0.882 0.000 1.000
#> ERR342852     1   0.184      0.976 0.972 0.028
#> ERR342832     2   0.000      0.882 0.000 1.000
#> ERR342868     1   0.000      0.991 1.000 0.000
#> ERR342821     1   0.184      0.976 0.972 0.028
#> ERR342878     2   0.000      0.882 0.000 1.000
#> ERR342876     1   0.000      0.991 1.000 0.000
#> ERR342809     1   0.000      0.991 1.000 0.000
#> ERR342846     2   0.855      0.704 0.280 0.720
#> ERR342872     2   0.000      0.882 0.000 1.000
#> ERR342828     2   0.000      0.882 0.000 1.000
#> ERR342840     1   0.000      0.991 1.000 0.000
#> ERR342831     1   0.000      0.991 1.000 0.000
#> ERR342818     1   0.000      0.991 1.000 0.000
#> ERR342862     1   0.000      0.991 1.000 0.000
#> ERR342894     1   0.000      0.991 1.000 0.000
#> ERR342884     2   0.000      0.882 0.000 1.000
#> ERR342891     1   0.000      0.991 1.000 0.000
#> ERR342890     1   0.000      0.991 1.000 0.000
#> ERR342836     2   0.000      0.882 0.000 1.000
#> ERR342879     1   0.000      0.991 1.000 0.000
#> ERR342848     1   0.000      0.991 1.000 0.000
#> ERR342861     1   0.000      0.991 1.000 0.000
#> ERR342814     2   0.584      0.846 0.140 0.860
#> ERR342870     1   0.184      0.976 0.972 0.028
#> ERR342901     1   0.000      0.991 1.000 0.000
#> ERR342908     1   0.184      0.976 0.972 0.028
#> ERR342815     2   0.000      0.882 0.000 1.000
#> ERR342897     2   0.855      0.704 0.280 0.720
#> ERR342833     2   0.000      0.882 0.000 1.000
#> ERR342817     2   0.855      0.704 0.280 0.720
#> ERR342810     2   0.584      0.846 0.140 0.860
#> ERR342867     1   0.184      0.976 0.972 0.028
#> ERR342847     1   0.000      0.991 1.000 0.000
#> ERR342855     1   0.000      0.991 1.000 0.000
#> ERR342851     1   0.000      0.991 1.000 0.000
#> ERR342813     1   0.000      0.991 1.000 0.000
#> ERR342883     1   0.000      0.991 1.000 0.000
#> ERR342856     2   0.855      0.704 0.280 0.720
#> ERR342822     2   0.000      0.882 0.000 1.000
#> ERR342892     1   0.000      0.991 1.000 0.000
#> ERR342842     1   0.000      0.991 1.000 0.000
#> ERR342902     2   0.000      0.882 0.000 1.000
#> ERR342900     2   0.584      0.846 0.140 0.860
#> ERR342888     1   0.000      0.991 1.000 0.000
#> ERR342812     1   0.000      0.991 1.000 0.000
#> ERR342853     2   0.584      0.846 0.140 0.860
#> ERR342866     1   0.000      0.991 1.000 0.000
#> ERR342820     1   0.184      0.976 0.972 0.028
#> ERR342895     1   0.000      0.991 1.000 0.000
#> ERR342825     2   0.855      0.704 0.280 0.720
#> ERR342826     2   0.855      0.704 0.280 0.720
#> ERR342875     2   0.000      0.882 0.000 1.000
#> ERR342834     2   0.855      0.704 0.280 0.720
#> ERR342898     1   0.184      0.976 0.972 0.028
#> ERR342886     2   0.584      0.846 0.140 0.860
#> ERR342838     1   0.000      0.991 1.000 0.000
#> ERR342882     1   0.000      0.991 1.000 0.000
#> ERR342807     2   0.000      0.882 0.000 1.000
#> ERR342873     1   0.000      0.991 1.000 0.000
#> ERR342844     1   0.184      0.976 0.972 0.028
#> ERR342874     1   0.000      0.991 1.000 0.000
#> ERR342893     1   0.000      0.991 1.000 0.000
#> ERR342859     2   0.855      0.704 0.280 0.720
#> ERR342830     2   0.584      0.846 0.140 0.860
#> ERR342880     1   0.000      0.991 1.000 0.000
#> ERR342887     1   0.000      0.991 1.000 0.000
#> ERR342854     1   0.000      0.991 1.000 0.000
#> ERR342904     1   0.184      0.976 0.972 0.028
#> ERR342881     1   0.000      0.991 1.000 0.000
#> ERR342858     1   0.000      0.991 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1   p2    p3
#> ERR342845     1   0.000      0.950 1.000 0.00 0.000
#> ERR342843     1   0.000      0.950 1.000 0.00 0.000
#> ERR342896     1   0.000      0.950 1.000 0.00 0.000
#> ERR342827     2   0.000      0.916 0.000 1.00 0.000
#> ERR342871     1   0.406      0.857 0.836 0.00 0.164
#> ERR342863     2   0.000      0.916 0.000 1.00 0.000
#> ERR342839     1   0.000      0.950 1.000 0.00 0.000
#> ERR342906     1   0.406      0.857 0.836 0.00 0.164
#> ERR342905     2   0.369      0.846 0.140 0.86 0.000
#> ERR342816     1   0.406      0.857 0.836 0.00 0.164
#> ERR342865     2   0.000      0.916 0.000 1.00 0.000
#> ERR342824     1   0.000      0.950 1.000 0.00 0.000
#> ERR342841     2   0.000      0.916 0.000 1.00 0.000
#> ERR342835     1   0.000      0.950 1.000 0.00 0.000
#> ERR342899     2   0.369      0.846 0.140 0.86 0.000
#> ERR342829     1   0.000      0.950 1.000 0.00 0.000
#> ERR342850     1   0.406      0.857 0.836 0.00 0.164
#> ERR342849     2   0.369      0.846 0.140 0.86 0.000
#> ERR342811     1   0.406      0.857 0.836 0.00 0.164
#> ERR342837     1   0.000      0.950 1.000 0.00 0.000
#> ERR342857     1   0.406      0.857 0.836 0.00 0.164
#> ERR342869     1   0.406      0.857 0.836 0.00 0.164
#> ERR342903     1   0.000      0.950 1.000 0.00 0.000
#> ERR342819     1   0.000      0.950 1.000 0.00 0.000
#> ERR342885     3   0.000      1.000 0.000 0.00 1.000
#> ERR342889     2   0.000      0.916 0.000 1.00 0.000
#> ERR342864     1   0.406      0.857 0.836 0.00 0.164
#> ERR342860     2   0.369      0.846 0.140 0.86 0.000
#> ERR342808     1   0.406      0.857 0.836 0.00 0.164
#> ERR342823     1   0.000      0.950 1.000 0.00 0.000
#> ERR342907     2   0.000      0.916 0.000 1.00 0.000
#> ERR342852     1   0.406      0.857 0.836 0.00 0.164
#> ERR342832     2   0.000      0.916 0.000 1.00 0.000
#> ERR342868     1   0.000      0.950 1.000 0.00 0.000
#> ERR342821     1   0.406      0.857 0.836 0.00 0.164
#> ERR342878     2   0.000      0.916 0.000 1.00 0.000
#> ERR342876     1   0.000      0.950 1.000 0.00 0.000
#> ERR342809     1   0.000      0.950 1.000 0.00 0.000
#> ERR342846     3   0.000      1.000 0.000 0.00 1.000
#> ERR342872     2   0.000      0.916 0.000 1.00 0.000
#> ERR342828     2   0.000      0.916 0.000 1.00 0.000
#> ERR342840     1   0.000      0.950 1.000 0.00 0.000
#> ERR342831     1   0.000      0.950 1.000 0.00 0.000
#> ERR342818     1   0.000      0.950 1.000 0.00 0.000
#> ERR342862     1   0.000      0.950 1.000 0.00 0.000
#> ERR342894     1   0.000      0.950 1.000 0.00 0.000
#> ERR342884     2   0.000      0.916 0.000 1.00 0.000
#> ERR342891     1   0.000      0.950 1.000 0.00 0.000
#> ERR342890     1   0.000      0.950 1.000 0.00 0.000
#> ERR342836     2   0.000      0.916 0.000 1.00 0.000
#> ERR342879     1   0.000      0.950 1.000 0.00 0.000
#> ERR342848     1   0.000      0.950 1.000 0.00 0.000
#> ERR342861     1   0.000      0.950 1.000 0.00 0.000
#> ERR342814     2   0.369      0.846 0.140 0.86 0.000
#> ERR342870     1   0.406      0.857 0.836 0.00 0.164
#> ERR342901     1   0.000      0.950 1.000 0.00 0.000
#> ERR342908     1   0.406      0.857 0.836 0.00 0.164
#> ERR342815     2   0.000      0.916 0.000 1.00 0.000
#> ERR342897     3   0.000      1.000 0.000 0.00 1.000
#> ERR342833     2   0.000      0.916 0.000 1.00 0.000
#> ERR342817     3   0.000      1.000 0.000 0.00 1.000
#> ERR342810     2   0.369      0.846 0.140 0.86 0.000
#> ERR342867     1   0.406      0.857 0.836 0.00 0.164
#> ERR342847     1   0.000      0.950 1.000 0.00 0.000
#> ERR342855     1   0.000      0.950 1.000 0.00 0.000
#> ERR342851     1   0.000      0.950 1.000 0.00 0.000
#> ERR342813     1   0.000      0.950 1.000 0.00 0.000
#> ERR342883     1   0.000      0.950 1.000 0.00 0.000
#> ERR342856     3   0.000      1.000 0.000 0.00 1.000
#> ERR342822     2   0.000      0.916 0.000 1.00 0.000
#> ERR342892     1   0.000      0.950 1.000 0.00 0.000
#> ERR342842     1   0.000      0.950 1.000 0.00 0.000
#> ERR342902     2   0.000      0.916 0.000 1.00 0.000
#> ERR342900     2   0.369      0.846 0.140 0.86 0.000
#> ERR342888     1   0.000      0.950 1.000 0.00 0.000
#> ERR342812     1   0.000      0.950 1.000 0.00 0.000
#> ERR342853     2   0.369      0.846 0.140 0.86 0.000
#> ERR342866     1   0.000      0.950 1.000 0.00 0.000
#> ERR342820     1   0.406      0.857 0.836 0.00 0.164
#> ERR342895     1   0.000      0.950 1.000 0.00 0.000
#> ERR342825     3   0.000      1.000 0.000 0.00 1.000
#> ERR342826     3   0.000      1.000 0.000 0.00 1.000
#> ERR342875     2   0.000      0.916 0.000 1.00 0.000
#> ERR342834     3   0.000      1.000 0.000 0.00 1.000
#> ERR342898     1   0.406      0.857 0.836 0.00 0.164
#> ERR342886     2   0.369      0.846 0.140 0.86 0.000
#> ERR342838     1   0.000      0.950 1.000 0.00 0.000
#> ERR342882     1   0.000      0.950 1.000 0.00 0.000
#> ERR342807     2   0.000      0.916 0.000 1.00 0.000
#> ERR342873     1   0.000      0.950 1.000 0.00 0.000
#> ERR342844     1   0.406      0.857 0.836 0.00 0.164
#> ERR342874     1   0.000      0.950 1.000 0.00 0.000
#> ERR342893     1   0.000      0.950 1.000 0.00 0.000
#> ERR342859     3   0.000      1.000 0.000 0.00 1.000
#> ERR342830     2   0.369      0.846 0.140 0.86 0.000
#> ERR342880     1   0.000      0.950 1.000 0.00 0.000
#> ERR342887     1   0.000      0.950 1.000 0.00 0.000
#> ERR342854     1   0.000      0.950 1.000 0.00 0.000
#> ERR342904     1   0.406      0.857 0.836 0.00 0.164
#> ERR342881     1   0.000      0.950 1.000 0.00 0.000
#> ERR342858     1   0.000      0.950 1.000 0.00 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342843     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342896     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342827     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342871     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342863     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342839     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342906     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342905     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342816     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342865     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342824     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342841     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342835     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342899     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342829     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342850     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342849     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342811     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342837     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342857     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342869     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342903     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342819     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342885     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342889     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342864     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342860     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342808     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342823     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342907     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342852     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342832     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342868     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342821     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342878     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342876     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342809     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342846     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342872     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342828     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342840     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342831     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342818     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342862     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342894     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342884     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342891     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342890     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342836     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342879     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342848     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342861     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342814     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342870     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342901     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342908     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342815     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342897     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342833     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342817     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342810     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342867     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342847     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342855     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342851     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342813     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342883     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342856     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342822     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342892     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342842     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342902     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342900     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342888     1   0.147      0.823 0.948 0.000 0.000 0.052
#> ERR342812     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342853     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342866     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342820     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342895     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342825     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342826     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342875     2   0.000      0.918 0.000 1.000 0.000 0.000
#> ERR342834     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342898     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342886     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342838     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342882     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342807     2   0.130      0.912 0.044 0.956 0.000 0.000
#> ERR342873     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342844     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342874     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342893     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342859     3   0.000      1.000 0.000 0.000 1.000 0.000
#> ERR342830     2   0.343      0.869 0.112 0.860 0.000 0.028
#> ERR342880     4   0.000      0.685 0.000 0.000 0.000 1.000
#> ERR342887     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342854     4   0.430      0.541 0.284 0.000 0.000 0.716
#> ERR342904     4   0.454      0.671 0.048 0.000 0.164 0.788
#> ERR342881     1   0.425      0.783 0.724 0.000 0.000 0.276
#> ERR342858     4   0.000      0.685 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2   p3    p4    p5
#> ERR342845     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342843     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342896     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342827     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342871     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342863     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342839     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342906     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342905     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342816     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342865     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342824     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342841     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342835     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342899     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342829     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342850     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342849     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342811     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342837     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342857     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342869     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342903     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342819     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342885     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342889     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342864     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342860     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342808     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342823     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342907     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342852     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342832     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342868     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342821     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342878     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342876     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342809     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342846     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342872     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342828     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342840     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342831     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342818     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342862     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342894     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342884     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342891     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342890     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342836     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342879     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342848     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342861     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342814     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342870     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342901     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342908     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342815     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342897     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342833     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342817     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342810     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342867     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342847     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342855     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342851     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342813     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342883     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342856     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342822     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342892     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342842     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342902     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342900     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342888     5   0.530      1.000 0.000 0.120 0.00 0.212 0.668
#> ERR342812     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342853     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342866     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342820     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342895     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342825     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342826     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342875     2   0.260      0.875 0.148 0.852 0.00 0.000 0.000
#> ERR342834     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342898     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342886     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342838     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342882     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342807     1   0.000      1.000 1.000 0.000 0.00 0.000 0.000
#> ERR342873     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342844     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342874     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342893     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342859     3   0.000      1.000 0.000 0.000 1.00 0.000 0.000
#> ERR342830     2   0.228      0.896 0.000 0.880 0.00 0.120 0.000
#> ERR342880     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304
#> ERR342887     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342854     4   0.000      0.585 0.000 0.000 0.00 1.000 0.000
#> ERR342904     4   0.630      0.573 0.000 0.000 0.16 0.480 0.360
#> ERR342881     4   0.427     -0.354 0.000 0.000 0.00 0.552 0.448
#> ERR342858     4   0.397      0.637 0.000 0.004 0.00 0.692 0.304

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3   p4    p5    p6
#> ERR342845     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342843     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342896     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342827     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342871     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342863     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342839     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342906     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342905     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342816     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342865     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342824     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342841     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342835     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342899     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342829     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342850     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342849     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342811     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342837     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342857     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342869     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342903     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342819     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342885     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342889     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342864     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342860     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342808     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342823     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342907     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342852     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342832     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342868     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342821     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342878     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342876     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342809     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342846     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342872     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342828     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342840     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342831     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342818     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342862     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342894     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342884     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342891     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342890     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342836     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342879     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342848     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342861     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342814     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342870     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342901     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342908     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342815     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342897     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342833     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342817     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342810     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342867     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342847     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342855     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342851     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342813     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342883     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342856     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342822     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342892     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342842     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342902     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342900     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342888     5   0.000      1.000 0.000 0.000  0 0.00 1.000 0.000
#> ERR342812     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342853     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342866     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342820     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342895     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342825     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342826     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342875     2   0.234      0.903 0.000 0.852  0 0.00 0.000 0.148
#> ERR342834     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342898     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342886     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342838     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342882     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342807     6   0.000      1.000 0.000 0.000  0 0.00 0.000 1.000
#> ERR342873     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342844     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342874     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342893     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342859     3   0.000      1.000 0.000 0.000  1 0.00 0.000 0.000
#> ERR342830     2   0.000      0.919 0.000 1.000  0 0.00 0.000 0.000
#> ERR342880     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000
#> ERR342887     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342854     1   0.000      0.758 1.000 0.000  0 0.00 0.000 0.000
#> ERR342904     4   0.000      1.000 0.000 0.000  0 1.00 0.000 0.000
#> ERR342881     1   0.384      0.253 0.552 0.000  0 0.00 0.448 0.000
#> ERR342858     1   0.392      0.513 0.664 0.016  0 0.32 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "kmeans"]
# you can also extract it by
# res = res_list["MAD:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.116           0.664       0.795         0.4105 0.604   0.604
#> 3 3 0.200           0.511       0.611         0.3929 0.806   0.696
#> 4 4 0.266           0.552       0.653         0.1870 0.754   0.535
#> 5 5 0.467           0.554       0.612         0.0887 0.886   0.656
#> 6 6 0.645           0.617       0.590         0.0598 0.872   0.510

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.795      0.681 0.760 0.240
#> ERR342843     1   0.795      0.681 0.760 0.240
#> ERR342896     1   0.163      0.747 0.976 0.024
#> ERR342827     2   0.714      0.803 0.196 0.804
#> ERR342871     1   0.722      0.673 0.800 0.200
#> ERR342863     2   0.662      0.800 0.172 0.828
#> ERR342839     1   0.795      0.681 0.760 0.240
#> ERR342906     1   0.881      0.563 0.700 0.300
#> ERR342905     1   0.993      0.288 0.548 0.452
#> ERR342816     1   0.881      0.563 0.700 0.300
#> ERR342865     2   0.662      0.800 0.172 0.828
#> ERR342824     1   0.163      0.747 0.976 0.024
#> ERR342841     2   0.714      0.803 0.196 0.804
#> ERR342835     1   0.529      0.739 0.880 0.120
#> ERR342899     1   0.993      0.288 0.548 0.452
#> ERR342829     1   0.163      0.747 0.976 0.024
#> ERR342850     1   0.722      0.673 0.800 0.200
#> ERR342849     1   0.993      0.288 0.548 0.452
#> ERR342811     1   0.722      0.673 0.800 0.200
#> ERR342837     1   0.529      0.739 0.880 0.120
#> ERR342857     1   0.881      0.563 0.700 0.300
#> ERR342869     1   0.722      0.673 0.800 0.200
#> ERR342903     1   0.163      0.747 0.976 0.024
#> ERR342819     1   0.529      0.739 0.880 0.120
#> ERR342885     2   0.917      0.585 0.332 0.668
#> ERR342889     2   0.662      0.800 0.172 0.828
#> ERR342864     1   0.881      0.563 0.700 0.300
#> ERR342860     1   0.993      0.288 0.548 0.452
#> ERR342808     1   0.722      0.673 0.800 0.200
#> ERR342823     1   0.163      0.747 0.976 0.024
#> ERR342907     2   0.714      0.803 0.196 0.804
#> ERR342852     1   0.881      0.563 0.700 0.300
#> ERR342832     2   0.662      0.800 0.172 0.828
#> ERR342868     1   0.795      0.681 0.760 0.240
#> ERR342821     1   0.881      0.563 0.700 0.300
#> ERR342878     2   0.714      0.803 0.196 0.804
#> ERR342876     1   0.163      0.747 0.976 0.024
#> ERR342809     1   0.163      0.747 0.976 0.024
#> ERR342846     2   0.917      0.585 0.332 0.668
#> ERR342872     2   0.714      0.803 0.196 0.804
#> ERR342828     2   0.662      0.800 0.172 0.828
#> ERR342840     1   0.529      0.739 0.880 0.120
#> ERR342831     1   0.795      0.681 0.760 0.240
#> ERR342818     1   0.697      0.714 0.812 0.188
#> ERR342862     1   0.529      0.739 0.880 0.120
#> ERR342894     1   0.795      0.681 0.760 0.240
#> ERR342884     2   0.714      0.803 0.196 0.804
#> ERR342891     1   0.163      0.747 0.976 0.024
#> ERR342890     1   0.795      0.681 0.760 0.240
#> ERR342836     2   0.662      0.800 0.172 0.828
#> ERR342879     1   0.697      0.714 0.812 0.188
#> ERR342848     1   0.697      0.714 0.812 0.188
#> ERR342861     1   0.163      0.747 0.976 0.024
#> ERR342814     1   0.993      0.288 0.548 0.452
#> ERR342870     1   0.722      0.673 0.800 0.200
#> ERR342901     1   0.163      0.747 0.976 0.024
#> ERR342908     1   0.722      0.673 0.800 0.200
#> ERR342815     2   0.662      0.800 0.172 0.828
#> ERR342897     2   0.917      0.585 0.332 0.668
#> ERR342833     2   0.714      0.803 0.196 0.804
#> ERR342817     2   0.917      0.585 0.332 0.668
#> ERR342810     1   0.993      0.288 0.548 0.452
#> ERR342867     1   0.881      0.563 0.700 0.300
#> ERR342847     1   0.529      0.739 0.880 0.120
#> ERR342855     1   0.163      0.747 0.976 0.024
#> ERR342851     1   0.697      0.714 0.812 0.188
#> ERR342813     1   0.795      0.681 0.760 0.240
#> ERR342883     1   0.697      0.714 0.812 0.188
#> ERR342856     2   0.917      0.585 0.332 0.668
#> ERR342822     2   0.662      0.800 0.172 0.828
#> ERR342892     1   0.163      0.747 0.976 0.024
#> ERR342842     1   0.163      0.747 0.976 0.024
#> ERR342902     2   0.714      0.803 0.196 0.804
#> ERR342900     1   0.993      0.288 0.548 0.452
#> ERR342888     1   0.795      0.681 0.760 0.240
#> ERR342812     1   0.163      0.747 0.976 0.024
#> ERR342853     1   0.993      0.288 0.548 0.452
#> ERR342866     1   0.529      0.739 0.880 0.120
#> ERR342820     1   0.722      0.673 0.800 0.200
#> ERR342895     1   0.163      0.747 0.976 0.024
#> ERR342825     2   0.917      0.585 0.332 0.668
#> ERR342826     2   0.917      0.585 0.332 0.668
#> ERR342875     2   0.662      0.800 0.172 0.828
#> ERR342834     2   0.917      0.585 0.332 0.668
#> ERR342898     1   0.881      0.563 0.700 0.300
#> ERR342886     1   0.993      0.288 0.548 0.452
#> ERR342838     1   0.163      0.747 0.976 0.024
#> ERR342882     1   0.163      0.747 0.976 0.024
#> ERR342807     2   0.714      0.803 0.196 0.804
#> ERR342873     1   0.697      0.714 0.812 0.188
#> ERR342844     1   0.881      0.563 0.700 0.300
#> ERR342874     1   0.529      0.739 0.880 0.120
#> ERR342893     1   0.697      0.714 0.812 0.188
#> ERR342859     2   0.917      0.585 0.332 0.668
#> ERR342830     1   0.993      0.288 0.548 0.452
#> ERR342880     1   0.697      0.714 0.812 0.188
#> ERR342887     1   0.163      0.747 0.976 0.024
#> ERR342854     1   0.163      0.747 0.976 0.024
#> ERR342904     1   0.722      0.673 0.800 0.200
#> ERR342881     1   0.529      0.739 0.880 0.120
#> ERR342858     1   0.697      0.714 0.812 0.188

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342843     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342896     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342827     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342871     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342863     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342839     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342906     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342905     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342816     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342865     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342824     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342841     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342835     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342899     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342829     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342850     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342849     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342811     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342837     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342857     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342869     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342903     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342819     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342885     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342889     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342864     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342860     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342808     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342823     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342907     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342852     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342832     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342868     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342821     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342878     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342876     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342809     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342846     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342872     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342828     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342840     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342831     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342818     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342862     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342894     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342884     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342891     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342890     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342836     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342879     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342848     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342861     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342814     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342870     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342901     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342908     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342815     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342897     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342833     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342817     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342810     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342867     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342847     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342855     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342851     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342813     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342883     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342856     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342822     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342892     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342842     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342902     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342900     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342888     1  0.8701      0.352 0.492 0.108 0.400
#> ERR342812     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342853     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342866     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342820     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342895     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342825     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342826     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342875     2  0.1878      0.583 0.044 0.952 0.004
#> ERR342834     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342898     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342886     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342838     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342882     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342807     2  0.6059      0.504 0.048 0.764 0.188
#> ERR342873     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342844     1  0.9725      0.111 0.452 0.272 0.276
#> ERR342874     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342893     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342859     3  0.9273      1.000 0.164 0.364 0.472
#> ERR342830     2  0.8863      0.435 0.312 0.544 0.144
#> ERR342880     1  0.8647      0.475 0.600 0.192 0.208
#> ERR342887     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342854     1  0.0424      0.622 0.992 0.008 0.000
#> ERR342904     1  0.8670      0.356 0.592 0.168 0.240
#> ERR342881     1  0.7276      0.562 0.704 0.104 0.192
#> ERR342858     1  0.8647      0.475 0.600 0.192 0.208

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> ERR342845     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342843     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342896     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342827     2   0.629      0.666 0.004 0.672 NA 0.128
#> ERR342871     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342863     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342839     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342906     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342905     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342816     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342865     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342824     1   0.825      0.610 0.412 0.016 NA 0.256
#> ERR342841     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342835     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342899     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342829     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342850     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342849     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342811     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342837     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342857     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342869     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342903     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342819     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342885     4   0.821      0.442 0.068 0.124 NA 0.524
#> ERR342889     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342864     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342860     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342808     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342823     1   0.825      0.610 0.412 0.016 NA 0.256
#> ERR342907     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342852     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342832     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342868     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342821     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342878     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342876     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342809     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342846     4   0.836      0.442 0.080 0.124 NA 0.516
#> ERR342872     2   0.629      0.666 0.004 0.672 NA 0.128
#> ERR342828     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342840     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342831     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342818     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342862     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342894     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342884     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342891     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342890     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342836     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342879     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342848     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342861     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342814     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342870     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342901     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342908     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342815     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342897     4   0.836      0.442 0.080 0.124 NA 0.516
#> ERR342833     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342817     4   0.821      0.442 0.068 0.124 NA 0.524
#> ERR342810     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342867     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342847     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342855     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342851     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342813     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342883     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342856     4   0.836      0.442 0.080 0.124 NA 0.516
#> ERR342822     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342892     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342842     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342902     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342900     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342888     1   0.443      0.421 0.824 0.088 NA 0.080
#> ERR342812     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342853     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342866     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342820     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342895     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342825     4   0.821      0.442 0.068 0.124 NA 0.524
#> ERR342826     4   0.821      0.442 0.068 0.124 NA 0.524
#> ERR342875     2   0.246      0.737 0.008 0.912 NA 0.076
#> ERR342834     4   0.821      0.442 0.068 0.124 NA 0.524
#> ERR342898     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342886     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342838     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342882     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342807     2   0.615      0.667 0.000 0.672 NA 0.128
#> ERR342873     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342844     4   0.466      0.610 0.056 0.116 NA 0.812
#> ERR342874     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342893     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342859     4   0.836      0.442 0.080 0.124 NA 0.516
#> ERR342830     2   0.686      0.634 0.168 0.676 NA 0.048
#> ERR342880     4   0.944      0.324 0.172 0.184 NA 0.428
#> ERR342887     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342854     1   0.825      0.611 0.412 0.016 NA 0.252
#> ERR342904     4   0.473      0.554 0.128 0.036 NA 0.808
#> ERR342881     1   0.830      0.448 0.564 0.112 NA 0.196
#> ERR342858     4   0.944      0.324 0.172 0.184 NA 0.428

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.6121      0.986 0.196 0.072 0.052 0.012 0.668
#> ERR342843     5  0.5961      0.986 0.196 0.072 0.056 0.004 0.672
#> ERR342896     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342827     2  0.6146      0.624 0.000 0.668 0.072 0.136 0.124
#> ERR342871     3  0.8747      0.290 0.264 0.044 0.336 0.280 0.076
#> ERR342863     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342839     5  0.6572      0.984 0.196 0.072 0.064 0.024 0.644
#> ERR342906     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342905     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342816     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342865     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342824     1  0.1467      0.708 0.956 0.004 0.016 0.016 0.008
#> ERR342841     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342835     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342899     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342829     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342850     3  0.8747      0.290 0.264 0.044 0.336 0.280 0.076
#> ERR342849     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342811     3  0.8741      0.290 0.260 0.044 0.340 0.280 0.076
#> ERR342837     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342857     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342869     3  0.8747      0.290 0.264 0.044 0.336 0.280 0.076
#> ERR342903     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342819     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342885     3  0.3126      0.502 0.028 0.088 0.868 0.000 0.016
#> ERR342889     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342864     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342860     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342808     3  0.8741      0.290 0.260 0.044 0.340 0.280 0.076
#> ERR342823     1  0.1467      0.708 0.956 0.004 0.016 0.016 0.008
#> ERR342907     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342852     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342832     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342868     5  0.6488      0.984 0.196 0.072 0.064 0.020 0.648
#> ERR342821     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342878     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342876     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342809     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342846     3  0.4152      0.500 0.028 0.088 0.828 0.020 0.036
#> ERR342872     2  0.6146      0.624 0.000 0.668 0.072 0.136 0.124
#> ERR342828     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342840     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342831     5  0.6121      0.986 0.196 0.072 0.052 0.012 0.668
#> ERR342818     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342862     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342894     5  0.5961      0.986 0.196 0.072 0.056 0.004 0.672
#> ERR342884     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342891     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342890     5  0.6572      0.984 0.196 0.072 0.064 0.024 0.644
#> ERR342836     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342879     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342848     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342861     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342814     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342870     3  0.8741      0.290 0.260 0.044 0.340 0.280 0.076
#> ERR342901     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342908     3  0.8741      0.290 0.260 0.044 0.340 0.280 0.076
#> ERR342815     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342897     3  0.4152      0.500 0.028 0.088 0.828 0.020 0.036
#> ERR342833     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342817     3  0.3126      0.502 0.028 0.088 0.868 0.000 0.016
#> ERR342810     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342867     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342847     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342855     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342851     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342813     5  0.5961      0.986 0.196 0.072 0.056 0.004 0.672
#> ERR342883     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342856     3  0.4152      0.500 0.028 0.088 0.828 0.020 0.036
#> ERR342822     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342892     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342842     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342902     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342900     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342888     5  0.6488      0.984 0.196 0.072 0.064 0.020 0.648
#> ERR342812     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342853     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342866     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342820     3  0.8747      0.290 0.264 0.044 0.336 0.280 0.076
#> ERR342895     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342825     3  0.3126      0.502 0.028 0.088 0.868 0.000 0.016
#> ERR342826     3  0.3126      0.502 0.028 0.088 0.868 0.000 0.016
#> ERR342875     2  0.0671      0.693 0.000 0.980 0.016 0.004 0.000
#> ERR342834     3  0.3126      0.502 0.028 0.088 0.868 0.000 0.016
#> ERR342898     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342886     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342838     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342882     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342807     2  0.6129      0.625 0.000 0.668 0.068 0.140 0.124
#> ERR342873     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342844     4  0.8519      0.323 0.136 0.104 0.356 0.364 0.040
#> ERR342874     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342893     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342859     3  0.4152      0.500 0.028 0.088 0.828 0.020 0.036
#> ERR342830     2  0.7493      0.520 0.052 0.568 0.040 0.164 0.176
#> ERR342880     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092
#> ERR342887     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342854     1  0.0162      0.730 0.996 0.004 0.000 0.000 0.000
#> ERR342904     3  0.8741      0.290 0.260 0.044 0.340 0.280 0.076
#> ERR342881     1  0.8831      0.128 0.384 0.092 0.052 0.220 0.252
#> ERR342858     4  0.7940      0.564 0.260 0.064 0.072 0.512 0.092

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.6956      0.980 0.148 0.008 0.052 0.020 0.512 0.260
#> ERR342843     5  0.6919      0.980 0.148 0.008 0.048 0.020 0.512 0.264
#> ERR342896     1  0.0146      0.990 0.996 0.000 0.000 0.004 0.000 0.000
#> ERR342827     2  0.1434      0.760 0.000 0.948 0.028 0.012 0.012 0.000
#> ERR342871     3  0.8924     -0.331 0.168 0.016 0.280 0.276 0.164 0.096
#> ERR342863     2  0.5743      0.732 0.000 0.640 0.004 0.048 0.144 0.164
#> ERR342839     5  0.7281      0.976 0.148 0.008 0.052 0.036 0.476 0.280
#> ERR342906     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342905     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342816     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342865     2  0.5743      0.732 0.000 0.640 0.004 0.048 0.144 0.164
#> ERR342824     1  0.1511      0.944 0.940 0.000 0.004 0.012 0.044 0.000
#> ERR342841     2  0.1074      0.762 0.000 0.960 0.028 0.012 0.000 0.000
#> ERR342835     6  0.5473      0.225 0.284 0.016 0.008 0.088 0.000 0.604
#> ERR342899     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342829     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342850     4  0.8900      0.235 0.168 0.016 0.280 0.280 0.164 0.092
#> ERR342849     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342811     4  0.8888      0.235 0.168 0.016 0.280 0.284 0.160 0.092
#> ERR342837     6  0.5473      0.225 0.284 0.016 0.008 0.088 0.000 0.604
#> ERR342857     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342869     4  0.8900      0.235 0.168 0.016 0.280 0.280 0.164 0.092
#> ERR342903     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342819     6  0.5473      0.225 0.284 0.016 0.008 0.088 0.000 0.604
#> ERR342885     3  0.1737      0.778 0.020 0.040 0.932 0.000 0.000 0.008
#> ERR342889     2  0.5743      0.732 0.000 0.640 0.004 0.048 0.144 0.164
#> ERR342864     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342860     6  0.8060      0.363 0.036 0.268 0.028 0.112 0.128 0.428
#> ERR342808     4  0.8912      0.234 0.168 0.016 0.280 0.280 0.160 0.096
#> ERR342823     1  0.1511      0.944 0.940 0.000 0.004 0.012 0.044 0.000
#> ERR342907     2  0.0972      0.762 0.000 0.964 0.028 0.008 0.000 0.000
#> ERR342852     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342832     2  0.5743      0.732 0.000 0.640 0.004 0.048 0.144 0.164
#> ERR342868     5  0.7281      0.976 0.148 0.008 0.052 0.036 0.476 0.280
#> ERR342821     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342878     2  0.0972      0.762 0.000 0.964 0.028 0.008 0.000 0.000
#> ERR342876     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342846     3  0.3931      0.768 0.020 0.040 0.832 0.012 0.044 0.052
#> ERR342872     2  0.1313      0.761 0.000 0.952 0.028 0.016 0.004 0.000
#> ERR342828     2  0.5791      0.732 0.000 0.640 0.004 0.056 0.140 0.160
#> ERR342840     6  0.5516      0.224 0.284 0.016 0.008 0.092 0.000 0.600
#> ERR342831     5  0.6956      0.980 0.148 0.008 0.052 0.020 0.512 0.260
#> ERR342818     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342862     6  0.5608      0.225 0.284 0.016 0.008 0.088 0.004 0.600
#> ERR342894     5  0.6919      0.980 0.148 0.008 0.048 0.020 0.512 0.264
#> ERR342884     2  0.1074      0.762 0.000 0.960 0.028 0.012 0.000 0.000
#> ERR342891     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342890     5  0.7281      0.976 0.148 0.008 0.052 0.036 0.476 0.280
#> ERR342836     2  0.5743      0.732 0.000 0.640 0.004 0.048 0.144 0.164
#> ERR342879     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342848     4  0.5703      0.460 0.160 0.012 0.056 0.672 0.004 0.096
#> ERR342861     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342814     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342870     4  0.8888      0.235 0.168 0.016 0.280 0.284 0.160 0.092
#> ERR342901     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     3  0.8912     -0.331 0.168 0.016 0.280 0.280 0.160 0.096
#> ERR342815     2  0.5791      0.732 0.000 0.640 0.004 0.056 0.140 0.160
#> ERR342897     3  0.3892      0.769 0.020 0.040 0.836 0.016 0.040 0.048
#> ERR342833     2  0.0972      0.762 0.000 0.964 0.028 0.008 0.000 0.000
#> ERR342817     3  0.1737      0.778 0.020 0.040 0.932 0.000 0.000 0.008
#> ERR342810     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342867     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342847     6  0.5473      0.225 0.284 0.016 0.008 0.088 0.000 0.604
#> ERR342855     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342813     5  0.6919      0.980 0.148 0.008 0.048 0.020 0.512 0.264
#> ERR342883     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342856     3  0.3892      0.769 0.020 0.040 0.836 0.016 0.040 0.048
#> ERR342822     2  0.5791      0.732 0.000 0.640 0.004 0.056 0.140 0.160
#> ERR342892     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0146      0.990 0.996 0.000 0.000 0.000 0.004 0.000
#> ERR342902     2  0.0972      0.762 0.000 0.964 0.028 0.008 0.000 0.000
#> ERR342900     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342888     5  0.7281      0.976 0.148 0.008 0.052 0.036 0.476 0.280
#> ERR342812     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     6  0.8030      0.365 0.036 0.268 0.028 0.108 0.128 0.432
#> ERR342866     6  0.5516      0.224 0.284 0.016 0.008 0.092 0.000 0.600
#> ERR342820     4  0.8900      0.235 0.168 0.016 0.280 0.280 0.164 0.092
#> ERR342895     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342825     3  0.1737      0.778 0.020 0.040 0.932 0.000 0.000 0.008
#> ERR342826     3  0.1881      0.778 0.020 0.040 0.928 0.004 0.000 0.008
#> ERR342875     2  0.5791      0.732 0.000 0.640 0.004 0.056 0.140 0.160
#> ERR342834     3  0.1737      0.778 0.020 0.040 0.932 0.000 0.000 0.008
#> ERR342898     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342886     6  0.8060      0.363 0.036 0.268 0.028 0.112 0.128 0.428
#> ERR342838     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0291      0.990 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR342807     2  0.1151      0.761 0.000 0.956 0.032 0.012 0.000 0.000
#> ERR342873     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342844     4  0.8085      0.396 0.076 0.064 0.328 0.388 0.120 0.024
#> ERR342874     6  0.5608      0.225 0.284 0.016 0.008 0.088 0.004 0.600
#> ERR342893     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342859     3  0.3931      0.768 0.020 0.040 0.832 0.012 0.044 0.052
#> ERR342830     6  0.8060      0.363 0.036 0.268 0.028 0.112 0.128 0.428
#> ERR342880     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088
#> ERR342887     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.8888      0.235 0.168 0.016 0.280 0.284 0.160 0.092
#> ERR342881     6  0.5608      0.225 0.284 0.016 0.008 0.088 0.004 0.600
#> ERR342858     4  0.5477      0.463 0.160 0.012 0.056 0.684 0.000 0.088

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "skmeans"]
# you can also extract it by
# res = res_list["MAD:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.836           0.919       0.960         0.4919 0.499   0.499
#> 3 3 0.706           0.840       0.909         0.3483 0.786   0.597
#> 4 4 0.690           0.798       0.841         0.1176 0.898   0.709
#> 5 5 0.772           0.861       0.868         0.0615 0.968   0.871
#> 6 6 0.836           0.879       0.864         0.0404 0.968   0.851

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1  0.3114      0.946 0.944 0.056
#> ERR342843     1  0.3114      0.946 0.944 0.056
#> ERR342896     1  0.0000      0.983 1.000 0.000
#> ERR342827     2  0.0000      0.925 0.000 1.000
#> ERR342871     1  0.1633      0.972 0.976 0.024
#> ERR342863     2  0.0000      0.925 0.000 1.000
#> ERR342839     1  0.3114      0.946 0.944 0.056
#> ERR342906     2  0.9358      0.555 0.352 0.648
#> ERR342905     2  0.0000      0.925 0.000 1.000
#> ERR342816     2  0.9358      0.555 0.352 0.648
#> ERR342865     2  0.0000      0.925 0.000 1.000
#> ERR342824     1  0.0000      0.983 1.000 0.000
#> ERR342841     2  0.0000      0.925 0.000 1.000
#> ERR342835     1  0.0000      0.983 1.000 0.000
#> ERR342899     2  0.0000      0.925 0.000 1.000
#> ERR342829     1  0.0000      0.983 1.000 0.000
#> ERR342850     1  0.1633      0.972 0.976 0.024
#> ERR342849     2  0.0000      0.925 0.000 1.000
#> ERR342811     1  0.1633      0.972 0.976 0.024
#> ERR342837     1  0.0000      0.983 1.000 0.000
#> ERR342857     2  0.9358      0.555 0.352 0.648
#> ERR342869     1  0.1633      0.972 0.976 0.024
#> ERR342903     1  0.0000      0.983 1.000 0.000
#> ERR342819     1  0.0000      0.983 1.000 0.000
#> ERR342885     2  0.0672      0.922 0.008 0.992
#> ERR342889     2  0.0000      0.925 0.000 1.000
#> ERR342864     2  0.9358      0.555 0.352 0.648
#> ERR342860     2  0.0000      0.925 0.000 1.000
#> ERR342808     1  0.1633      0.972 0.976 0.024
#> ERR342823     1  0.0000      0.983 1.000 0.000
#> ERR342907     2  0.0000      0.925 0.000 1.000
#> ERR342852     2  0.9358      0.555 0.352 0.648
#> ERR342832     2  0.0000      0.925 0.000 1.000
#> ERR342868     1  0.3114      0.946 0.944 0.056
#> ERR342821     2  0.9358      0.555 0.352 0.648
#> ERR342878     2  0.0000      0.925 0.000 1.000
#> ERR342876     1  0.0000      0.983 1.000 0.000
#> ERR342809     1  0.0000      0.983 1.000 0.000
#> ERR342846     2  0.0672      0.922 0.008 0.992
#> ERR342872     2  0.0000      0.925 0.000 1.000
#> ERR342828     2  0.0000      0.925 0.000 1.000
#> ERR342840     1  0.0000      0.983 1.000 0.000
#> ERR342831     1  0.3114      0.946 0.944 0.056
#> ERR342818     1  0.0938      0.980 0.988 0.012
#> ERR342862     1  0.0000      0.983 1.000 0.000
#> ERR342894     1  0.3114      0.946 0.944 0.056
#> ERR342884     2  0.0000      0.925 0.000 1.000
#> ERR342891     1  0.0000      0.983 1.000 0.000
#> ERR342890     1  0.3114      0.946 0.944 0.056
#> ERR342836     2  0.0000      0.925 0.000 1.000
#> ERR342879     1  0.0938      0.980 0.988 0.012
#> ERR342848     1  0.0938      0.980 0.988 0.012
#> ERR342861     1  0.0000      0.983 1.000 0.000
#> ERR342814     2  0.0000      0.925 0.000 1.000
#> ERR342870     1  0.1633      0.972 0.976 0.024
#> ERR342901     1  0.0000      0.983 1.000 0.000
#> ERR342908     1  0.1633      0.972 0.976 0.024
#> ERR342815     2  0.0000      0.925 0.000 1.000
#> ERR342897     2  0.0672      0.922 0.008 0.992
#> ERR342833     2  0.0000      0.925 0.000 1.000
#> ERR342817     2  0.0672      0.922 0.008 0.992
#> ERR342810     2  0.0000      0.925 0.000 1.000
#> ERR342867     2  0.9358      0.555 0.352 0.648
#> ERR342847     1  0.0000      0.983 1.000 0.000
#> ERR342855     1  0.0000      0.983 1.000 0.000
#> ERR342851     1  0.0938      0.980 0.988 0.012
#> ERR342813     1  0.3114      0.946 0.944 0.056
#> ERR342883     1  0.0938      0.980 0.988 0.012
#> ERR342856     2  0.0672      0.922 0.008 0.992
#> ERR342822     2  0.0000      0.925 0.000 1.000
#> ERR342892     1  0.0000      0.983 1.000 0.000
#> ERR342842     1  0.0000      0.983 1.000 0.000
#> ERR342902     2  0.0000      0.925 0.000 1.000
#> ERR342900     2  0.0000      0.925 0.000 1.000
#> ERR342888     1  0.3114      0.946 0.944 0.056
#> ERR342812     1  0.0000      0.983 1.000 0.000
#> ERR342853     2  0.0000      0.925 0.000 1.000
#> ERR342866     1  0.0000      0.983 1.000 0.000
#> ERR342820     1  0.1633      0.972 0.976 0.024
#> ERR342895     1  0.0000      0.983 1.000 0.000
#> ERR342825     2  0.0672      0.922 0.008 0.992
#> ERR342826     2  0.0672      0.922 0.008 0.992
#> ERR342875     2  0.0000      0.925 0.000 1.000
#> ERR342834     2  0.0672      0.922 0.008 0.992
#> ERR342898     2  0.9358      0.555 0.352 0.648
#> ERR342886     2  0.0000      0.925 0.000 1.000
#> ERR342838     1  0.0000      0.983 1.000 0.000
#> ERR342882     1  0.0000      0.983 1.000 0.000
#> ERR342807     2  0.0000      0.925 0.000 1.000
#> ERR342873     1  0.0938      0.980 0.988 0.012
#> ERR342844     2  0.9358      0.555 0.352 0.648
#> ERR342874     1  0.0000      0.983 1.000 0.000
#> ERR342893     1  0.0938      0.980 0.988 0.012
#> ERR342859     2  0.0672      0.922 0.008 0.992
#> ERR342830     2  0.0000      0.925 0.000 1.000
#> ERR342880     1  0.0938      0.980 0.988 0.012
#> ERR342887     1  0.0000      0.983 1.000 0.000
#> ERR342854     1  0.0000      0.983 1.000 0.000
#> ERR342904     1  0.1633      0.972 0.976 0.024
#> ERR342881     1  0.0000      0.983 1.000 0.000
#> ERR342858     1  0.0938      0.980 0.988 0.012

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342843     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342896     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342827     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342871     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342863     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342839     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342906     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342905     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342816     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342865     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342824     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342841     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342835     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342899     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342829     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342850     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342849     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342811     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342837     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342857     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342869     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342903     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342819     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342885     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342889     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342864     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342860     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342808     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342823     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342907     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342852     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342832     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342868     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342821     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342878     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342876     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342809     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342846     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342872     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342828     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342840     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342831     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342818     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342862     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342894     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342884     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342891     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342890     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342836     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342879     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342848     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342861     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342814     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342870     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342901     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342908     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342815     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342897     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342833     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342817     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342810     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342867     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342847     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342855     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342851     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342813     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342883     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342856     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342822     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342892     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342842     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342902     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342900     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342888     1  0.6448      0.569 0.656 0.016 0.328
#> ERR342812     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342853     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342866     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342820     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342895     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342825     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342826     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342875     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342834     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342898     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342886     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342838     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342882     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342807     2  0.0592      0.990 0.000 0.988 0.012
#> ERR342873     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342844     3  0.1129      0.932 0.020 0.004 0.976
#> ERR342874     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342893     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342859     3  0.3340      0.886 0.000 0.120 0.880
#> ERR342830     2  0.0000      0.995 0.000 1.000 0.000
#> ERR342880     1  0.6917      0.476 0.608 0.024 0.368
#> ERR342887     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342854     1  0.0237      0.823 0.996 0.000 0.004
#> ERR342904     3  0.1411      0.926 0.036 0.000 0.964
#> ERR342881     1  0.2448      0.814 0.924 0.000 0.076
#> ERR342858     1  0.6917      0.476 0.608 0.024 0.368

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342843     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342896     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342827     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342871     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342863     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342839     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342906     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342905     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342816     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342865     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342824     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342841     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342835     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342899     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342829     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342850     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342849     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342811     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342837     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342857     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342869     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342903     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342819     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342885     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342889     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342864     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342860     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342808     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342823     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342907     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342852     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342832     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342868     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342821     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342878     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342876     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342846     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342872     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342828     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342840     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342831     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342818     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342862     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342894     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342884     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342891     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342890     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342836     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342879     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342848     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342861     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342814     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342870     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342901     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342908     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342815     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342897     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342833     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342817     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342810     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342867     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342847     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342855     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342851     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342813     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342883     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342856     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342822     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342892     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342902     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342900     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342888     3   0.559      0.580 0.180 0.000 0.720 0.100
#> ERR342812     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342853     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342866     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342820     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342895     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342825     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342826     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342875     2   0.000      0.968 0.000 1.000 0.000 0.000
#> ERR342834     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342898     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342886     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342838     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342807     2   0.183      0.952 0.000 0.944 0.024 0.032
#> ERR342873     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342844     4   0.164      0.801 0.008 0.000 0.044 0.948
#> ERR342874     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342893     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342859     4   0.576      0.709 0.000 0.076 0.240 0.684
#> ERR342830     2   0.112      0.962 0.000 0.964 0.036 0.000
#> ERR342880     3   0.830      0.407 0.232 0.020 0.404 0.344
#> ERR342887     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000 0.000 0.000
#> ERR342904     4   0.291      0.796 0.020 0.000 0.092 0.888
#> ERR342881     3   0.556      0.567 0.308 0.000 0.652 0.040
#> ERR342858     3   0.830      0.407 0.232 0.020 0.404 0.344

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342843     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342896     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342871     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342863     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342906     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342905     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342816     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342865     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342835     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342899     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342829     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342849     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342811     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342837     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342857     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342869     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342903     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342885     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342889     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342860     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342808     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342823     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342852     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342832     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342868     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342821     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342878     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342876     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342872     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342828     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342831     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342818     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342862     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342894     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342884     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342891     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342836     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342879     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342848     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342861     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342870     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342901     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342815     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342897     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342833     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342817     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342810     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342867     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342847     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342855     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342813     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342883     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342856     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342822     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342900     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342888     5   0.112      0.774 0.020 0.000 0.000 0.016 0.964
#> ERR342812     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342866     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342820     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342895     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342826     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342875     2   0.000      0.935 0.000 1.000 0.000 0.000 0.000
#> ERR342834     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342898     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342886     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342838     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2   0.280      0.901 0.000 0.884 0.044 0.068 0.004
#> ERR342873     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342844     4   0.394      0.742 0.000 0.004 0.224 0.756 0.016
#> ERR342874     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342893     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342859     4   0.479      0.681 0.000 0.028 0.068 0.760 0.144
#> ERR342830     2   0.199      0.922 0.000 0.924 0.032 0.000 0.044
#> ERR342880     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112
#> ERR342887     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4   0.392      0.756 0.012 0.000 0.164 0.796 0.028
#> ERR342881     5   0.574      0.740 0.120 0.000 0.196 0.020 0.664
#> ERR342858     3   0.366      1.000 0.044 0.000 0.832 0.012 0.112

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342843     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342871     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342863     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342839     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342906     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342905     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342816     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342865     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342835     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342899     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342849     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342811     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342837     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342857     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342869     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342885     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342889     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342864     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342860     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342808     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342852     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342832     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342868     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342821     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342878     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342872     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342828     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342840     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342831     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342818     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342862     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342894     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342884     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342836     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342879     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342848     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342870     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342815     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342897     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342833     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342817     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342810     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342867     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342847     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342813     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342883     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342856     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342822     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342900     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342888     5  0.1787      0.782 0.004 0.000 0.068 0.000 0.920 0.008
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342866     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342820     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342826     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342875     2  0.0458      0.877 0.000 0.984 0.016 0.000 0.000 0.000
#> ERR342834     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342898     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342886     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.3959      0.770 0.000 0.724 0.244 0.012 0.000 0.020
#> ERR342873     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342844     4  0.2994      0.808 0.000 0.000 0.064 0.852 0.004 0.080
#> ERR342874     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342893     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342859     3  0.3789      1.000 0.000 0.000 0.760 0.196 0.040 0.004
#> ERR342830     2  0.1942      0.863 0.000 0.916 0.064 0.000 0.012 0.008
#> ERR342880     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.2933      0.804 0.000 0.000 0.108 0.852 0.008 0.032
#> ERR342881     5  0.5302      0.750 0.040 0.000 0.056 0.020 0.684 0.200
#> ERR342858     6  0.1065      1.000 0.008 0.000 0.000 0.020 0.008 0.964

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:pam*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "pam"]
# you can also extract it by
# res = res_list["MAD:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.901           0.952       0.975          0.452 0.531   0.531
#> 3 3 0.742           0.825       0.896          0.285 0.950   0.906
#> 4 4 0.962           0.913       0.964          0.210 0.813   0.612
#> 5 5 0.954           0.947       0.974          0.087 0.912   0.715
#> 6 6 0.945           0.947       0.956          0.048 0.964   0.849

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 4 5

There is also optional best \(k\) = 2 4 5 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      1.000 1.000 0.000
#> ERR342843     1   0.000      1.000 1.000 0.000
#> ERR342896     1   0.000      1.000 1.000 0.000
#> ERR342827     2   0.000      0.929 0.000 1.000
#> ERR342871     1   0.000      1.000 1.000 0.000
#> ERR342863     2   0.000      0.929 0.000 1.000
#> ERR342839     1   0.000      1.000 1.000 0.000
#> ERR342906     1   0.000      1.000 1.000 0.000
#> ERR342905     2   0.000      0.929 0.000 1.000
#> ERR342816     1   0.000      1.000 1.000 0.000
#> ERR342865     2   0.000      0.929 0.000 1.000
#> ERR342824     1   0.000      1.000 1.000 0.000
#> ERR342841     2   0.000      0.929 0.000 1.000
#> ERR342835     1   0.000      1.000 1.000 0.000
#> ERR342899     2   0.000      0.929 0.000 1.000
#> ERR342829     1   0.000      1.000 1.000 0.000
#> ERR342850     1   0.000      1.000 1.000 0.000
#> ERR342849     2   0.000      0.929 0.000 1.000
#> ERR342811     1   0.000      1.000 1.000 0.000
#> ERR342837     1   0.000      1.000 1.000 0.000
#> ERR342857     1   0.000      1.000 1.000 0.000
#> ERR342869     1   0.000      1.000 1.000 0.000
#> ERR342903     1   0.000      1.000 1.000 0.000
#> ERR342819     1   0.000      1.000 1.000 0.000
#> ERR342885     2   0.839      0.704 0.268 0.732
#> ERR342889     2   0.000      0.929 0.000 1.000
#> ERR342864     1   0.000      1.000 1.000 0.000
#> ERR342860     2   0.000      0.929 0.000 1.000
#> ERR342808     1   0.000      1.000 1.000 0.000
#> ERR342823     1   0.000      1.000 1.000 0.000
#> ERR342907     2   0.000      0.929 0.000 1.000
#> ERR342852     1   0.000      1.000 1.000 0.000
#> ERR342832     2   0.000      0.929 0.000 1.000
#> ERR342868     1   0.000      1.000 1.000 0.000
#> ERR342821     1   0.000      1.000 1.000 0.000
#> ERR342878     2   0.000      0.929 0.000 1.000
#> ERR342876     1   0.000      1.000 1.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000
#> ERR342846     2   0.891      0.644 0.308 0.692
#> ERR342872     2   0.000      0.929 0.000 1.000
#> ERR342828     2   0.000      0.929 0.000 1.000
#> ERR342840     1   0.000      1.000 1.000 0.000
#> ERR342831     1   0.000      1.000 1.000 0.000
#> ERR342818     1   0.000      1.000 1.000 0.000
#> ERR342862     1   0.000      1.000 1.000 0.000
#> ERR342894     1   0.000      1.000 1.000 0.000
#> ERR342884     2   0.000      0.929 0.000 1.000
#> ERR342891     1   0.000      1.000 1.000 0.000
#> ERR342890     1   0.000      1.000 1.000 0.000
#> ERR342836     2   0.000      0.929 0.000 1.000
#> ERR342879     1   0.000      1.000 1.000 0.000
#> ERR342848     1   0.000      1.000 1.000 0.000
#> ERR342861     1   0.000      1.000 1.000 0.000
#> ERR342814     2   0.000      0.929 0.000 1.000
#> ERR342870     1   0.000      1.000 1.000 0.000
#> ERR342901     1   0.000      1.000 1.000 0.000
#> ERR342908     1   0.000      1.000 1.000 0.000
#> ERR342815     2   0.000      0.929 0.000 1.000
#> ERR342897     2   0.850      0.694 0.276 0.724
#> ERR342833     2   0.000      0.929 0.000 1.000
#> ERR342817     2   0.850      0.694 0.276 0.724
#> ERR342810     2   0.000      0.929 0.000 1.000
#> ERR342867     1   0.000      1.000 1.000 0.000
#> ERR342847     1   0.000      1.000 1.000 0.000
#> ERR342855     1   0.000      1.000 1.000 0.000
#> ERR342851     1   0.000      1.000 1.000 0.000
#> ERR342813     1   0.000      1.000 1.000 0.000
#> ERR342883     1   0.000      1.000 1.000 0.000
#> ERR342856     2   0.738      0.771 0.208 0.792
#> ERR342822     2   0.000      0.929 0.000 1.000
#> ERR342892     1   0.000      1.000 1.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000
#> ERR342902     2   0.000      0.929 0.000 1.000
#> ERR342900     2   0.000      0.929 0.000 1.000
#> ERR342888     1   0.000      1.000 1.000 0.000
#> ERR342812     1   0.000      1.000 1.000 0.000
#> ERR342853     2   0.000      0.929 0.000 1.000
#> ERR342866     1   0.000      1.000 1.000 0.000
#> ERR342820     1   0.000      1.000 1.000 0.000
#> ERR342895     1   0.000      1.000 1.000 0.000
#> ERR342825     2   0.855      0.689 0.280 0.720
#> ERR342826     2   0.753      0.763 0.216 0.784
#> ERR342875     2   0.000      0.929 0.000 1.000
#> ERR342834     2   0.886      0.651 0.304 0.696
#> ERR342898     1   0.000      1.000 1.000 0.000
#> ERR342886     2   0.000      0.929 0.000 1.000
#> ERR342838     1   0.000      1.000 1.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000
#> ERR342807     2   0.000      0.929 0.000 1.000
#> ERR342873     1   0.000      1.000 1.000 0.000
#> ERR342844     1   0.000      1.000 1.000 0.000
#> ERR342874     1   0.000      1.000 1.000 0.000
#> ERR342893     1   0.000      1.000 1.000 0.000
#> ERR342859     2   0.936      0.561 0.352 0.648
#> ERR342830     2   0.000      0.929 0.000 1.000
#> ERR342880     1   0.000      1.000 1.000 0.000
#> ERR342887     1   0.000      1.000 1.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000
#> ERR342904     1   0.000      1.000 1.000 0.000
#> ERR342881     1   0.000      1.000 1.000 0.000
#> ERR342858     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1 p2    p3
#> ERR342845     1  0.1163      0.805 0.972  0 0.028
#> ERR342843     1  0.1964      0.800 0.944  0 0.056
#> ERR342896     1  0.0000      0.806 1.000  0 0.000
#> ERR342827     2  0.0000      1.000 0.000  1 0.000
#> ERR342871     1  0.6204      0.572 0.576  0 0.424
#> ERR342863     2  0.0000      1.000 0.000  1 0.000
#> ERR342839     1  0.1289      0.805 0.968  0 0.032
#> ERR342906     1  0.6204      0.572 0.576  0 0.424
#> ERR342905     2  0.0000      1.000 0.000  1 0.000
#> ERR342816     1  0.6204      0.572 0.576  0 0.424
#> ERR342865     2  0.0000      1.000 0.000  1 0.000
#> ERR342824     1  0.0000      0.806 1.000  0 0.000
#> ERR342841     2  0.0000      1.000 0.000  1 0.000
#> ERR342835     1  0.0000      0.806 1.000  0 0.000
#> ERR342899     2  0.0000      1.000 0.000  1 0.000
#> ERR342829     1  0.0000      0.806 1.000  0 0.000
#> ERR342850     1  0.6204      0.572 0.576  0 0.424
#> ERR342849     2  0.0000      1.000 0.000  1 0.000
#> ERR342811     1  0.6204      0.572 0.576  0 0.424
#> ERR342837     1  0.0000      0.806 1.000  0 0.000
#> ERR342857     1  0.6204      0.572 0.576  0 0.424
#> ERR342869     1  0.6204      0.572 0.576  0 0.424
#> ERR342903     1  0.0000      0.806 1.000  0 0.000
#> ERR342819     1  0.0000      0.806 1.000  0 0.000
#> ERR342885     3  0.0000      1.000 0.000  0 1.000
#> ERR342889     2  0.0000      1.000 0.000  1 0.000
#> ERR342864     1  0.6204      0.572 0.576  0 0.424
#> ERR342860     2  0.0000      1.000 0.000  1 0.000
#> ERR342808     1  0.6204      0.572 0.576  0 0.424
#> ERR342823     1  0.0000      0.806 1.000  0 0.000
#> ERR342907     2  0.0000      1.000 0.000  1 0.000
#> ERR342852     1  0.6204      0.572 0.576  0 0.424
#> ERR342832     2  0.0000      1.000 0.000  1 0.000
#> ERR342868     1  0.2356      0.795 0.928  0 0.072
#> ERR342821     1  0.6204      0.572 0.576  0 0.424
#> ERR342878     2  0.0000      1.000 0.000  1 0.000
#> ERR342876     1  0.0000      0.806 1.000  0 0.000
#> ERR342809     1  0.0000      0.806 1.000  0 0.000
#> ERR342846     3  0.0000      1.000 0.000  0 1.000
#> ERR342872     2  0.0000      1.000 0.000  1 0.000
#> ERR342828     2  0.0000      1.000 0.000  1 0.000
#> ERR342840     1  0.0592      0.805 0.988  0 0.012
#> ERR342831     1  0.0237      0.806 0.996  0 0.004
#> ERR342818     1  0.5216      0.703 0.740  0 0.260
#> ERR342862     1  0.1163      0.802 0.972  0 0.028
#> ERR342894     1  0.1411      0.804 0.964  0 0.036
#> ERR342884     2  0.0000      1.000 0.000  1 0.000
#> ERR342891     1  0.0000      0.806 1.000  0 0.000
#> ERR342890     1  0.1529      0.803 0.960  0 0.040
#> ERR342836     2  0.0000      1.000 0.000  1 0.000
#> ERR342879     1  0.5835      0.647 0.660  0 0.340
#> ERR342848     1  0.1031      0.806 0.976  0 0.024
#> ERR342861     1  0.0000      0.806 1.000  0 0.000
#> ERR342814     2  0.0000      1.000 0.000  1 0.000
#> ERR342870     1  0.6204      0.572 0.576  0 0.424
#> ERR342901     1  0.0000      0.806 1.000  0 0.000
#> ERR342908     1  0.6204      0.572 0.576  0 0.424
#> ERR342815     2  0.0000      1.000 0.000  1 0.000
#> ERR342897     3  0.0000      1.000 0.000  0 1.000
#> ERR342833     2  0.0000      1.000 0.000  1 0.000
#> ERR342817     3  0.0000      1.000 0.000  0 1.000
#> ERR342810     2  0.0000      1.000 0.000  1 0.000
#> ERR342867     1  0.6204      0.572 0.576  0 0.424
#> ERR342847     1  0.0237      0.806 0.996  0 0.004
#> ERR342855     1  0.0000      0.806 1.000  0 0.000
#> ERR342851     1  0.5327      0.696 0.728  0 0.272
#> ERR342813     1  0.1411      0.804 0.964  0 0.036
#> ERR342883     1  0.5948      0.629 0.640  0 0.360
#> ERR342856     3  0.0000      1.000 0.000  0 1.000
#> ERR342822     2  0.0000      1.000 0.000  1 0.000
#> ERR342892     1  0.0000      0.806 1.000  0 0.000
#> ERR342842     1  0.0000      0.806 1.000  0 0.000
#> ERR342902     2  0.0000      1.000 0.000  1 0.000
#> ERR342900     2  0.0000      1.000 0.000  1 0.000
#> ERR342888     1  0.2261      0.796 0.932  0 0.068
#> ERR342812     1  0.0000      0.806 1.000  0 0.000
#> ERR342853     2  0.0000      1.000 0.000  1 0.000
#> ERR342866     1  0.1031      0.803 0.976  0 0.024
#> ERR342820     1  0.6204      0.572 0.576  0 0.424
#> ERR342895     1  0.0000      0.806 1.000  0 0.000
#> ERR342825     3  0.0000      1.000 0.000  0 1.000
#> ERR342826     3  0.0000      1.000 0.000  0 1.000
#> ERR342875     2  0.0000      1.000 0.000  1 0.000
#> ERR342834     3  0.0000      1.000 0.000  0 1.000
#> ERR342898     1  0.6204      0.572 0.576  0 0.424
#> ERR342886     2  0.0000      1.000 0.000  1 0.000
#> ERR342838     1  0.0000      0.806 1.000  0 0.000
#> ERR342882     1  0.0000      0.806 1.000  0 0.000
#> ERR342807     2  0.0000      1.000 0.000  1 0.000
#> ERR342873     1  0.4002      0.756 0.840  0 0.160
#> ERR342844     1  0.6204      0.572 0.576  0 0.424
#> ERR342874     1  0.0892      0.804 0.980  0 0.020
#> ERR342893     1  0.5431      0.687 0.716  0 0.284
#> ERR342859     3  0.0000      1.000 0.000  0 1.000
#> ERR342830     2  0.0000      1.000 0.000  1 0.000
#> ERR342880     1  0.5835      0.647 0.660  0 0.340
#> ERR342887     1  0.0000      0.806 1.000  0 0.000
#> ERR342854     1  0.0000      0.806 1.000  0 0.000
#> ERR342904     1  0.6204      0.572 0.576  0 0.424
#> ERR342881     1  0.0592      0.805 0.988  0 0.012
#> ERR342858     1  0.5835      0.647 0.660  0 0.340

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1 p2    p3    p4
#> ERR342845     1  0.1109     0.9398 0.968  0 0.004 0.028
#> ERR342843     1  0.1489     0.9303 0.952  0 0.004 0.044
#> ERR342896     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342827     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342871     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342863     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342839     1  0.1305     0.9355 0.960  0 0.004 0.036
#> ERR342906     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342905     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342816     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342865     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342824     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342841     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342835     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342899     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342829     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342850     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342849     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342811     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342837     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342857     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342869     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342903     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342819     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342885     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342889     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342864     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342860     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342808     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342823     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342907     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342852     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342832     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342868     1  0.1978     0.9101 0.928  0 0.004 0.068
#> ERR342821     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342878     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342876     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342809     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342846     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342872     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342828     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342840     1  0.0707     0.9416 0.980  0 0.000 0.020
#> ERR342831     1  0.0657     0.9452 0.984  0 0.004 0.012
#> ERR342818     1  0.4977     0.0460 0.540  0 0.000 0.460
#> ERR342862     1  0.0921     0.9361 0.972  0 0.000 0.028
#> ERR342894     1  0.1398     0.9331 0.956  0 0.004 0.040
#> ERR342884     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342891     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342890     1  0.1398     0.9331 0.956  0 0.004 0.040
#> ERR342836     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342879     4  0.4585     0.5527 0.332  0 0.000 0.668
#> ERR342848     1  0.1211     0.9256 0.960  0 0.000 0.040
#> ERR342861     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342814     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342870     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342901     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342908     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342815     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342897     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342833     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342817     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342810     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342867     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342847     1  0.0188     0.9499 0.996  0 0.000 0.004
#> ERR342855     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342851     1  0.4994    -0.0395 0.520  0 0.000 0.480
#> ERR342813     1  0.1398     0.9331 0.956  0 0.004 0.040
#> ERR342883     4  0.4250     0.6483 0.276  0 0.000 0.724
#> ERR342856     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342822     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342892     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342842     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342902     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342900     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342888     1  0.1902     0.9139 0.932  0 0.004 0.064
#> ERR342812     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342853     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342866     1  0.1022     0.9330 0.968  0 0.000 0.032
#> ERR342820     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342895     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342825     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342826     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342875     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342834     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342898     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342886     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342838     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342882     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342807     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342873     1  0.4164     0.6038 0.736  0 0.000 0.264
#> ERR342844     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342874     1  0.0817     0.9390 0.976  0 0.000 0.024
#> ERR342893     4  0.4967     0.2437 0.452  0 0.000 0.548
#> ERR342859     3  0.0188     1.0000 0.000  0 0.996 0.004
#> ERR342830     2  0.0000     1.0000 0.000  1 0.000 0.000
#> ERR342880     4  0.4304     0.6365 0.284  0 0.000 0.716
#> ERR342887     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342854     1  0.0000     0.9514 1.000  0 0.000 0.000
#> ERR342904     4  0.0336     0.8931 0.008  0 0.000 0.992
#> ERR342881     1  0.0707     0.9416 0.980  0 0.000 0.020
#> ERR342858     4  0.4605     0.5446 0.336  0 0.000 0.664

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1 p2 p3    p4    p5
#> ERR342845     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342843     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342896     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342827     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342871     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342863     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342839     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342906     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342905     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342816     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342865     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342824     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342841     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342835     1  0.0404      0.969 0.988  0  0 0.012 0.000
#> ERR342899     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342829     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342850     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342849     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342811     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342837     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342857     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342869     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342903     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342819     1  0.0404      0.969 0.988  0  0 0.012 0.000
#> ERR342885     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342889     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342864     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342860     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342808     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342823     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342907     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342852     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342832     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342868     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342821     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342878     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342876     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342809     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342872     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342828     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342840     1  0.2390      0.901 0.896  0  0 0.084 0.020
#> ERR342831     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342818     4  0.3730      0.693 0.288  0  0 0.712 0.000
#> ERR342862     1  0.1851      0.909 0.912  0  0 0.088 0.000
#> ERR342894     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342884     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342891     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342890     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342836     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342879     4  0.3210      0.780 0.212  0  0 0.788 0.000
#> ERR342848     1  0.1341      0.925 0.944  0  0 0.056 0.000
#> ERR342861     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342814     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342870     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342901     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342908     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342815     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342897     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342833     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342817     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342810     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342867     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342847     1  0.1992      0.929 0.924  0  0 0.044 0.032
#> ERR342855     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342851     4  0.3424      0.753 0.240  0  0 0.760 0.000
#> ERR342813     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342883     4  0.3210      0.780 0.212  0  0 0.788 0.000
#> ERR342856     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342822     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342892     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342842     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342902     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342900     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342888     5  0.0000      1.000 0.000  0  0 0.000 1.000
#> ERR342812     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342853     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342866     1  0.2068      0.902 0.904  0  0 0.092 0.004
#> ERR342820     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342895     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342875     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342834     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342898     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342886     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342838     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342882     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342807     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342873     4  0.4294      0.288 0.468  0  0 0.532 0.000
#> ERR342844     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342874     1  0.1851      0.909 0.912  0  0 0.088 0.000
#> ERR342893     4  0.3242      0.777 0.216  0  0 0.784 0.000
#> ERR342859     3  0.0000      1.000 0.000  0  1 0.000 0.000
#> ERR342830     2  0.0000      1.000 0.000  1  0 0.000 0.000
#> ERR342880     4  0.3210      0.780 0.212  0  0 0.788 0.000
#> ERR342887     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342854     1  0.0000      0.975 1.000  0  0 0.000 0.000
#> ERR342904     4  0.0000      0.899 0.000  0  0 1.000 0.000
#> ERR342881     1  0.1732      0.916 0.920  0  0 0.080 0.000
#> ERR342858     4  0.3210      0.780 0.212  0  0 0.788 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1 p2 p3    p4    p5    p6
#> ERR342845     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342843     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342896     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342827     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342871     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342863     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342839     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342906     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342905     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342816     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342865     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342824     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342841     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342835     1   0.293      0.806 0.796  0  0 0.004 0.000 0.200
#> ERR342899     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342829     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342850     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342849     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342811     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342837     1   0.279      0.807 0.800  0  0 0.000 0.000 0.200
#> ERR342857     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342869     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342903     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342819     1   0.293      0.806 0.796  0  0 0.004 0.000 0.200
#> ERR342885     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342889     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342864     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342860     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342808     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342823     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342907     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342852     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342832     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342868     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342821     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342878     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342876     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342809     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342846     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342872     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342828     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342840     1   0.529      0.670 0.628  0  0 0.160 0.008 0.204
#> ERR342831     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342818     6   0.352      0.899 0.072  0  0 0.128 0.000 0.800
#> ERR342862     1   0.517      0.658 0.620  0  0 0.176 0.000 0.204
#> ERR342894     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342884     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342891     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342890     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342836     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342879     6   0.310      0.914 0.016  0  0 0.184 0.000 0.800
#> ERR342848     6   0.279      0.747 0.200  0  0 0.000 0.000 0.800
#> ERR342861     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342814     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342870     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342901     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342908     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342815     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342897     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342833     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342817     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342810     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342867     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342847     1   0.396      0.778 0.748  0  0 0.040 0.008 0.204
#> ERR342855     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342851     6   0.338      0.917 0.044  0  0 0.156 0.000 0.800
#> ERR342813     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342883     6   0.298      0.905 0.008  0  0 0.192 0.000 0.800
#> ERR342856     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342822     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342892     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342842     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342902     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342900     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342888     5   0.000      1.000 0.000  0  0 0.000 1.000 0.000
#> ERR342812     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342853     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342866     1   0.525      0.664 0.624  0  0 0.168 0.004 0.204
#> ERR342820     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342895     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342825     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342826     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342875     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342834     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342898     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342886     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342838     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342882     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342807     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342873     6   0.341      0.816 0.152  0  0 0.048 0.000 0.800
#> ERR342844     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342874     1   0.506      0.676 0.636  0  0 0.164 0.000 0.200
#> ERR342893     6   0.324      0.920 0.028  0  0 0.172 0.000 0.800
#> ERR342859     3   0.000      1.000 0.000  0  1 0.000 0.000 0.000
#> ERR342830     2   0.000      1.000 0.000  1  0 0.000 0.000 0.000
#> ERR342880     6   0.305      0.910 0.012  0  0 0.188 0.000 0.800
#> ERR342887     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342854     1   0.000      0.901 1.000  0  0 0.000 0.000 0.000
#> ERR342904     4   0.000      1.000 0.000  0  0 1.000 0.000 0.000
#> ERR342881     1   0.483      0.705 0.664  0  0 0.136 0.000 0.200
#> ERR342858     6   0.324      0.920 0.028  0  0 0.172 0.000 0.800

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:mclust**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "mclust"]
# you can also extract it by
# res = res_list["MAD:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.988       0.990         0.2898 0.717   0.717
#> 3 3 0.405           0.758       0.796         1.0765 0.733   0.631
#> 4 4 0.595           0.603       0.779         0.2017 0.652   0.343
#> 5 5 0.702           0.842       0.800         0.0521 0.818   0.452
#> 6 6 0.834           0.878       0.927         0.0723 0.950   0.786

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      0.988 1.000 0.000
#> ERR342843     1   0.000      0.988 1.000 0.000
#> ERR342896     2   0.000      1.000 0.000 1.000
#> ERR342827     1   0.000      0.988 1.000 0.000
#> ERR342871     1   0.163      0.985 0.976 0.024
#> ERR342863     1   0.000      0.988 1.000 0.000
#> ERR342839     1   0.000      0.988 1.000 0.000
#> ERR342906     1   0.163      0.985 0.976 0.024
#> ERR342905     1   0.000      0.988 1.000 0.000
#> ERR342816     1   0.163      0.985 0.976 0.024
#> ERR342865     1   0.000      0.988 1.000 0.000
#> ERR342824     1   0.388      0.938 0.924 0.076
#> ERR342841     1   0.000      0.988 1.000 0.000
#> ERR342835     1   0.000      0.988 1.000 0.000
#> ERR342899     1   0.000      0.988 1.000 0.000
#> ERR342829     2   0.000      1.000 0.000 1.000
#> ERR342850     1   0.163      0.985 0.976 0.024
#> ERR342849     1   0.000      0.988 1.000 0.000
#> ERR342811     1   0.163      0.985 0.976 0.024
#> ERR342837     1   0.000      0.988 1.000 0.000
#> ERR342857     1   0.163      0.985 0.976 0.024
#> ERR342869     1   0.163      0.985 0.976 0.024
#> ERR342903     2   0.000      1.000 0.000 1.000
#> ERR342819     1   0.000      0.988 1.000 0.000
#> ERR342885     1   0.163      0.985 0.976 0.024
#> ERR342889     1   0.000      0.988 1.000 0.000
#> ERR342864     1   0.163      0.985 0.976 0.024
#> ERR342860     1   0.000      0.988 1.000 0.000
#> ERR342808     1   0.163      0.985 0.976 0.024
#> ERR342823     1   0.388      0.938 0.924 0.076
#> ERR342907     1   0.000      0.988 1.000 0.000
#> ERR342852     1   0.163      0.985 0.976 0.024
#> ERR342832     1   0.000      0.988 1.000 0.000
#> ERR342868     1   0.000      0.988 1.000 0.000
#> ERR342821     1   0.163      0.985 0.976 0.024
#> ERR342878     1   0.000      0.988 1.000 0.000
#> ERR342876     2   0.000      1.000 0.000 1.000
#> ERR342809     2   0.000      1.000 0.000 1.000
#> ERR342846     1   0.163      0.985 0.976 0.024
#> ERR342872     1   0.000      0.988 1.000 0.000
#> ERR342828     1   0.000      0.988 1.000 0.000
#> ERR342840     1   0.000      0.988 1.000 0.000
#> ERR342831     1   0.000      0.988 1.000 0.000
#> ERR342818     1   0.163      0.985 0.976 0.024
#> ERR342862     1   0.000      0.988 1.000 0.000
#> ERR342894     1   0.000      0.988 1.000 0.000
#> ERR342884     1   0.000      0.988 1.000 0.000
#> ERR342891     2   0.000      1.000 0.000 1.000
#> ERR342890     1   0.000      0.988 1.000 0.000
#> ERR342836     1   0.000      0.988 1.000 0.000
#> ERR342879     1   0.163      0.985 0.976 0.024
#> ERR342848     1   0.163      0.985 0.976 0.024
#> ERR342861     2   0.000      1.000 0.000 1.000
#> ERR342814     1   0.000      0.988 1.000 0.000
#> ERR342870     1   0.163      0.985 0.976 0.024
#> ERR342901     2   0.000      1.000 0.000 1.000
#> ERR342908     1   0.163      0.985 0.976 0.024
#> ERR342815     1   0.000      0.988 1.000 0.000
#> ERR342897     1   0.163      0.985 0.976 0.024
#> ERR342833     1   0.000      0.988 1.000 0.000
#> ERR342817     1   0.163      0.985 0.976 0.024
#> ERR342810     1   0.000      0.988 1.000 0.000
#> ERR342867     1   0.163      0.985 0.976 0.024
#> ERR342847     1   0.000      0.988 1.000 0.000
#> ERR342855     2   0.000      1.000 0.000 1.000
#> ERR342851     1   0.163      0.985 0.976 0.024
#> ERR342813     1   0.000      0.988 1.000 0.000
#> ERR342883     1   0.163      0.985 0.976 0.024
#> ERR342856     1   0.163      0.985 0.976 0.024
#> ERR342822     1   0.000      0.988 1.000 0.000
#> ERR342892     2   0.000      1.000 0.000 1.000
#> ERR342842     2   0.000      1.000 0.000 1.000
#> ERR342902     1   0.000      0.988 1.000 0.000
#> ERR342900     1   0.000      0.988 1.000 0.000
#> ERR342888     1   0.000      0.988 1.000 0.000
#> ERR342812     2   0.000      1.000 0.000 1.000
#> ERR342853     1   0.000      0.988 1.000 0.000
#> ERR342866     1   0.000      0.988 1.000 0.000
#> ERR342820     1   0.163      0.985 0.976 0.024
#> ERR342895     2   0.000      1.000 0.000 1.000
#> ERR342825     1   0.163      0.985 0.976 0.024
#> ERR342826     1   0.163      0.985 0.976 0.024
#> ERR342875     1   0.000      0.988 1.000 0.000
#> ERR342834     1   0.163      0.985 0.976 0.024
#> ERR342898     1   0.163      0.985 0.976 0.024
#> ERR342886     1   0.000      0.988 1.000 0.000
#> ERR342838     2   0.000      1.000 0.000 1.000
#> ERR342882     2   0.000      1.000 0.000 1.000
#> ERR342807     1   0.000      0.988 1.000 0.000
#> ERR342873     1   0.163      0.985 0.976 0.024
#> ERR342844     1   0.163      0.985 0.976 0.024
#> ERR342874     1   0.000      0.988 1.000 0.000
#> ERR342893     1   0.163      0.985 0.976 0.024
#> ERR342859     1   0.163      0.985 0.976 0.024
#> ERR342830     1   0.000      0.988 1.000 0.000
#> ERR342880     1   0.163      0.985 0.976 0.024
#> ERR342887     2   0.000      1.000 0.000 1.000
#> ERR342854     2   0.000      1.000 0.000 1.000
#> ERR342904     1   0.163      0.985 0.976 0.024
#> ERR342881     1   0.000      0.988 1.000 0.000
#> ERR342858     1   0.163      0.985 0.976 0.024

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342843     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342896     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342827     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342871     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342863     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342839     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342906     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342905     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342816     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342865     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342824     1  0.5986      0.692 0.736 0.024 0.240
#> ERR342841     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342835     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342899     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342829     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342850     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342849     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342811     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342837     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342857     3  0.0848      0.994 0.008 0.008 0.984
#> ERR342869     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342903     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342819     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342885     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342889     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342864     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342860     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342808     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342823     1  0.5986      0.692 0.736 0.024 0.240
#> ERR342907     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342852     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342832     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342868     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342821     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342878     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342876     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342809     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342846     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342872     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342828     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342840     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342831     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342818     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342862     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342894     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342884     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342891     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342890     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342836     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342879     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342848     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342861     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342814     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342870     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342901     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342908     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342815     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342897     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342833     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342817     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342810     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342867     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342847     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342855     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342851     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342813     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342883     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342856     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342822     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342892     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342842     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342902     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342900     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342888     2  0.5365      0.659 0.252 0.744 0.004
#> ERR342812     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342853     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342866     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342820     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342895     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342825     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342826     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342875     2  0.4834      0.661 0.004 0.792 0.204
#> ERR342834     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342898     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342886     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342838     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342882     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342807     2  0.6107      0.703 0.100 0.784 0.116
#> ERR342873     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342844     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342874     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342893     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342859     2  0.6057      0.548 0.004 0.656 0.340
#> ERR342830     2  0.2056      0.713 0.024 0.952 0.024
#> ERR342880     2  0.9636      0.583 0.284 0.468 0.248
#> ERR342887     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342854     1  0.2356      0.971 0.928 0.000 0.072
#> ERR342904     3  0.0661      1.000 0.008 0.004 0.988
#> ERR342881     2  0.6451      0.574 0.436 0.560 0.004
#> ERR342858     2  0.9636      0.583 0.284 0.468 0.248

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342843     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342896     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342827     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342871     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342863     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342839     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342906     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342905     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342816     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342865     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342824     1  0.2101      0.731 0.928 0.000 0.012 0.060
#> ERR342841     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342835     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342899     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342829     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342850     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342849     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342811     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342837     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342857     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342869     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342903     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342819     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342885     3  0.7493      0.180 0.000 0.200 0.480 0.320
#> ERR342889     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342864     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342860     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342808     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342823     1  0.2101      0.731 0.928 0.000 0.012 0.060
#> ERR342907     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342852     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342832     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342868     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342821     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342878     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342876     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342846     3  0.7469      0.181 0.000 0.200 0.488 0.312
#> ERR342872     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342828     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342840     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342831     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342818     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342862     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342894     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342884     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342891     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342890     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342836     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342879     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342848     1  0.8709      0.255 0.428 0.232 0.048 0.292
#> ERR342861     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342814     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342870     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342901     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342908     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342815     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342897     3  0.7469      0.181 0.000 0.200 0.488 0.312
#> ERR342833     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342817     3  0.7493      0.180 0.000 0.200 0.480 0.320
#> ERR342810     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342867     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342847     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342855     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342851     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342813     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342883     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342856     3  0.7469      0.181 0.000 0.200 0.488 0.312
#> ERR342822     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342892     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342902     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342900     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342888     3  0.2197      0.563 0.024 0.048 0.928 0.000
#> ERR342812     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342853     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342866     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342820     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342895     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342825     3  0.7493      0.180 0.000 0.200 0.480 0.320
#> ERR342826     3  0.7493      0.180 0.000 0.200 0.480 0.320
#> ERR342875     2  0.3088      0.875 0.008 0.864 0.000 0.128
#> ERR342834     3  0.7493      0.180 0.000 0.200 0.480 0.320
#> ERR342898     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342886     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342838     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342807     4  0.7403      0.437 0.120 0.384 0.012 0.484
#> ERR342873     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342844     4  0.0000      0.787 0.000 0.000 0.000 1.000
#> ERR342874     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342893     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342859     3  0.7469      0.181 0.000 0.200 0.488 0.312
#> ERR342830     2  0.2153      0.885 0.008 0.936 0.036 0.020
#> ERR342880     1  0.8714      0.247 0.420 0.224 0.048 0.308
#> ERR342887     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.765 1.000 0.000 0.000 0.000
#> ERR342904     4  0.0336      0.786 0.000 0.000 0.008 0.992
#> ERR342881     3  0.6044      0.301 0.044 0.428 0.528 0.000
#> ERR342858     1  0.8714      0.247 0.420 0.224 0.048 0.308

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342843     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342896     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342871     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342863     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342839     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342906     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342905     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342816     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342865     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342824     1  0.0609      0.971 0.980 0.020 0.000 0.000 0.000
#> ERR342841     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342835     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342899     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342829     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342849     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342811     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342837     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342857     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342869     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342903     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342885     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342889     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342864     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342860     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342808     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342823     1  0.0609      0.971 0.980 0.020 0.000 0.000 0.000
#> ERR342907     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342852     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342832     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342868     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342821     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342878     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342876     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342872     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342828     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342840     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342831     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342818     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342862     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342894     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342884     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342891     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342836     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342879     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342848     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342861     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342870     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342901     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342815     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342897     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342833     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342817     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342810     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342867     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342847     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342855     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342851     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342813     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342883     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342856     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342822     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342892     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342900     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342888     5  0.3930      0.920 0.000 0.152 0.056 0.000 0.792
#> ERR342812     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342866     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342820     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342895     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342826     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342875     2  0.0566      0.698 0.004 0.984 0.000 0.012 0.000
#> ERR342834     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342898     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342886     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342838     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.5583      0.590 0.000 0.640 0.000 0.208 0.152
#> ERR342873     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342844     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342874     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342893     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342859     3  0.0404      1.000 0.000 0.000 0.988 0.012 0.000
#> ERR342830     2  0.2516      0.659 0.000 0.860 0.000 0.000 0.140
#> ERR342880     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100
#> ERR342887     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.997 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.3109      1.000 0.000 0.000 0.200 0.800 0.000
#> ERR342881     5  0.3242      0.914 0.000 0.216 0.000 0.000 0.784
#> ERR342858     2  0.8151      0.498 0.064 0.524 0.200 0.112 0.100

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3    p4    p5    p6
#> ERR342845     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342843     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342896     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342827     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342871     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342863     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342839     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342906     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342905     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342816     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342865     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342824     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342841     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342835     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342899     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342829     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342850     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342849     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342811     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342837     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342857     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342869     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342903     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342819     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342885     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342889     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342864     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342860     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342808     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342823     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342907     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342852     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342832     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342868     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342821     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342878     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342876     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342809     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342846     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342872     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342828     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342840     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342831     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342818     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342862     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342894     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342884     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342891     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342890     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342836     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342879     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342848     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342861     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342814     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342870     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342901     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342908     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342815     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342897     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342833     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342817     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342810     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342867     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342847     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342855     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342851     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342813     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342883     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342856     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342822     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342892     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342842     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342902     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342900     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342888     5   0.000      0.876 0.000 0.000  0 0.000 1.000 0.000
#> ERR342812     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342853     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342866     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342820     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342895     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342825     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342826     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342875     2   0.230      0.687 0.000 0.856  0 0.000 0.000 0.144
#> ERR342834     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342898     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342886     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342838     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342882     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342807     6   0.000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342873     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342844     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342874     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342893     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342859     3   0.000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342830     2   0.000      0.745 0.000 1.000  0 0.000 0.000 0.000
#> ERR342880     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000
#> ERR342887     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342854     1   0.000      1.000 1.000 0.000  0 0.000 0.000 0.000
#> ERR342904     4   0.000      1.000 0.000 0.000  0 1.000 0.000 0.000
#> ERR342881     5   0.273      0.870 0.000 0.192  0 0.000 0.808 0.000
#> ERR342858     2   0.593      0.477 0.016 0.512  0 0.316 0.156 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "NMF"]
# you can also extract it by
# res = res_list["MAD:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.772           0.945       0.972         0.4639 0.531   0.531
#> 3 3 0.643           0.756       0.883         0.3866 0.740   0.542
#> 4 4 0.699           0.853       0.879         0.1483 0.748   0.403
#> 5 5 0.892           0.930       0.941         0.0565 0.902   0.652
#> 6 6 0.818           0.798       0.822         0.0426 0.913   0.652

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1   0.000      0.978 1.000 0.000
#> ERR342843     1   0.000      0.978 1.000 0.000
#> ERR342896     1   0.000      0.978 1.000 0.000
#> ERR342827     2   0.000      0.955 0.000 1.000
#> ERR342871     1   0.000      0.978 1.000 0.000
#> ERR342863     2   0.000      0.955 0.000 1.000
#> ERR342839     1   0.000      0.978 1.000 0.000
#> ERR342906     1   0.482      0.884 0.896 0.104
#> ERR342905     2   0.000      0.955 0.000 1.000
#> ERR342816     1   0.482      0.884 0.896 0.104
#> ERR342865     2   0.000      0.955 0.000 1.000
#> ERR342824     1   0.000      0.978 1.000 0.000
#> ERR342841     2   0.000      0.955 0.000 1.000
#> ERR342835     1   0.000      0.978 1.000 0.000
#> ERR342899     2   0.000      0.955 0.000 1.000
#> ERR342829     1   0.000      0.978 1.000 0.000
#> ERR342850     1   0.000      0.978 1.000 0.000
#> ERR342849     2   0.000      0.955 0.000 1.000
#> ERR342811     1   0.000      0.978 1.000 0.000
#> ERR342837     1   0.000      0.978 1.000 0.000
#> ERR342857     1   0.767      0.720 0.776 0.224
#> ERR342869     1   0.000      0.978 1.000 0.000
#> ERR342903     1   0.000      0.978 1.000 0.000
#> ERR342819     1   0.000      0.978 1.000 0.000
#> ERR342885     2   0.722      0.790 0.200 0.800
#> ERR342889     2   0.000      0.955 0.000 1.000
#> ERR342864     1   0.506      0.875 0.888 0.112
#> ERR342860     2   0.000      0.955 0.000 1.000
#> ERR342808     1   0.000      0.978 1.000 0.000
#> ERR342823     1   0.000      0.978 1.000 0.000
#> ERR342907     2   0.000      0.955 0.000 1.000
#> ERR342852     1   0.753      0.733 0.784 0.216
#> ERR342832     2   0.000      0.955 0.000 1.000
#> ERR342868     1   0.000      0.978 1.000 0.000
#> ERR342821     1   0.456      0.892 0.904 0.096
#> ERR342878     2   0.000      0.955 0.000 1.000
#> ERR342876     1   0.000      0.978 1.000 0.000
#> ERR342809     1   0.000      0.978 1.000 0.000
#> ERR342846     2   0.552      0.867 0.128 0.872
#> ERR342872     2   0.000      0.955 0.000 1.000
#> ERR342828     2   0.000      0.955 0.000 1.000
#> ERR342840     1   0.000      0.978 1.000 0.000
#> ERR342831     1   0.000      0.978 1.000 0.000
#> ERR342818     1   0.000      0.978 1.000 0.000
#> ERR342862     1   0.000      0.978 1.000 0.000
#> ERR342894     1   0.000      0.978 1.000 0.000
#> ERR342884     2   0.000      0.955 0.000 1.000
#> ERR342891     1   0.000      0.978 1.000 0.000
#> ERR342890     1   0.000      0.978 1.000 0.000
#> ERR342836     2   0.000      0.955 0.000 1.000
#> ERR342879     1   0.000      0.978 1.000 0.000
#> ERR342848     1   0.000      0.978 1.000 0.000
#> ERR342861     1   0.000      0.978 1.000 0.000
#> ERR342814     2   0.000      0.955 0.000 1.000
#> ERR342870     1   0.000      0.978 1.000 0.000
#> ERR342901     1   0.000      0.978 1.000 0.000
#> ERR342908     1   0.000      0.978 1.000 0.000
#> ERR342815     2   0.000      0.955 0.000 1.000
#> ERR342897     2   0.625      0.841 0.156 0.844
#> ERR342833     2   0.000      0.955 0.000 1.000
#> ERR342817     2   0.706      0.800 0.192 0.808
#> ERR342810     2   0.000      0.955 0.000 1.000
#> ERR342867     1   0.482      0.884 0.896 0.104
#> ERR342847     1   0.000      0.978 1.000 0.000
#> ERR342855     1   0.000      0.978 1.000 0.000
#> ERR342851     1   0.000      0.978 1.000 0.000
#> ERR342813     1   0.000      0.978 1.000 0.000
#> ERR342883     1   0.000      0.978 1.000 0.000
#> ERR342856     2   0.563      0.864 0.132 0.868
#> ERR342822     2   0.000      0.955 0.000 1.000
#> ERR342892     1   0.000      0.978 1.000 0.000
#> ERR342842     1   0.000      0.978 1.000 0.000
#> ERR342902     2   0.000      0.955 0.000 1.000
#> ERR342900     2   0.000      0.955 0.000 1.000
#> ERR342888     1   0.000      0.978 1.000 0.000
#> ERR342812     1   0.000      0.978 1.000 0.000
#> ERR342853     2   0.000      0.955 0.000 1.000
#> ERR342866     1   0.000      0.978 1.000 0.000
#> ERR342820     1   0.000      0.978 1.000 0.000
#> ERR342895     1   0.000      0.978 1.000 0.000
#> ERR342825     2   0.722      0.790 0.200 0.800
#> ERR342826     2   0.680      0.814 0.180 0.820
#> ERR342875     2   0.000      0.955 0.000 1.000
#> ERR342834     2   0.722      0.790 0.200 0.800
#> ERR342898     1   0.634      0.816 0.840 0.160
#> ERR342886     2   0.000      0.955 0.000 1.000
#> ERR342838     1   0.000      0.978 1.000 0.000
#> ERR342882     1   0.000      0.978 1.000 0.000
#> ERR342807     2   0.000      0.955 0.000 1.000
#> ERR342873     1   0.000      0.978 1.000 0.000
#> ERR342844     1   0.671      0.794 0.824 0.176
#> ERR342874     1   0.000      0.978 1.000 0.000
#> ERR342893     1   0.000      0.978 1.000 0.000
#> ERR342859     2   0.574      0.860 0.136 0.864
#> ERR342830     2   0.000      0.955 0.000 1.000
#> ERR342880     1   0.000      0.978 1.000 0.000
#> ERR342887     1   0.000      0.978 1.000 0.000
#> ERR342854     1   0.000      0.978 1.000 0.000
#> ERR342904     1   0.000      0.978 1.000 0.000
#> ERR342881     1   0.000      0.978 1.000 0.000
#> ERR342858     1   0.000      0.978 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     3  0.5497    0.59731 0.292 0.000 0.708
#> ERR342843     3  0.3551    0.72993 0.132 0.000 0.868
#> ERR342896     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342827     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342871     1  0.6267   -0.07353 0.548 0.000 0.452
#> ERR342863     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342839     3  0.5098    0.64873 0.248 0.000 0.752
#> ERR342906     3  0.5397    0.67553 0.280 0.000 0.720
#> ERR342905     2  0.2356    0.93968 0.000 0.928 0.072
#> ERR342816     3  0.5591    0.65236 0.304 0.000 0.696
#> ERR342865     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342824     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342841     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342835     1  0.4702    0.67558 0.788 0.000 0.212
#> ERR342899     2  0.2711    0.93280 0.000 0.912 0.088
#> ERR342829     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342850     1  0.6286   -0.11257 0.536 0.000 0.464
#> ERR342849     2  0.2796    0.93014 0.000 0.908 0.092
#> ERR342811     1  0.6026    0.20008 0.624 0.000 0.376
#> ERR342837     1  0.4654    0.67920 0.792 0.000 0.208
#> ERR342857     3  0.4399    0.72986 0.188 0.000 0.812
#> ERR342869     3  0.6111    0.48624 0.396 0.000 0.604
#> ERR342903     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342819     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342885     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342889     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342864     3  0.6627    0.60589 0.336 0.020 0.644
#> ERR342860     2  0.3267    0.90940 0.000 0.884 0.116
#> ERR342808     1  0.5810    0.32215 0.664 0.000 0.336
#> ERR342823     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342907     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342852     3  0.6357    0.65437 0.296 0.020 0.684
#> ERR342832     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342868     3  0.3340    0.73337 0.120 0.000 0.880
#> ERR342821     3  0.5810    0.61273 0.336 0.000 0.664
#> ERR342878     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342876     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342809     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342846     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342872     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342828     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342840     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342831     3  0.5650    0.56485 0.312 0.000 0.688
#> ERR342818     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342862     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342894     3  0.4750    0.67909 0.216 0.000 0.784
#> ERR342884     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342891     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342890     3  0.5254    0.63275 0.264 0.000 0.736
#> ERR342836     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342879     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342848     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342861     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342814     2  0.2625    0.93513 0.000 0.916 0.084
#> ERR342870     3  0.6252    0.35986 0.444 0.000 0.556
#> ERR342901     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342908     1  0.5706    0.36208 0.680 0.000 0.320
#> ERR342815     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342897     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342833     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342817     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342810     2  0.2448    0.93842 0.000 0.924 0.076
#> ERR342867     3  0.5733    0.63080 0.324 0.000 0.676
#> ERR342847     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342855     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342851     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342813     3  0.4654    0.68173 0.208 0.000 0.792
#> ERR342883     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342856     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342822     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342892     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342842     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342902     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342900     2  0.2625    0.93513 0.000 0.916 0.084
#> ERR342888     3  0.3340    0.73349 0.120 0.000 0.880
#> ERR342812     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342853     2  0.2356    0.93968 0.000 0.928 0.072
#> ERR342866     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342820     1  0.6308   -0.20602 0.508 0.000 0.492
#> ERR342895     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342825     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342826     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342875     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342834     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342898     3  0.5982    0.62398 0.328 0.004 0.668
#> ERR342886     2  0.3340    0.90516 0.000 0.880 0.120
#> ERR342838     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342882     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342807     2  0.0000    0.96622 0.000 1.000 0.000
#> ERR342873     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342844     3  0.5178    0.69333 0.256 0.000 0.744
#> ERR342874     1  0.4750    0.67098 0.784 0.000 0.216
#> ERR342893     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342859     3  0.2486    0.75087 0.008 0.060 0.932
#> ERR342830     2  0.3038    0.92072 0.000 0.896 0.104
#> ERR342880     1  0.0237    0.84464 0.996 0.000 0.004
#> ERR342887     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342854     1  0.0000    0.84562 1.000 0.000 0.000
#> ERR342904     1  0.6235   -0.00503 0.564 0.000 0.436
#> ERR342881     1  0.4702    0.67558 0.788 0.000 0.212
#> ERR342858     1  0.0237    0.84464 0.996 0.000 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.0927      0.874 0.008 0.000 0.976 0.016
#> ERR342843     3  0.0707      0.871 0.000 0.000 0.980 0.020
#> ERR342896     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342827     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342871     4  0.5410      0.809 0.192 0.000 0.080 0.728
#> ERR342863     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342839     3  0.0895      0.872 0.004 0.000 0.976 0.020
#> ERR342906     4  0.4701      0.827 0.164 0.000 0.056 0.780
#> ERR342905     3  0.3870      0.812 0.004 0.208 0.788 0.000
#> ERR342816     4  0.4996      0.819 0.192 0.000 0.056 0.752
#> ERR342865     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342841     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342835     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342899     3  0.4018      0.800 0.004 0.224 0.772 0.000
#> ERR342829     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342850     4  0.5332      0.813 0.184 0.000 0.080 0.736
#> ERR342849     3  0.4122      0.787 0.004 0.236 0.760 0.000
#> ERR342811     4  0.5850      0.769 0.244 0.000 0.080 0.676
#> ERR342837     3  0.2565      0.870 0.056 0.000 0.912 0.032
#> ERR342857     4  0.3796      0.824 0.096 0.000 0.056 0.848
#> ERR342869     4  0.4581      0.825 0.120 0.000 0.080 0.800
#> ERR342903     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342819     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342885     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342889     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342864     4  0.5489      0.792 0.240 0.000 0.060 0.700
#> ERR342860     3  0.4053      0.796 0.004 0.228 0.768 0.000
#> ERR342808     4  0.6180      0.704 0.296 0.000 0.080 0.624
#> ERR342823     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342907     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342852     4  0.5221      0.812 0.208 0.000 0.060 0.732
#> ERR342832     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342868     3  0.0817      0.869 0.000 0.000 0.976 0.024
#> ERR342821     4  0.5426      0.798 0.232 0.000 0.060 0.708
#> ERR342878     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342876     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342809     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342846     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342872     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342828     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342840     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342831     3  0.0672      0.875 0.008 0.000 0.984 0.008
#> ERR342818     1  0.5593      0.721 0.708 0.000 0.212 0.080
#> ERR342862     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342894     3  0.0895      0.872 0.004 0.000 0.976 0.020
#> ERR342884     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342891     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342890     3  0.0895      0.872 0.004 0.000 0.976 0.020
#> ERR342836     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342879     1  0.6065      0.668 0.644 0.000 0.276 0.080
#> ERR342848     1  0.4469      0.763 0.808 0.000 0.112 0.080
#> ERR342861     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342814     3  0.4053      0.796 0.004 0.228 0.768 0.000
#> ERR342870     4  0.4841      0.824 0.140 0.000 0.080 0.780
#> ERR342901     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342908     4  0.6242      0.687 0.308 0.000 0.080 0.612
#> ERR342815     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342897     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342833     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342817     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342810     3  0.3831      0.814 0.004 0.204 0.792 0.000
#> ERR342867     4  0.5321      0.801 0.228 0.000 0.056 0.716
#> ERR342847     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342855     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342851     1  0.5989      0.682 0.656 0.000 0.264 0.080
#> ERR342813     3  0.0895      0.872 0.004 0.000 0.976 0.020
#> ERR342883     1  0.5935      0.690 0.664 0.000 0.256 0.080
#> ERR342856     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342822     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342842     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342902     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342900     3  0.4343      0.751 0.004 0.264 0.732 0.000
#> ERR342888     3  0.0817      0.869 0.000 0.000 0.976 0.024
#> ERR342812     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342853     3  0.3908      0.809 0.004 0.212 0.784 0.000
#> ERR342866     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342820     4  0.5143      0.819 0.172 0.000 0.076 0.752
#> ERR342895     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342825     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342826     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342875     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342834     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342898     4  0.5361      0.804 0.224 0.000 0.060 0.716
#> ERR342886     3  0.3945      0.806 0.004 0.216 0.780 0.000
#> ERR342838     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342882     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342807     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> ERR342873     1  0.5694      0.715 0.696 0.000 0.224 0.080
#> ERR342844     4  0.4541      0.829 0.144 0.000 0.060 0.796
#> ERR342874     3  0.2494      0.872 0.048 0.000 0.916 0.036
#> ERR342893     1  0.6065      0.669 0.644 0.000 0.276 0.080
#> ERR342859     4  0.2011      0.774 0.000 0.000 0.080 0.920
#> ERR342830     3  0.3870      0.812 0.004 0.208 0.788 0.000
#> ERR342880     1  0.5879      0.697 0.672 0.000 0.248 0.080
#> ERR342887     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342854     1  0.0188      0.883 0.996 0.000 0.004 0.000
#> ERR342904     4  0.5371      0.810 0.188 0.000 0.080 0.732
#> ERR342881     3  0.2578      0.871 0.052 0.000 0.912 0.036
#> ERR342858     1  0.5727      0.712 0.692 0.000 0.228 0.080

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.2069      0.838 0.000 0.000 0.012 0.076 0.912
#> ERR342843     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342871     4  0.0807      0.964 0.012 0.000 0.012 0.976 0.000
#> ERR342863     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342839     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342906     4  0.1074      0.962 0.016 0.000 0.012 0.968 0.004
#> ERR342905     5  0.2624      0.815 0.000 0.116 0.000 0.012 0.872
#> ERR342816     4  0.1121      0.962 0.016 0.004 0.008 0.968 0.004
#> ERR342865     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342835     5  0.3519      0.793 0.008 0.000 0.000 0.216 0.776
#> ERR342899     5  0.2674      0.812 0.000 0.120 0.000 0.012 0.868
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.0807      0.964 0.012 0.000 0.012 0.976 0.000
#> ERR342849     5  0.2674      0.812 0.000 0.120 0.000 0.012 0.868
#> ERR342811     4  0.0807      0.964 0.012 0.000 0.012 0.976 0.000
#> ERR342837     5  0.3551      0.790 0.008 0.000 0.000 0.220 0.772
#> ERR342857     4  0.1235      0.960 0.012 0.004 0.016 0.964 0.004
#> ERR342869     4  0.0854      0.964 0.008 0.000 0.012 0.976 0.004
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.3519      0.793 0.008 0.000 0.000 0.216 0.776
#> ERR342885     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342889     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342864     4  0.1467      0.955 0.016 0.016 0.008 0.956 0.004
#> ERR342860     5  0.2522      0.816 0.000 0.108 0.000 0.012 0.880
#> ERR342808     4  0.0798      0.964 0.016 0.000 0.008 0.976 0.000
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342852     4  0.1467      0.955 0.016 0.016 0.008 0.956 0.004
#> ERR342832     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342868     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342821     4  0.1121      0.962 0.016 0.004 0.008 0.968 0.004
#> ERR342878     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342872     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342828     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342840     5  0.3487      0.796 0.008 0.000 0.000 0.212 0.780
#> ERR342831     5  0.2069      0.838 0.000 0.000 0.012 0.076 0.912
#> ERR342818     4  0.1444      0.944 0.012 0.000 0.000 0.948 0.040
#> ERR342862     5  0.3809      0.752 0.008 0.000 0.000 0.256 0.736
#> ERR342894     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342884     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342836     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342879     4  0.1569      0.942 0.008 0.004 0.000 0.944 0.044
#> ERR342848     4  0.1668      0.943 0.028 0.000 0.000 0.940 0.032
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     5  0.2674      0.812 0.000 0.120 0.000 0.012 0.868
#> ERR342870     4  0.0740      0.963 0.008 0.000 0.008 0.980 0.004
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.0798      0.964 0.016 0.000 0.008 0.976 0.000
#> ERR342815     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342897     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342833     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342817     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342810     5  0.2624      0.815 0.000 0.116 0.000 0.012 0.872
#> ERR342867     4  0.1248      0.960 0.016 0.008 0.008 0.964 0.004
#> ERR342847     5  0.3388      0.802 0.008 0.000 0.000 0.200 0.792
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.1569      0.942 0.008 0.004 0.000 0.944 0.044
#> ERR342813     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342883     4  0.1569      0.942 0.008 0.004 0.000 0.944 0.044
#> ERR342856     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342822     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342900     5  0.2818      0.803 0.000 0.132 0.000 0.012 0.856
#> ERR342888     5  0.2270      0.836 0.000 0.000 0.020 0.076 0.904
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     5  0.2674      0.812 0.000 0.120 0.000 0.012 0.868
#> ERR342866     5  0.3487      0.796 0.008 0.000 0.000 0.212 0.780
#> ERR342820     4  0.0807      0.964 0.012 0.000 0.012 0.976 0.000
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342826     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342875     2  0.1121      0.969 0.000 0.956 0.000 0.000 0.044
#> ERR342834     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342898     4  0.1248      0.960 0.016 0.008 0.008 0.964 0.004
#> ERR342886     5  0.2574      0.816 0.000 0.112 0.000 0.012 0.876
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.0451      0.969 0.000 0.988 0.008 0.004 0.000
#> ERR342873     4  0.1444      0.944 0.012 0.000 0.000 0.948 0.040
#> ERR342844     4  0.1121      0.962 0.016 0.004 0.008 0.968 0.004
#> ERR342874     5  0.3809      0.752 0.008 0.000 0.000 0.256 0.736
#> ERR342893     4  0.1569      0.942 0.008 0.004 0.000 0.944 0.044
#> ERR342859     3  0.0510      1.000 0.000 0.000 0.984 0.016 0.000
#> ERR342830     5  0.2574      0.816 0.000 0.112 0.000 0.012 0.876
#> ERR342880     4  0.1492      0.943 0.008 0.004 0.000 0.948 0.040
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.0693      0.964 0.012 0.000 0.008 0.980 0.000
#> ERR342881     5  0.3861      0.741 0.008 0.000 0.000 0.264 0.728
#> ERR342858     4  0.1492      0.943 0.008 0.004 0.000 0.948 0.040

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342843     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342896     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342871     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342863     2  0.0146     0.6563 0.000 0.996 0.000 0.000 0.000 0.004
#> ERR342839     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342906     4  0.0870     0.8759 0.004 0.000 0.000 0.972 0.012 0.012
#> ERR342905     2  0.6101     0.0386 0.000 0.424 0.000 0.004 0.236 0.336
#> ERR342816     4  0.0870     0.8759 0.004 0.000 0.000 0.972 0.012 0.012
#> ERR342865     2  0.0146     0.6563 0.000 0.996 0.000 0.000 0.000 0.004
#> ERR342824     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342835     6  0.5411     0.9834 0.000 0.000 0.000 0.124 0.364 0.512
#> ERR342899     2  0.6053     0.0844 0.000 0.440 0.000 0.004 0.224 0.332
#> ERR342829     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342849     2  0.6053     0.0844 0.000 0.440 0.000 0.004 0.224 0.332
#> ERR342811     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342837     6  0.5411     0.9834 0.000 0.000 0.000 0.124 0.364 0.512
#> ERR342857     4  0.0870     0.8759 0.004 0.000 0.000 0.972 0.012 0.012
#> ERR342869     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342903     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     6  0.5425     0.9818 0.000 0.000 0.000 0.124 0.372 0.504
#> ERR342885     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342889     2  0.0146     0.6563 0.000 0.996 0.000 0.000 0.000 0.004
#> ERR342864     4  0.1053     0.8755 0.004 0.000 0.000 0.964 0.012 0.020
#> ERR342860     2  0.6082     0.0666 0.000 0.432 0.000 0.004 0.232 0.332
#> ERR342808     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342823     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342852     4  0.0964     0.8759 0.004 0.000 0.000 0.968 0.012 0.016
#> ERR342832     2  0.0146     0.6563 0.000 0.996 0.000 0.000 0.000 0.004
#> ERR342868     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342821     4  0.0870     0.8759 0.004 0.000 0.000 0.972 0.012 0.012
#> ERR342878     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342876     1  0.0146     0.9964 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR342809     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342872     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342828     2  0.0000     0.6565 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342840     6  0.5432     0.9786 0.000 0.000 0.000 0.124 0.376 0.500
#> ERR342831     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342818     4  0.3641     0.7886 0.000 0.000 0.000 0.748 0.028 0.224
#> ERR342862     6  0.5434     0.9814 0.000 0.000 0.000 0.128 0.360 0.512
#> ERR342894     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342884     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342891     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342836     2  0.0146     0.6563 0.000 0.996 0.000 0.000 0.000 0.004
#> ERR342879     4  0.3614     0.7883 0.000 0.000 0.000 0.752 0.028 0.220
#> ERR342848     4  0.3915     0.7797 0.008 0.000 0.000 0.736 0.028 0.228
#> ERR342861     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.6053     0.0844 0.000 0.440 0.000 0.004 0.224 0.332
#> ERR342870     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342901     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342815     2  0.0000     0.6565 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342897     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342833     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342817     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342810     2  0.6101     0.0386 0.000 0.424 0.000 0.004 0.236 0.336
#> ERR342867     4  0.0870     0.8759 0.004 0.000 0.000 0.972 0.012 0.012
#> ERR342847     6  0.5380     0.9653 0.000 0.000 0.000 0.116 0.384 0.500
#> ERR342855     1  0.0146     0.9964 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR342851     4  0.3641     0.7849 0.000 0.000 0.000 0.748 0.028 0.224
#> ERR342813     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342883     4  0.3511     0.7938 0.000 0.000 0.000 0.760 0.024 0.216
#> ERR342856     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342822     2  0.0000     0.6565 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342892     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342900     2  0.6005     0.1062 0.000 0.452 0.000 0.004 0.212 0.332
#> ERR342888     5  0.0622     1.0000 0.000 0.000 0.012 0.008 0.980 0.000
#> ERR342812     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.6053     0.0831 0.000 0.440 0.000 0.004 0.224 0.332
#> ERR342866     6  0.5432     0.9786 0.000 0.000 0.000 0.124 0.376 0.500
#> ERR342820     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342895     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342826     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342875     2  0.0000     0.6565 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342834     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342898     4  0.1053     0.8757 0.004 0.000 0.000 0.964 0.012 0.020
#> ERR342886     2  0.6073     0.0644 0.000 0.432 0.000 0.004 0.228 0.336
#> ERR342838     1  0.0146     0.9964 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR342882     1  0.0000     0.9987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.3349     0.5998 0.000 0.748 0.000 0.000 0.008 0.244
#> ERR342873     4  0.3614     0.7883 0.000 0.000 0.000 0.752 0.028 0.220
#> ERR342844     4  0.0964     0.8759 0.004 0.000 0.000 0.968 0.012 0.016
#> ERR342874     6  0.5434     0.9814 0.000 0.000 0.000 0.128 0.360 0.512
#> ERR342893     4  0.3641     0.7849 0.000 0.000 0.000 0.748 0.028 0.224
#> ERR342859     3  0.0000     1.0000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342830     2  0.6068     0.0747 0.000 0.436 0.000 0.004 0.228 0.332
#> ERR342880     4  0.3511     0.7938 0.000 0.000 0.000 0.760 0.024 0.216
#> ERR342887     1  0.0146     0.9964 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR342854     1  0.0146     0.9964 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR342904     4  0.1501     0.8661 0.000 0.000 0.000 0.924 0.000 0.076
#> ERR342881     6  0.5434     0.9814 0.000 0.000 0.000 0.128 0.360 0.512
#> ERR342858     4  0.3539     0.7938 0.000 0.000 0.000 0.756 0.024 0.220

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "hclust"]
# you can also extract it by
# res = res_list["ATC:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.820           0.897       0.958         0.3422 0.704   0.704
#> 3 3 0.718           0.768       0.834         0.6111 0.663   0.521
#> 4 4 0.770           0.914       0.932         0.2013 0.947   0.854
#> 5 5 0.800           0.854       0.862         0.1674 0.900   0.682
#> 6 6 0.832           0.522       0.698         0.0379 0.848   0.465

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette   p1   p2
#> ERR342845     1   0.000      0.946 1.00 0.00
#> ERR342843     1   0.000      0.946 1.00 0.00
#> ERR342896     1   0.000      0.946 1.00 0.00
#> ERR342827     2   0.000      1.000 0.00 1.00
#> ERR342871     1   0.000      0.946 1.00 0.00
#> ERR342863     2   0.000      1.000 0.00 1.00
#> ERR342839     1   0.000      0.946 1.00 0.00
#> ERR342906     1   0.000      0.946 1.00 0.00
#> ERR342905     1   0.981      0.355 0.58 0.42
#> ERR342816     1   0.000      0.946 1.00 0.00
#> ERR342865     2   0.000      1.000 0.00 1.00
#> ERR342824     1   0.000      0.946 1.00 0.00
#> ERR342841     2   0.000      1.000 0.00 1.00
#> ERR342835     1   0.000      0.946 1.00 0.00
#> ERR342899     1   0.981      0.355 0.58 0.42
#> ERR342829     1   0.000      0.946 1.00 0.00
#> ERR342850     1   0.000      0.946 1.00 0.00
#> ERR342849     1   0.981      0.355 0.58 0.42
#> ERR342811     1   0.000      0.946 1.00 0.00
#> ERR342837     1   0.000      0.946 1.00 0.00
#> ERR342857     1   0.000      0.946 1.00 0.00
#> ERR342869     1   0.000      0.946 1.00 0.00
#> ERR342903     1   0.000      0.946 1.00 0.00
#> ERR342819     1   0.000      0.946 1.00 0.00
#> ERR342885     1   0.000      0.946 1.00 0.00
#> ERR342889     2   0.000      1.000 0.00 1.00
#> ERR342864     1   0.000      0.946 1.00 0.00
#> ERR342860     1   0.981      0.355 0.58 0.42
#> ERR342808     1   0.000      0.946 1.00 0.00
#> ERR342823     1   0.000      0.946 1.00 0.00
#> ERR342907     2   0.000      1.000 0.00 1.00
#> ERR342852     1   0.000      0.946 1.00 0.00
#> ERR342832     2   0.000      1.000 0.00 1.00
#> ERR342868     1   0.000      0.946 1.00 0.00
#> ERR342821     1   0.000      0.946 1.00 0.00
#> ERR342878     2   0.000      1.000 0.00 1.00
#> ERR342876     1   0.000      0.946 1.00 0.00
#> ERR342809     1   0.000      0.946 1.00 0.00
#> ERR342846     1   0.000      0.946 1.00 0.00
#> ERR342872     2   0.000      1.000 0.00 1.00
#> ERR342828     2   0.000      1.000 0.00 1.00
#> ERR342840     1   0.000      0.946 1.00 0.00
#> ERR342831     1   0.000      0.946 1.00 0.00
#> ERR342818     1   0.000      0.946 1.00 0.00
#> ERR342862     1   0.000      0.946 1.00 0.00
#> ERR342894     1   0.000      0.946 1.00 0.00
#> ERR342884     2   0.000      1.000 0.00 1.00
#> ERR342891     1   0.000      0.946 1.00 0.00
#> ERR342890     1   0.000      0.946 1.00 0.00
#> ERR342836     2   0.000      1.000 0.00 1.00
#> ERR342879     1   0.000      0.946 1.00 0.00
#> ERR342848     1   0.000      0.946 1.00 0.00
#> ERR342861     1   0.000      0.946 1.00 0.00
#> ERR342814     1   0.981      0.355 0.58 0.42
#> ERR342870     1   0.000      0.946 1.00 0.00
#> ERR342901     1   0.000      0.946 1.00 0.00
#> ERR342908     1   0.000      0.946 1.00 0.00
#> ERR342815     2   0.000      1.000 0.00 1.00
#> ERR342897     1   0.000      0.946 1.00 0.00
#> ERR342833     2   0.000      1.000 0.00 1.00
#> ERR342817     1   0.000      0.946 1.00 0.00
#> ERR342810     1   0.981      0.355 0.58 0.42
#> ERR342867     1   0.000      0.946 1.00 0.00
#> ERR342847     1   0.000      0.946 1.00 0.00
#> ERR342855     1   0.000      0.946 1.00 0.00
#> ERR342851     1   0.000      0.946 1.00 0.00
#> ERR342813     1   0.000      0.946 1.00 0.00
#> ERR342883     1   0.000      0.946 1.00 0.00
#> ERR342856     1   0.000      0.946 1.00 0.00
#> ERR342822     2   0.000      1.000 0.00 1.00
#> ERR342892     1   0.000      0.946 1.00 0.00
#> ERR342842     1   0.000      0.946 1.00 0.00
#> ERR342902     2   0.000      1.000 0.00 1.00
#> ERR342900     1   0.981      0.355 0.58 0.42
#> ERR342888     1   0.000      0.946 1.00 0.00
#> ERR342812     1   0.000      0.946 1.00 0.00
#> ERR342853     1   0.981      0.355 0.58 0.42
#> ERR342866     1   0.000      0.946 1.00 0.00
#> ERR342820     1   0.000      0.946 1.00 0.00
#> ERR342895     1   0.000      0.946 1.00 0.00
#> ERR342825     1   0.000      0.946 1.00 0.00
#> ERR342826     1   0.000      0.946 1.00 0.00
#> ERR342875     2   0.000      1.000 0.00 1.00
#> ERR342834     1   0.000      0.946 1.00 0.00
#> ERR342898     1   0.000      0.946 1.00 0.00
#> ERR342886     1   0.981      0.355 0.58 0.42
#> ERR342838     1   0.000      0.946 1.00 0.00
#> ERR342882     1   0.000      0.946 1.00 0.00
#> ERR342807     2   0.000      1.000 0.00 1.00
#> ERR342873     1   0.000      0.946 1.00 0.00
#> ERR342844     1   0.000      0.946 1.00 0.00
#> ERR342874     1   0.000      0.946 1.00 0.00
#> ERR342893     1   0.000      0.946 1.00 0.00
#> ERR342859     1   0.000      0.946 1.00 0.00
#> ERR342830     1   0.981      0.355 0.58 0.42
#> ERR342880     1   0.000      0.946 1.00 0.00
#> ERR342887     1   0.000      0.946 1.00 0.00
#> ERR342854     1   0.000      0.946 1.00 0.00
#> ERR342904     1   0.000      0.946 1.00 0.00
#> ERR342881     1   0.000      0.946 1.00 0.00
#> ERR342858     1   0.000      0.946 1.00 0.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1  p2    p3
#> ERR342845     1   0.000      1.000 1.000 0.0 0.000
#> ERR342843     1   0.000      1.000 1.000 0.0 0.000
#> ERR342896     1   0.000      1.000 1.000 0.0 0.000
#> ERR342827     2   0.000      1.000 0.000 1.0 0.000
#> ERR342871     3   0.627      0.621 0.452 0.0 0.548
#> ERR342863     2   0.000      1.000 0.000 1.0 0.000
#> ERR342839     1   0.000      1.000 1.000 0.0 0.000
#> ERR342906     3   0.627      0.621 0.452 0.0 0.548
#> ERR342905     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342816     3   0.627      0.621 0.452 0.0 0.548
#> ERR342865     2   0.000      1.000 0.000 1.0 0.000
#> ERR342824     1   0.000      1.000 1.000 0.0 0.000
#> ERR342841     2   0.000      1.000 0.000 1.0 0.000
#> ERR342835     1   0.000      1.000 1.000 0.0 0.000
#> ERR342899     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342829     1   0.000      1.000 1.000 0.0 0.000
#> ERR342850     3   0.627      0.621 0.452 0.0 0.548
#> ERR342849     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342811     3   0.627      0.621 0.452 0.0 0.548
#> ERR342837     1   0.000      1.000 1.000 0.0 0.000
#> ERR342857     3   0.627      0.621 0.452 0.0 0.548
#> ERR342869     3   0.627      0.621 0.452 0.0 0.548
#> ERR342903     1   0.000      1.000 1.000 0.0 0.000
#> ERR342819     1   0.000      1.000 1.000 0.0 0.000
#> ERR342885     3   0.627      0.621 0.452 0.0 0.548
#> ERR342889     2   0.000      1.000 0.000 1.0 0.000
#> ERR342864     3   0.627      0.621 0.452 0.0 0.548
#> ERR342860     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342808     3   0.627      0.621 0.452 0.0 0.548
#> ERR342823     1   0.000      1.000 1.000 0.0 0.000
#> ERR342907     2   0.000      1.000 0.000 1.0 0.000
#> ERR342852     3   0.627      0.621 0.452 0.0 0.548
#> ERR342832     2   0.000      1.000 0.000 1.0 0.000
#> ERR342868     1   0.000      1.000 1.000 0.0 0.000
#> ERR342821     3   0.627      0.621 0.452 0.0 0.548
#> ERR342878     2   0.000      1.000 0.000 1.0 0.000
#> ERR342876     1   0.000      1.000 1.000 0.0 0.000
#> ERR342809     1   0.000      1.000 1.000 0.0 0.000
#> ERR342846     3   0.627      0.621 0.452 0.0 0.548
#> ERR342872     2   0.000      1.000 0.000 1.0 0.000
#> ERR342828     2   0.000      1.000 0.000 1.0 0.000
#> ERR342840     1   0.000      1.000 1.000 0.0 0.000
#> ERR342831     1   0.000      1.000 1.000 0.0 0.000
#> ERR342818     1   0.000      1.000 1.000 0.0 0.000
#> ERR342862     1   0.000      1.000 1.000 0.0 0.000
#> ERR342894     1   0.000      1.000 1.000 0.0 0.000
#> ERR342884     2   0.000      1.000 0.000 1.0 0.000
#> ERR342891     1   0.000      1.000 1.000 0.0 0.000
#> ERR342890     1   0.000      1.000 1.000 0.0 0.000
#> ERR342836     2   0.000      1.000 0.000 1.0 0.000
#> ERR342879     1   0.000      1.000 1.000 0.0 0.000
#> ERR342848     1   0.000      1.000 1.000 0.0 0.000
#> ERR342861     1   0.000      1.000 1.000 0.0 0.000
#> ERR342814     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342870     3   0.627      0.621 0.452 0.0 0.548
#> ERR342901     1   0.000      1.000 1.000 0.0 0.000
#> ERR342908     3   0.627      0.621 0.452 0.0 0.548
#> ERR342815     2   0.000      1.000 0.000 1.0 0.000
#> ERR342897     3   0.627      0.621 0.452 0.0 0.548
#> ERR342833     2   0.000      1.000 0.000 1.0 0.000
#> ERR342817     3   0.627      0.621 0.452 0.0 0.548
#> ERR342810     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342867     3   0.627      0.621 0.452 0.0 0.548
#> ERR342847     1   0.000      1.000 1.000 0.0 0.000
#> ERR342855     1   0.000      1.000 1.000 0.0 0.000
#> ERR342851     1   0.000      1.000 1.000 0.0 0.000
#> ERR342813     1   0.000      1.000 1.000 0.0 0.000
#> ERR342883     1   0.000      1.000 1.000 0.0 0.000
#> ERR342856     3   0.627      0.621 0.452 0.0 0.548
#> ERR342822     2   0.000      1.000 0.000 1.0 0.000
#> ERR342892     1   0.000      1.000 1.000 0.0 0.000
#> ERR342842     1   0.000      1.000 1.000 0.0 0.000
#> ERR342902     2   0.000      1.000 0.000 1.0 0.000
#> ERR342900     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342888     1   0.000      1.000 1.000 0.0 0.000
#> ERR342812     1   0.000      1.000 1.000 0.0 0.000
#> ERR342853     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342866     1   0.000      1.000 1.000 0.0 0.000
#> ERR342820     3   0.627      0.621 0.452 0.0 0.548
#> ERR342895     1   0.000      1.000 1.000 0.0 0.000
#> ERR342825     3   0.627      0.621 0.452 0.0 0.548
#> ERR342826     3   0.627      0.621 0.452 0.0 0.548
#> ERR342875     2   0.000      1.000 0.000 1.0 0.000
#> ERR342834     3   0.627      0.621 0.452 0.0 0.548
#> ERR342898     3   0.627      0.621 0.452 0.0 0.548
#> ERR342886     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342838     1   0.000      1.000 1.000 0.0 0.000
#> ERR342882     1   0.000      1.000 1.000 0.0 0.000
#> ERR342807     2   0.000      1.000 0.000 1.0 0.000
#> ERR342873     1   0.000      1.000 1.000 0.0 0.000
#> ERR342844     3   0.627      0.621 0.452 0.0 0.548
#> ERR342874     1   0.000      1.000 1.000 0.0 0.000
#> ERR342893     1   0.000      1.000 1.000 0.0 0.000
#> ERR342859     3   0.627      0.621 0.452 0.0 0.548
#> ERR342830     3   0.790     -0.324 0.060 0.4 0.540
#> ERR342880     1   0.000      1.000 1.000 0.0 0.000
#> ERR342887     1   0.000      1.000 1.000 0.0 0.000
#> ERR342854     1   0.000      1.000 1.000 0.0 0.000
#> ERR342904     3   0.627      0.621 0.452 0.0 0.548
#> ERR342881     1   0.000      1.000 1.000 0.0 0.000
#> ERR342858     1   0.000      1.000 1.000 0.0 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette   p1  p2  p3   p4
#> ERR342845     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342843     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342896     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342827     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342871     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342863     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342839     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342906     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342905     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342816     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342865     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342824     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342841     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342835     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342899     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342829     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342850     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342849     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342811     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342837     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342857     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342869     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342903     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342819     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342885     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342889     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342864     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342860     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342808     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342823     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342907     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342852     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342832     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342868     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342821     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342878     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342876     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342809     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342846     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342872     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342828     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342840     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342831     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342818     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342862     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342894     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342884     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342891     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342890     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342836     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342879     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342848     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342861     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342814     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342870     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342901     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342908     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342815     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342897     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342833     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342817     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342810     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342867     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342847     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342855     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342851     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342813     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342883     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342856     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342822     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342892     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342842     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342902     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342900     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342888     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342812     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342853     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342866     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342820     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342895     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342825     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342826     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342875     2   0.485      0.647 0.00 0.6 0.4 0.00
#> ERR342834     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342898     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342886     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342838     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342882     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342807     2   0.000      0.745 0.00 1.0 0.0 0.00
#> ERR342873     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342844     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342874     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342893     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342859     4   0.000      0.813 0.00 0.0 0.0 1.00
#> ERR342830     3   0.000      1.000 0.00 0.0 1.0 0.00
#> ERR342880     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342887     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342854     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342904     4   0.340      0.912 0.18 0.0 0.0 0.82
#> ERR342881     1   0.000      1.000 1.00 0.0 0.0 0.00
#> ERR342858     1   0.000      1.000 1.00 0.0 0.0 0.00

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1  p2  p3   p4    p5
#> ERR342845     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342843     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342896     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342827     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342871     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342863     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342839     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342906     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342905     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342816     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342865     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342824     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342841     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342835     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342899     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342829     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342850     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342849     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342811     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342837     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342857     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342869     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342903     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342819     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342885     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342889     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342864     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342860     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342808     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342823     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342907     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342852     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342832     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342868     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342821     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342878     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342876     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342809     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342846     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342872     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342828     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342840     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342831     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342818     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342862     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342894     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342884     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342891     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342890     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342836     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342879     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342848     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342861     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342814     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342870     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342901     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342908     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342815     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342897     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342833     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342817     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342810     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342867     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342847     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342855     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342851     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342813     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342883     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342856     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342822     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342892     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342842     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342902     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342900     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342888     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342812     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342853     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342866     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342820     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342895     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342825     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342826     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342875     2   0.418      0.647 0.000 0.6 0.4 0.00 0.000
#> ERR342834     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342898     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342886     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342838     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342882     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342807     2   0.000      0.745 0.000 1.0 0.0 0.00 0.000
#> ERR342873     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342844     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342874     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342893     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342859     4   0.000      0.869 0.000 0.0 0.0 1.00 0.000
#> ERR342830     3   0.000      1.000 0.000 0.0 1.0 0.00 0.000
#> ERR342880     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368
#> ERR342887     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342854     1   0.000      0.797 1.000 0.0 0.0 0.00 0.000
#> ERR342904     4   0.293      0.938 0.000 0.0 0.0 0.82 0.180
#> ERR342881     5   0.409      1.000 0.368 0.0 0.0 0.00 0.632
#> ERR342858     1   0.409      0.657 0.632 0.0 0.0 0.00 0.368

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette  p1    p2   p3    p4    p5    p6
#> ERR342845     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342843     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342896     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342827     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342871     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342863     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342839     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342906     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342905     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342816     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342865     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342824     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342841     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342835     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342899     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342829     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342850     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342849     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342811     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342837     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342857     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342869     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342903     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342819     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342885     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342889     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342864     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342860     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342808     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342823     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342907     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342852     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342832     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342868     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342821     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342878     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342876     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342809     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342846     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342872     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342828     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342840     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342831     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342818     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342862     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342894     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342884     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342891     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342890     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342836     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342879     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342848     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342861     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342814     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342870     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342901     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342908     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342815     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342897     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342833     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342817     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342810     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342867     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342847     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342855     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342851     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342813     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342883     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342856     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342822     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342892     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342842     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342902     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342900     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342888     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342812     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342853     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342866     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342820     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342895     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342825     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342826     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342875     2   0.000      1.000 0.0 1.000 0.00 0.000 0.000 0.000
#> ERR342834     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342898     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342886     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342838     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342882     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342807     4   0.380     -0.260 0.0 0.424 0.00 0.576 0.000 0.000
#> ERR342873     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342844     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342874     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342893     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342859     3   0.000      1.000 0.0 0.000 1.00 0.000 0.000 0.000
#> ERR342830     1   0.376     -0.290 0.6 0.400 0.00 0.000 0.000 0.000
#> ERR342880     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600
#> ERR342887     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342854     1   0.599      0.136 0.4 0.000 0.00 0.000 0.368 0.232
#> ERR342904     4   0.570      0.574 0.0 0.000 0.16 0.424 0.000 0.416
#> ERR342881     5   0.000      1.000 0.0 0.000 0.00 0.000 1.000 0.000
#> ERR342858     6   0.376      1.000 0.4 0.000 0.00 0.000 0.000 0.600

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "kmeans"]
# you can also extract it by
# res = res_list["ATC:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.722           0.938       0.941         0.3798 0.595   0.595
#> 3 3 0.449           0.583       0.772         0.5237 0.804   0.671
#> 4 4 0.469           0.672       0.732         0.1648 0.804   0.577
#> 5 5 0.569           0.599       0.670         0.1012 0.902   0.704
#> 6 6 0.646           0.576       0.661         0.0576 0.936   0.745

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1  0.1633      0.963 0.976 0.024
#> ERR342843     1  0.1633      0.963 0.976 0.024
#> ERR342896     1  0.1184      0.965 0.984 0.016
#> ERR342827     2  0.2948      0.916 0.052 0.948
#> ERR342871     1  0.2603      0.962 0.956 0.044
#> ERR342863     2  0.2603      0.917 0.044 0.956
#> ERR342839     1  0.1633      0.963 0.976 0.024
#> ERR342906     1  0.3114      0.955 0.944 0.056
#> ERR342905     2  0.7815      0.823 0.232 0.768
#> ERR342816     1  0.3114      0.955 0.944 0.056
#> ERR342865     2  0.2603      0.917 0.044 0.956
#> ERR342824     1  0.1184      0.965 0.984 0.016
#> ERR342841     2  0.2948      0.916 0.052 0.948
#> ERR342835     1  0.0938      0.965 0.988 0.012
#> ERR342899     2  0.7815      0.823 0.232 0.768
#> ERR342829     1  0.1184      0.965 0.984 0.016
#> ERR342850     1  0.2603      0.962 0.956 0.044
#> ERR342849     2  0.7815      0.823 0.232 0.768
#> ERR342811     1  0.2603      0.962 0.956 0.044
#> ERR342837     1  0.0938      0.965 0.988 0.012
#> ERR342857     1  0.3114      0.955 0.944 0.056
#> ERR342869     1  0.2603      0.962 0.956 0.044
#> ERR342903     1  0.1184      0.965 0.984 0.016
#> ERR342819     1  0.0938      0.965 0.988 0.012
#> ERR342885     1  0.4431      0.939 0.908 0.092
#> ERR342889     2  0.2603      0.917 0.044 0.956
#> ERR342864     1  0.3114      0.955 0.944 0.056
#> ERR342860     2  0.7815      0.823 0.232 0.768
#> ERR342808     1  0.2603      0.962 0.956 0.044
#> ERR342823     1  0.1184      0.965 0.984 0.016
#> ERR342907     2  0.2948      0.916 0.052 0.948
#> ERR342852     1  0.3114      0.955 0.944 0.056
#> ERR342832     2  0.2603      0.917 0.044 0.956
#> ERR342868     1  0.1633      0.963 0.976 0.024
#> ERR342821     1  0.3114      0.955 0.944 0.056
#> ERR342878     2  0.2948      0.916 0.052 0.948
#> ERR342876     1  0.1184      0.965 0.984 0.016
#> ERR342809     1  0.1184      0.965 0.984 0.016
#> ERR342846     1  0.4431      0.939 0.908 0.092
#> ERR342872     2  0.2948      0.916 0.052 0.948
#> ERR342828     2  0.2603      0.917 0.044 0.956
#> ERR342840     1  0.0938      0.965 0.988 0.012
#> ERR342831     1  0.1633      0.963 0.976 0.024
#> ERR342818     1  0.2778      0.962 0.952 0.048
#> ERR342862     1  0.0938      0.965 0.988 0.012
#> ERR342894     1  0.1633      0.963 0.976 0.024
#> ERR342884     2  0.2948      0.916 0.052 0.948
#> ERR342891     1  0.1184      0.965 0.984 0.016
#> ERR342890     1  0.1633      0.963 0.976 0.024
#> ERR342836     2  0.2603      0.917 0.044 0.956
#> ERR342879     1  0.2778      0.962 0.952 0.048
#> ERR342848     1  0.2778      0.962 0.952 0.048
#> ERR342861     1  0.1184      0.965 0.984 0.016
#> ERR342814     2  0.7815      0.823 0.232 0.768
#> ERR342870     1  0.2603      0.962 0.956 0.044
#> ERR342901     1  0.1184      0.965 0.984 0.016
#> ERR342908     1  0.2603      0.962 0.956 0.044
#> ERR342815     2  0.2603      0.917 0.044 0.956
#> ERR342897     1  0.4431      0.939 0.908 0.092
#> ERR342833     2  0.2948      0.916 0.052 0.948
#> ERR342817     1  0.4431      0.939 0.908 0.092
#> ERR342810     2  0.7815      0.823 0.232 0.768
#> ERR342867     1  0.3114      0.955 0.944 0.056
#> ERR342847     1  0.0938      0.965 0.988 0.012
#> ERR342855     1  0.1184      0.965 0.984 0.016
#> ERR342851     1  0.2778      0.962 0.952 0.048
#> ERR342813     1  0.1633      0.963 0.976 0.024
#> ERR342883     1  0.2778      0.962 0.952 0.048
#> ERR342856     1  0.4431      0.939 0.908 0.092
#> ERR342822     2  0.2603      0.917 0.044 0.956
#> ERR342892     1  0.1184      0.965 0.984 0.016
#> ERR342842     1  0.1184      0.965 0.984 0.016
#> ERR342902     2  0.2948      0.916 0.052 0.948
#> ERR342900     2  0.7815      0.823 0.232 0.768
#> ERR342888     1  0.1633      0.963 0.976 0.024
#> ERR342812     1  0.1184      0.965 0.984 0.016
#> ERR342853     2  0.7815      0.823 0.232 0.768
#> ERR342866     1  0.0938      0.965 0.988 0.012
#> ERR342820     1  0.2603      0.962 0.956 0.044
#> ERR342895     1  0.1184      0.965 0.984 0.016
#> ERR342825     1  0.4431      0.939 0.908 0.092
#> ERR342826     1  0.4431      0.939 0.908 0.092
#> ERR342875     2  0.2603      0.917 0.044 0.956
#> ERR342834     1  0.4431      0.939 0.908 0.092
#> ERR342898     1  0.3114      0.955 0.944 0.056
#> ERR342886     2  0.7815      0.823 0.232 0.768
#> ERR342838     1  0.1184      0.965 0.984 0.016
#> ERR342882     1  0.1184      0.965 0.984 0.016
#> ERR342807     2  0.2948      0.916 0.052 0.948
#> ERR342873     1  0.2778      0.962 0.952 0.048
#> ERR342844     1  0.3114      0.955 0.944 0.056
#> ERR342874     1  0.0938      0.965 0.988 0.012
#> ERR342893     1  0.2778      0.962 0.952 0.048
#> ERR342859     1  0.4431      0.939 0.908 0.092
#> ERR342830     2  0.7815      0.823 0.232 0.768
#> ERR342880     1  0.2778      0.962 0.952 0.048
#> ERR342887     1  0.1184      0.965 0.984 0.016
#> ERR342854     1  0.1184      0.965 0.984 0.016
#> ERR342904     1  0.2603      0.962 0.956 0.044
#> ERR342881     1  0.0938      0.965 0.988 0.012
#> ERR342858     1  0.2778      0.962 0.952 0.048

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342843     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342896     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342827     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342871     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342863     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342839     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342906     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342905     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342816     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342865     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342824     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342841     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342835     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342899     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342829     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342850     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342849     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342811     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342837     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342857     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342869     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342903     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342819     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342885     3  0.6703      0.780 0.268 0.040 0.692
#> ERR342889     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342864     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342860     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342808     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342823     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342907     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342852     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342832     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342868     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342821     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342878     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342876     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342809     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342846     3  0.6805      0.780 0.268 0.044 0.688
#> ERR342872     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342828     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342840     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342831     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342818     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342862     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342894     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342884     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342891     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342890     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342836     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342879     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342848     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342861     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342814     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342870     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342901     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342908     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342815     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342897     3  0.6805      0.780 0.268 0.044 0.688
#> ERR342833     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342817     3  0.6703      0.780 0.268 0.040 0.692
#> ERR342810     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342867     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342847     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342855     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342851     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342813     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342883     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342856     3  0.6805      0.780 0.268 0.044 0.688
#> ERR342822     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342892     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342842     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342902     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342900     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342888     1  0.5864      0.521 0.704 0.008 0.288
#> ERR342812     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342853     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342866     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342820     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342895     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342825     3  0.6703      0.780 0.268 0.040 0.692
#> ERR342826     3  0.6703      0.780 0.268 0.040 0.692
#> ERR342875     2  0.0592      0.894 0.012 0.988 0.000
#> ERR342834     3  0.6703      0.780 0.268 0.040 0.692
#> ERR342898     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342886     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342838     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342882     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342807     2  0.3459      0.880 0.012 0.892 0.096
#> ERR342873     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342844     3  0.7671      0.734 0.408 0.048 0.544
#> ERR342874     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342893     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342859     3  0.6805      0.780 0.268 0.044 0.688
#> ERR342830     2  0.6348      0.823 0.048 0.740 0.212
#> ERR342880     1  0.6651      0.210 0.656 0.024 0.320
#> ERR342887     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342854     1  0.0592      0.641 0.988 0.012 0.000
#> ERR342904     1  0.7240     -0.320 0.540 0.028 0.432
#> ERR342881     1  0.4842      0.579 0.776 0.000 0.224
#> ERR342858     1  0.6651      0.210 0.656 0.024 0.320

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> ERR342845     1  0.7044      0.579 0.516 0.004 NA 0.112
#> ERR342843     1  0.7044      0.579 0.516 0.004 NA 0.112
#> ERR342896     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342827     2  0.4050      0.829 0.000 0.820 NA 0.036
#> ERR342871     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342863     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342839     1  0.7110      0.579 0.516 0.004 NA 0.120
#> ERR342906     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342905     2  0.6400      0.772 0.016 0.688 NA 0.164
#> ERR342816     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342865     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342824     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342841     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342835     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342899     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342829     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342850     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342849     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342811     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342837     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342857     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342869     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342903     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342819     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342885     4  0.6703      0.562 0.108 0.012 NA 0.632
#> ERR342889     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342864     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342860     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342808     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342823     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342907     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342852     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342832     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342868     1  0.7110      0.579 0.516 0.004 NA 0.120
#> ERR342821     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342878     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342876     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342809     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342846     4  0.6854      0.562 0.108 0.012 NA 0.608
#> ERR342872     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342828     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342840     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342831     1  0.7044      0.579 0.516 0.004 NA 0.112
#> ERR342818     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342862     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342894     1  0.7044      0.579 0.516 0.004 NA 0.112
#> ERR342884     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342891     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342890     1  0.7110      0.579 0.516 0.004 NA 0.120
#> ERR342836     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342879     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342848     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342861     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342814     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342870     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342901     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342908     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342815     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342897     4  0.6830      0.562 0.108 0.012 NA 0.612
#> ERR342833     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342817     4  0.6703      0.562 0.108 0.012 NA 0.632
#> ERR342810     2  0.6400      0.772 0.016 0.688 NA 0.164
#> ERR342867     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342847     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342855     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342851     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342813     1  0.7044      0.579 0.516 0.004 NA 0.112
#> ERR342883     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342856     4  0.6830      0.562 0.108 0.012 NA 0.612
#> ERR342822     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342892     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342842     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342902     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342900     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342888     1  0.7110      0.579 0.516 0.004 NA 0.120
#> ERR342812     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342853     2  0.6400      0.772 0.016 0.688 NA 0.164
#> ERR342866     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342820     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342895     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342825     4  0.6703      0.562 0.108 0.012 NA 0.632
#> ERR342826     4  0.6703      0.562 0.108 0.012 NA 0.632
#> ERR342875     2  0.0188      0.852 0.000 0.996 NA 0.000
#> ERR342834     4  0.6703      0.562 0.108 0.012 NA 0.632
#> ERR342898     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342886     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342838     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342882     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342807     2  0.3853      0.829 0.000 0.820 NA 0.020
#> ERR342873     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342844     4  0.4507      0.676 0.200 0.012 NA 0.776
#> ERR342874     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342893     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342859     4  0.6854      0.562 0.108 0.012 NA 0.608
#> ERR342830     2  0.6393      0.772 0.016 0.688 NA 0.168
#> ERR342880     4  0.7169      0.470 0.424 0.004 NA 0.456
#> ERR342887     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342854     1  0.0000      0.722 1.000 0.000 NA 0.000
#> ERR342904     4  0.6596      0.590 0.368 0.012 NA 0.560
#> ERR342881     1  0.6689      0.598 0.620 0.000 NA 0.184
#> ERR342858     4  0.7169      0.470 0.424 0.004 NA 0.456

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.5143      0.990 0.364 0.012 0.004 0.020 0.600
#> ERR342843     5  0.5041      0.991 0.364 0.008 0.004 0.020 0.604
#> ERR342896     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.5417      0.730 0.000 0.712 0.088 0.036 0.164
#> ERR342871     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342863     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342839     5  0.5539      0.988 0.364 0.012 0.020 0.020 0.584
#> ERR342906     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342905     2  0.7413      0.645 0.008 0.512 0.284 0.108 0.088
#> ERR342816     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342865     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342824     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342835     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342899     2  0.7319      0.645 0.008 0.512 0.296 0.108 0.076
#> ERR342829     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342849     2  0.7319      0.645 0.008 0.512 0.296 0.108 0.076
#> ERR342811     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342837     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342857     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342869     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342903     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342819     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342885     3  0.6099      0.993 0.048 0.004 0.588 0.316 0.044
#> ERR342889     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342864     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342860     2  0.7319      0.645 0.008 0.512 0.296 0.108 0.076
#> ERR342808     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342823     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342852     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342832     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342868     5  0.5438      0.989 0.364 0.008 0.020 0.020 0.588
#> ERR342821     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342878     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342876     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.6192      0.992 0.048 0.004 0.576 0.324 0.048
#> ERR342872     2  0.5342      0.730 0.000 0.712 0.080 0.032 0.176
#> ERR342828     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342840     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342831     5  0.5143      0.990 0.364 0.012 0.004 0.020 0.600
#> ERR342818     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342862     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342894     5  0.5041      0.991 0.364 0.008 0.004 0.020 0.604
#> ERR342884     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342891     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.5539      0.988 0.364 0.012 0.020 0.020 0.584
#> ERR342836     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342879     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342848     4  0.5603      0.490 0.216 0.000 0.032 0.676 0.076
#> ERR342861     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.7319      0.645 0.008 0.512 0.296 0.108 0.076
#> ERR342870     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342901     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342815     2  0.0613      0.760 0.000 0.984 0.004 0.008 0.004
#> ERR342897     3  0.6192      0.992 0.048 0.004 0.576 0.324 0.048
#> ERR342833     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342817     3  0.6099      0.993 0.048 0.004 0.588 0.316 0.044
#> ERR342810     2  0.7413      0.645 0.008 0.512 0.284 0.108 0.088
#> ERR342867     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342847     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342855     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342813     5  0.5041      0.991 0.364 0.008 0.004 0.020 0.604
#> ERR342883     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342856     3  0.6192      0.992 0.048 0.004 0.576 0.324 0.048
#> ERR342822     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342892     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.5298      0.730 0.000 0.712 0.080 0.028 0.180
#> ERR342900     2  0.7319      0.645 0.008 0.512 0.296 0.108 0.076
#> ERR342888     5  0.5438      0.989 0.364 0.008 0.020 0.020 0.588
#> ERR342812     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.7413      0.645 0.008 0.512 0.284 0.108 0.088
#> ERR342866     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342820     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342895     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.6099      0.993 0.048 0.004 0.588 0.316 0.044
#> ERR342826     3  0.6099      0.993 0.048 0.004 0.588 0.316 0.044
#> ERR342875     2  0.0324      0.760 0.000 0.992 0.000 0.004 0.004
#> ERR342834     3  0.6099      0.993 0.048 0.004 0.588 0.316 0.044
#> ERR342898     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342886     2  0.7430      0.645 0.008 0.512 0.280 0.116 0.084
#> ERR342838     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.5317      0.730 0.000 0.712 0.084 0.028 0.176
#> ERR342873     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342844     4  0.5243      0.363 0.080 0.004 0.212 0.696 0.008
#> ERR342874     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342893     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342859     3  0.6192      0.992 0.048 0.004 0.576 0.324 0.048
#> ERR342830     2  0.7430      0.645 0.008 0.512 0.280 0.116 0.084
#> ERR342880     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072
#> ERR342887     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.694 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.7436      0.361 0.196 0.000 0.208 0.512 0.084
#> ERR342881     1  0.7481     -0.150 0.440 0.000 0.112 0.100 0.348
#> ERR342858     4  0.5548      0.491 0.216 0.000 0.032 0.680 0.072

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.3915      0.859 0.284 0.000 0.008 0.012 0.696 0.000
#> ERR342843     5  0.3808      0.860 0.284 0.000 0.004 0.012 0.700 0.000
#> ERR342896     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.4852      0.705 0.000 0.716 0.180 0.004 0.048 0.052
#> ERR342871     4  0.3867      0.532 0.104 0.000 0.024 0.800 0.072 0.000
#> ERR342863     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342839     5  0.4682      0.857 0.284 0.000 0.020 0.020 0.664 0.012
#> ERR342906     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342905     2  0.7137      0.603 0.000 0.476 0.096 0.036 0.092 0.300
#> ERR342816     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342865     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342824     1  0.1442      0.690 0.944 0.000 0.040 0.000 0.004 0.012
#> ERR342841     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342835     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342899     2  0.7020      0.603 0.000 0.476 0.096 0.036 0.076 0.316
#> ERR342829     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342850     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342849     2  0.7020      0.603 0.000 0.476 0.096 0.036 0.076 0.316
#> ERR342811     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342837     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342857     4  0.5075      0.501 0.044 0.000 0.088 0.740 0.032 0.096
#> ERR342869     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342903     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342819     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342885     3  0.5089      0.999 0.016 0.000 0.496 0.444 0.044 0.000
#> ERR342889     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342864     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342860     2  0.6965      0.603 0.000 0.476 0.088 0.036 0.076 0.324
#> ERR342808     4  0.3867      0.532 0.104 0.000 0.024 0.800 0.072 0.000
#> ERR342823     1  0.1442      0.690 0.944 0.000 0.040 0.000 0.004 0.012
#> ERR342907     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342852     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342832     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342868     5  0.4602      0.857 0.284 0.000 0.016 0.020 0.668 0.012
#> ERR342821     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342878     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342876     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342846     4  0.6233     -0.912 0.016 0.000 0.416 0.452 0.072 0.044
#> ERR342872     2  0.4644      0.705 0.000 0.716 0.196 0.000 0.052 0.036
#> ERR342828     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342840     5  0.7840      0.252 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342831     5  0.3915      0.859 0.284 0.000 0.008 0.012 0.696 0.000
#> ERR342818     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342862     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342894     5  0.3808      0.860 0.284 0.000 0.004 0.012 0.700 0.000
#> ERR342884     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342891     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342890     5  0.4682      0.857 0.284 0.000 0.020 0.020 0.664 0.012
#> ERR342836     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342879     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342848     6  0.6333      0.973 0.144 0.000 0.020 0.320 0.016 0.500
#> ERR342861     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342814     2  0.6965      0.603 0.000 0.476 0.088 0.036 0.076 0.324
#> ERR342870     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342901     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.3867      0.532 0.104 0.000 0.024 0.800 0.072 0.000
#> ERR342815     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342897     4  0.6047     -0.929 0.016 0.000 0.436 0.448 0.064 0.036
#> ERR342833     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342817     3  0.5089      0.999 0.016 0.000 0.496 0.444 0.044 0.000
#> ERR342810     2  0.7137      0.603 0.000 0.476 0.096 0.036 0.092 0.300
#> ERR342867     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342847     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342855     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342813     5  0.3808      0.860 0.284 0.000 0.004 0.012 0.700 0.000
#> ERR342883     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342856     4  0.6047     -0.929 0.016 0.000 0.436 0.448 0.064 0.036
#> ERR342822     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342902     2  0.4591      0.705 0.000 0.716 0.200 0.000 0.056 0.028
#> ERR342900     2  0.6965      0.603 0.000 0.476 0.088 0.036 0.076 0.324
#> ERR342888     5  0.4602      0.857 0.284 0.000 0.016 0.020 0.668 0.012
#> ERR342812     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.7137      0.603 0.000 0.476 0.096 0.036 0.092 0.300
#> ERR342866     5  0.7840      0.252 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342820     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342895     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342825     3  0.5089      0.999 0.016 0.000 0.496 0.444 0.044 0.000
#> ERR342826     3  0.5142      0.996 0.016 0.000 0.492 0.444 0.048 0.000
#> ERR342875     2  0.0000      0.740 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342834     3  0.5089      0.999 0.016 0.000 0.496 0.444 0.044 0.000
#> ERR342898     4  0.5095      0.501 0.044 0.000 0.084 0.740 0.036 0.096
#> ERR342886     2  0.7224      0.602 0.000 0.476 0.100 0.044 0.088 0.292
#> ERR342838     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0146      0.729 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR342807     2  0.4672      0.706 0.000 0.716 0.192 0.000 0.056 0.036
#> ERR342873     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342844     4  0.5075      0.501 0.044 0.000 0.088 0.740 0.032 0.096
#> ERR342874     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342893     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342859     4  0.6233     -0.912 0.016 0.000 0.416 0.452 0.072 0.044
#> ERR342830     2  0.7224      0.602 0.000 0.476 0.100 0.044 0.088 0.292
#> ERR342880     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528
#> ERR342887     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.729 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.3840      0.533 0.104 0.000 0.020 0.800 0.076 0.000
#> ERR342881     1  0.7840     -0.346 0.352 0.000 0.056 0.128 0.352 0.112
#> ERR342858     6  0.5721      0.997 0.144 0.000 0.004 0.320 0.004 0.528

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "skmeans"]
# you can also extract it by
# res = res_list["ATC:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.992       0.995         0.4084 0.595   0.595
#> 3 3 1.000           0.984       0.989         0.5893 0.754   0.587
#> 4 4 0.769           0.777       0.852         0.1221 0.940   0.828
#> 5 5 0.850           0.924       0.854         0.0593 0.923   0.736
#> 6 6 0.852           0.894       0.870         0.0470 0.968   0.851

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     1  0.0000      0.993 1.000 0.000
#> ERR342843     1  0.0000      0.993 1.000 0.000
#> ERR342896     1  0.0000      0.993 1.000 0.000
#> ERR342827     2  0.0000      1.000 0.000 1.000
#> ERR342871     1  0.0000      0.993 1.000 0.000
#> ERR342863     2  0.0000      1.000 0.000 1.000
#> ERR342839     1  0.0000      0.993 1.000 0.000
#> ERR342906     1  0.0938      0.987 0.988 0.012
#> ERR342905     2  0.0000      1.000 0.000 1.000
#> ERR342816     1  0.0938      0.987 0.988 0.012
#> ERR342865     2  0.0000      1.000 0.000 1.000
#> ERR342824     1  0.0000      0.993 1.000 0.000
#> ERR342841     2  0.0000      1.000 0.000 1.000
#> ERR342835     1  0.0000      0.993 1.000 0.000
#> ERR342899     2  0.0000      1.000 0.000 1.000
#> ERR342829     1  0.0000      0.993 1.000 0.000
#> ERR342850     1  0.0000      0.993 1.000 0.000
#> ERR342849     2  0.0000      1.000 0.000 1.000
#> ERR342811     1  0.0000      0.993 1.000 0.000
#> ERR342837     1  0.0000      0.993 1.000 0.000
#> ERR342857     1  0.0938      0.987 0.988 0.012
#> ERR342869     1  0.0000      0.993 1.000 0.000
#> ERR342903     1  0.0000      0.993 1.000 0.000
#> ERR342819     1  0.0000      0.993 1.000 0.000
#> ERR342885     1  0.2603      0.962 0.956 0.044
#> ERR342889     2  0.0000      1.000 0.000 1.000
#> ERR342864     1  0.0938      0.987 0.988 0.012
#> ERR342860     2  0.0000      1.000 0.000 1.000
#> ERR342808     1  0.0000      0.993 1.000 0.000
#> ERR342823     1  0.0000      0.993 1.000 0.000
#> ERR342907     2  0.0000      1.000 0.000 1.000
#> ERR342852     1  0.0938      0.987 0.988 0.012
#> ERR342832     2  0.0000      1.000 0.000 1.000
#> ERR342868     1  0.0000      0.993 1.000 0.000
#> ERR342821     1  0.0938      0.987 0.988 0.012
#> ERR342878     2  0.0000      1.000 0.000 1.000
#> ERR342876     1  0.0000      0.993 1.000 0.000
#> ERR342809     1  0.0000      0.993 1.000 0.000
#> ERR342846     1  0.2603      0.962 0.956 0.044
#> ERR342872     2  0.0000      1.000 0.000 1.000
#> ERR342828     2  0.0000      1.000 0.000 1.000
#> ERR342840     1  0.0000      0.993 1.000 0.000
#> ERR342831     1  0.0000      0.993 1.000 0.000
#> ERR342818     1  0.0000      0.993 1.000 0.000
#> ERR342862     1  0.0000      0.993 1.000 0.000
#> ERR342894     1  0.0000      0.993 1.000 0.000
#> ERR342884     2  0.0000      1.000 0.000 1.000
#> ERR342891     1  0.0000      0.993 1.000 0.000
#> ERR342890     1  0.0000      0.993 1.000 0.000
#> ERR342836     2  0.0000      1.000 0.000 1.000
#> ERR342879     1  0.0000      0.993 1.000 0.000
#> ERR342848     1  0.0000      0.993 1.000 0.000
#> ERR342861     1  0.0000      0.993 1.000 0.000
#> ERR342814     2  0.0000      1.000 0.000 1.000
#> ERR342870     1  0.0000      0.993 1.000 0.000
#> ERR342901     1  0.0000      0.993 1.000 0.000
#> ERR342908     1  0.0000      0.993 1.000 0.000
#> ERR342815     2  0.0000      1.000 0.000 1.000
#> ERR342897     1  0.2603      0.962 0.956 0.044
#> ERR342833     2  0.0000      1.000 0.000 1.000
#> ERR342817     1  0.2603      0.962 0.956 0.044
#> ERR342810     2  0.0000      1.000 0.000 1.000
#> ERR342867     1  0.0938      0.987 0.988 0.012
#> ERR342847     1  0.0000      0.993 1.000 0.000
#> ERR342855     1  0.0000      0.993 1.000 0.000
#> ERR342851     1  0.0000      0.993 1.000 0.000
#> ERR342813     1  0.0000      0.993 1.000 0.000
#> ERR342883     1  0.0000      0.993 1.000 0.000
#> ERR342856     1  0.2603      0.962 0.956 0.044
#> ERR342822     2  0.0000      1.000 0.000 1.000
#> ERR342892     1  0.0000      0.993 1.000 0.000
#> ERR342842     1  0.0000      0.993 1.000 0.000
#> ERR342902     2  0.0000      1.000 0.000 1.000
#> ERR342900     2  0.0000      1.000 0.000 1.000
#> ERR342888     1  0.0000      0.993 1.000 0.000
#> ERR342812     1  0.0000      0.993 1.000 0.000
#> ERR342853     2  0.0000      1.000 0.000 1.000
#> ERR342866     1  0.0000      0.993 1.000 0.000
#> ERR342820     1  0.0000      0.993 1.000 0.000
#> ERR342895     1  0.0000      0.993 1.000 0.000
#> ERR342825     1  0.2603      0.962 0.956 0.044
#> ERR342826     1  0.2603      0.962 0.956 0.044
#> ERR342875     2  0.0000      1.000 0.000 1.000
#> ERR342834     1  0.2603      0.962 0.956 0.044
#> ERR342898     1  0.0938      0.987 0.988 0.012
#> ERR342886     2  0.0000      1.000 0.000 1.000
#> ERR342838     1  0.0000      0.993 1.000 0.000
#> ERR342882     1  0.0000      0.993 1.000 0.000
#> ERR342807     2  0.0000      1.000 0.000 1.000
#> ERR342873     1  0.0000      0.993 1.000 0.000
#> ERR342844     1  0.0938      0.987 0.988 0.012
#> ERR342874     1  0.0000      0.993 1.000 0.000
#> ERR342893     1  0.0000      0.993 1.000 0.000
#> ERR342859     1  0.2603      0.962 0.956 0.044
#> ERR342830     2  0.0000      1.000 0.000 1.000
#> ERR342880     1  0.0000      0.993 1.000 0.000
#> ERR342887     1  0.0000      0.993 1.000 0.000
#> ERR342854     1  0.0000      0.993 1.000 0.000
#> ERR342904     1  0.0000      0.993 1.000 0.000
#> ERR342881     1  0.0000      0.993 1.000 0.000
#> ERR342858     1  0.0000      0.993 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1 p2    p3
#> ERR342845     1  0.0747      0.985 0.984  0 0.016
#> ERR342843     1  0.0747      0.985 0.984  0 0.016
#> ERR342896     1  0.0000      0.986 1.000  0 0.000
#> ERR342827     2  0.0000      1.000 0.000  1 0.000
#> ERR342871     3  0.1860      0.958 0.052  0 0.948
#> ERR342863     2  0.0000      1.000 0.000  1 0.000
#> ERR342839     1  0.0747      0.985 0.984  0 0.016
#> ERR342906     3  0.0000      0.979 0.000  0 1.000
#> ERR342905     2  0.0000      1.000 0.000  1 0.000
#> ERR342816     3  0.0000      0.979 0.000  0 1.000
#> ERR342865     2  0.0000      1.000 0.000  1 0.000
#> ERR342824     1  0.0000      0.986 1.000  0 0.000
#> ERR342841     2  0.0000      1.000 0.000  1 0.000
#> ERR342835     1  0.0747      0.985 0.984  0 0.016
#> ERR342899     2  0.0000      1.000 0.000  1 0.000
#> ERR342829     1  0.0000      0.986 1.000  0 0.000
#> ERR342850     3  0.1860      0.958 0.052  0 0.948
#> ERR342849     2  0.0000      1.000 0.000  1 0.000
#> ERR342811     3  0.1860      0.958 0.052  0 0.948
#> ERR342837     1  0.0747      0.985 0.984  0 0.016
#> ERR342857     3  0.0000      0.979 0.000  0 1.000
#> ERR342869     3  0.1860      0.958 0.052  0 0.948
#> ERR342903     1  0.0000      0.986 1.000  0 0.000
#> ERR342819     1  0.0747      0.985 0.984  0 0.016
#> ERR342885     3  0.0000      0.979 0.000  0 1.000
#> ERR342889     2  0.0000      1.000 0.000  1 0.000
#> ERR342864     3  0.0000      0.979 0.000  0 1.000
#> ERR342860     2  0.0000      1.000 0.000  1 0.000
#> ERR342808     3  0.1860      0.958 0.052  0 0.948
#> ERR342823     1  0.0000      0.986 1.000  0 0.000
#> ERR342907     2  0.0000      1.000 0.000  1 0.000
#> ERR342852     3  0.0000      0.979 0.000  0 1.000
#> ERR342832     2  0.0000      1.000 0.000  1 0.000
#> ERR342868     1  0.0747      0.985 0.984  0 0.016
#> ERR342821     3  0.0000      0.979 0.000  0 1.000
#> ERR342878     2  0.0000      1.000 0.000  1 0.000
#> ERR342876     1  0.0000      0.986 1.000  0 0.000
#> ERR342809     1  0.0000      0.986 1.000  0 0.000
#> ERR342846     3  0.0000      0.979 0.000  0 1.000
#> ERR342872     2  0.0000      1.000 0.000  1 0.000
#> ERR342828     2  0.0000      1.000 0.000  1 0.000
#> ERR342840     1  0.0747      0.985 0.984  0 0.016
#> ERR342831     1  0.0747      0.985 0.984  0 0.016
#> ERR342818     1  0.1411      0.968 0.964  0 0.036
#> ERR342862     1  0.0747      0.985 0.984  0 0.016
#> ERR342894     1  0.0747      0.985 0.984  0 0.016
#> ERR342884     2  0.0000      1.000 0.000  1 0.000
#> ERR342891     1  0.0000      0.986 1.000  0 0.000
#> ERR342890     1  0.0747      0.985 0.984  0 0.016
#> ERR342836     2  0.0000      1.000 0.000  1 0.000
#> ERR342879     1  0.1411      0.968 0.964  0 0.036
#> ERR342848     1  0.1411      0.968 0.964  0 0.036
#> ERR342861     1  0.0000      0.986 1.000  0 0.000
#> ERR342814     2  0.0000      1.000 0.000  1 0.000
#> ERR342870     3  0.1860      0.958 0.052  0 0.948
#> ERR342901     1  0.0000      0.986 1.000  0 0.000
#> ERR342908     3  0.1860      0.958 0.052  0 0.948
#> ERR342815     2  0.0000      1.000 0.000  1 0.000
#> ERR342897     3  0.0000      0.979 0.000  0 1.000
#> ERR342833     2  0.0000      1.000 0.000  1 0.000
#> ERR342817     3  0.0000      0.979 0.000  0 1.000
#> ERR342810     2  0.0000      1.000 0.000  1 0.000
#> ERR342867     3  0.0000      0.979 0.000  0 1.000
#> ERR342847     1  0.0747      0.985 0.984  0 0.016
#> ERR342855     1  0.0000      0.986 1.000  0 0.000
#> ERR342851     1  0.1411      0.968 0.964  0 0.036
#> ERR342813     1  0.0747      0.985 0.984  0 0.016
#> ERR342883     1  0.1411      0.968 0.964  0 0.036
#> ERR342856     3  0.0000      0.979 0.000  0 1.000
#> ERR342822     2  0.0000      1.000 0.000  1 0.000
#> ERR342892     1  0.0000      0.986 1.000  0 0.000
#> ERR342842     1  0.0000      0.986 1.000  0 0.000
#> ERR342902     2  0.0000      1.000 0.000  1 0.000
#> ERR342900     2  0.0000      1.000 0.000  1 0.000
#> ERR342888     1  0.0747      0.985 0.984  0 0.016
#> ERR342812     1  0.0000      0.986 1.000  0 0.000
#> ERR342853     2  0.0000      1.000 0.000  1 0.000
#> ERR342866     1  0.0747      0.985 0.984  0 0.016
#> ERR342820     3  0.1860      0.958 0.052  0 0.948
#> ERR342895     1  0.0000      0.986 1.000  0 0.000
#> ERR342825     3  0.0000      0.979 0.000  0 1.000
#> ERR342826     3  0.0000      0.979 0.000  0 1.000
#> ERR342875     2  0.0000      1.000 0.000  1 0.000
#> ERR342834     3  0.0000      0.979 0.000  0 1.000
#> ERR342898     3  0.0000      0.979 0.000  0 1.000
#> ERR342886     2  0.0000      1.000 0.000  1 0.000
#> ERR342838     1  0.0000      0.986 1.000  0 0.000
#> ERR342882     1  0.0000      0.986 1.000  0 0.000
#> ERR342807     2  0.0000      1.000 0.000  1 0.000
#> ERR342873     1  0.1411      0.968 0.964  0 0.036
#> ERR342844     3  0.0000      0.979 0.000  0 1.000
#> ERR342874     1  0.0747      0.985 0.984  0 0.016
#> ERR342893     1  0.1411      0.968 0.964  0 0.036
#> ERR342859     3  0.0000      0.979 0.000  0 1.000
#> ERR342830     2  0.0000      1.000 0.000  1 0.000
#> ERR342880     1  0.1411      0.968 0.964  0 0.036
#> ERR342887     1  0.0000      0.986 1.000  0 0.000
#> ERR342854     1  0.0000      0.986 1.000  0 0.000
#> ERR342904     3  0.1860      0.958 0.052  0 0.948
#> ERR342881     1  0.0747      0.985 0.984  0 0.016
#> ERR342858     1  0.1411      0.968 0.964  0 0.036

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342843     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342896     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342827     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342871     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342863     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342839     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342906     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342905     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342816     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342865     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342841     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342835     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342899     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342829     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342850     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342849     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342811     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342837     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342857     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342869     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342903     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342819     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342885     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342889     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342864     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342860     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342808     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342823     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342907     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342852     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342832     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342868     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342821     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342878     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342876     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342846     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342872     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342828     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342840     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342831     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342818     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342862     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342894     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342884     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342891     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342890     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342836     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342879     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342848     1  0.5000     -0.992 0.500 0.000 0.500 0.000
#> ERR342861     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342814     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342870     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342901     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342908     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342815     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342897     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342833     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342817     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342810     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342867     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342847     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342855     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342851     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342813     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342883     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342856     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342822     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342902     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342900     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342888     1  0.5503      0.619 0.516 0.000 0.468 0.016
#> ERR342812     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342853     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342866     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342820     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342895     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342825     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342826     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342875     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342834     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342898     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342886     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342838     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342807     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> ERR342873     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342844     4  0.2647      0.860 0.000 0.000 0.120 0.880
#> ERR342874     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342893     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342859     4  0.0707      0.879 0.000 0.000 0.020 0.980
#> ERR342830     2  0.0188      0.998 0.000 0.996 0.004 0.000
#> ERR342880     3  0.5168      1.000 0.496 0.000 0.500 0.004
#> ERR342887     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.494 1.000 0.000 0.000 0.000
#> ERR342904     4  0.4469      0.814 0.112 0.000 0.080 0.808
#> ERR342881     1  0.5506      0.618 0.512 0.000 0.472 0.016
#> ERR342858     3  0.5168      1.000 0.496 0.000 0.500 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1   p2    p3    p4    p5
#> ERR342845     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342843     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342896     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342827     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342871     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342863     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342839     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342906     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342905     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342816     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342865     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342824     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342841     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342835     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342899     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342829     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342850     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342849     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342811     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342837     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342857     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342869     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342903     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342819     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342885     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342889     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342864     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342860     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342808     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342823     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342907     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342852     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342832     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342868     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342821     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342878     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342876     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342809     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342846     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342872     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342828     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342840     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342831     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342818     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342862     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342894     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342884     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342891     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342890     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342836     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342879     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342848     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342861     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342814     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342870     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342901     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342908     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342815     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342897     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342833     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342817     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342810     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342867     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342847     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342855     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342851     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342813     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342883     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342856     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342822     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342892     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342842     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342902     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342900     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342888     5  0.0290      0.962 0.008 0.00 0.000 0.000 0.992
#> ERR342812     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342853     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342866     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342820     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342895     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342825     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342826     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342875     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342834     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342898     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342886     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342838     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342882     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342807     2  0.0000      0.994 0.000 1.00 0.000 0.000 0.000
#> ERR342873     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342844     3  0.3532      0.748 0.092 0.00 0.832 0.076 0.000
#> ERR342874     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342893     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342859     3  0.4960      0.744 0.104 0.00 0.728 0.160 0.008
#> ERR342830     2  0.0693      0.988 0.008 0.98 0.000 0.012 0.000
#> ERR342880     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028
#> ERR342887     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342854     1  0.3636      1.000 0.728 0.00 0.000 0.000 0.272
#> ERR342904     3  0.4563      0.754 0.084 0.00 0.792 0.048 0.076
#> ERR342881     5  0.1630      0.961 0.036 0.00 0.004 0.016 0.944
#> ERR342858     4  0.4495      1.000 0.196 0.00 0.024 0.752 0.028

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> ERR342845     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342843     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342871     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342863     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342839     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342906     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342905     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342816     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342865     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342835     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342899     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342849     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342811     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342837     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342857     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342869     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342889     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342864     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342860     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342808     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342852     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342832     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342868     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342821     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342878     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342872     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342828     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342840     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342831     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342818     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342862     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342894     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342884     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342836     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342879     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342848     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342870     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342815     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342897     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342833     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342810     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342867     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342847     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342851     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342813     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342883     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342856     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342822     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342900     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342888     5  0.4700      0.907 0.112 0.000 0.016 0.104 0.748 0.020
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342866     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342820     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342875     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR342834     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342898     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342886     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.0405      0.982 0.000 0.988 0.000 0.004 0.000 0.008
#> ERR342873     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342844     4  0.3171      0.564 0.000 0.000 0.204 0.784 0.000 0.012
#> ERR342874     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342893     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342859     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR342830     2  0.1167      0.975 0.000 0.960 0.000 0.012 0.020 0.008
#> ERR342880     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.7012      0.493 0.016 0.000 0.332 0.388 0.228 0.036
#> ERR342881     5  0.2378      0.906 0.152 0.000 0.000 0.000 0.848 0.000
#> ERR342858     6  0.1364      1.000 0.048 0.000 0.000 0.004 0.004 0.944

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4053 0.595   0.595
#> 3 3 0.878           0.847       0.942         0.6409 0.745   0.571
#> 4 4 0.747           0.745       0.825         0.0647 0.958   0.884
#> 5 5 0.739           0.736       0.810         0.0668 0.862   0.610
#> 6 6 0.834           0.757       0.874         0.0552 0.908   0.652

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette p1 p2
#> ERR342845     1       0          1  1  0
#> ERR342843     1       0          1  1  0
#> ERR342896     1       0          1  1  0
#> ERR342827     2       0          1  0  1
#> ERR342871     1       0          1  1  0
#> ERR342863     2       0          1  0  1
#> ERR342839     1       0          1  1  0
#> ERR342906     1       0          1  1  0
#> ERR342905     2       0          1  0  1
#> ERR342816     1       0          1  1  0
#> ERR342865     2       0          1  0  1
#> ERR342824     1       0          1  1  0
#> ERR342841     2       0          1  0  1
#> ERR342835     1       0          1  1  0
#> ERR342899     2       0          1  0  1
#> ERR342829     1       0          1  1  0
#> ERR342850     1       0          1  1  0
#> ERR342849     2       0          1  0  1
#> ERR342811     1       0          1  1  0
#> ERR342837     1       0          1  1  0
#> ERR342857     1       0          1  1  0
#> ERR342869     1       0          1  1  0
#> ERR342903     1       0          1  1  0
#> ERR342819     1       0          1  1  0
#> ERR342885     1       0          1  1  0
#> ERR342889     2       0          1  0  1
#> ERR342864     1       0          1  1  0
#> ERR342860     2       0          1  0  1
#> ERR342808     1       0          1  1  0
#> ERR342823     1       0          1  1  0
#> ERR342907     2       0          1  0  1
#> ERR342852     1       0          1  1  0
#> ERR342832     2       0          1  0  1
#> ERR342868     1       0          1  1  0
#> ERR342821     1       0          1  1  0
#> ERR342878     2       0          1  0  1
#> ERR342876     1       0          1  1  0
#> ERR342809     1       0          1  1  0
#> ERR342846     1       0          1  1  0
#> ERR342872     2       0          1  0  1
#> ERR342828     2       0          1  0  1
#> ERR342840     1       0          1  1  0
#> ERR342831     1       0          1  1  0
#> ERR342818     1       0          1  1  0
#> ERR342862     1       0          1  1  0
#> ERR342894     1       0          1  1  0
#> ERR342884     2       0          1  0  1
#> ERR342891     1       0          1  1  0
#> ERR342890     1       0          1  1  0
#> ERR342836     2       0          1  0  1
#> ERR342879     1       0          1  1  0
#> ERR342848     1       0          1  1  0
#> ERR342861     1       0          1  1  0
#> ERR342814     2       0          1  0  1
#> ERR342870     1       0          1  1  0
#> ERR342901     1       0          1  1  0
#> ERR342908     1       0          1  1  0
#> ERR342815     2       0          1  0  1
#> ERR342897     1       0          1  1  0
#> ERR342833     2       0          1  0  1
#> ERR342817     1       0          1  1  0
#> ERR342810     2       0          1  0  1
#> ERR342867     1       0          1  1  0
#> ERR342847     1       0          1  1  0
#> ERR342855     1       0          1  1  0
#> ERR342851     1       0          1  1  0
#> ERR342813     1       0          1  1  0
#> ERR342883     1       0          1  1  0
#> ERR342856     1       0          1  1  0
#> ERR342822     2       0          1  0  1
#> ERR342892     1       0          1  1  0
#> ERR342842     1       0          1  1  0
#> ERR342902     2       0          1  0  1
#> ERR342900     2       0          1  0  1
#> ERR342888     1       0          1  1  0
#> ERR342812     1       0          1  1  0
#> ERR342853     2       0          1  0  1
#> ERR342866     1       0          1  1  0
#> ERR342820     1       0          1  1  0
#> ERR342895     1       0          1  1  0
#> ERR342825     1       0          1  1  0
#> ERR342826     1       0          1  1  0
#> ERR342875     2       0          1  0  1
#> ERR342834     1       0          1  1  0
#> ERR342898     1       0          1  1  0
#> ERR342886     2       0          1  0  1
#> ERR342838     1       0          1  1  0
#> ERR342882     1       0          1  1  0
#> ERR342807     2       0          1  0  1
#> ERR342873     1       0          1  1  0
#> ERR342844     1       0          1  1  0
#> ERR342874     1       0          1  1  0
#> ERR342893     1       0          1  1  0
#> ERR342859     1       0          1  1  0
#> ERR342830     2       0          1  0  1
#> ERR342880     1       0          1  1  0
#> ERR342887     1       0          1  1  0
#> ERR342854     1       0          1  1  0
#> ERR342904     1       0          1  1  0
#> ERR342881     1       0          1  1  0
#> ERR342858     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342843     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342896     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342827     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342871     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342863     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342839     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342906     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342905     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342816     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342865     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342824     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342841     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342835     1  0.0892     0.8671 0.980 0.000 0.020
#> ERR342899     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342829     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342850     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342849     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342811     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342837     1  0.0592     0.8721 0.988 0.000 0.012
#> ERR342857     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342869     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342903     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342819     1  0.0747     0.8697 0.984 0.000 0.016
#> ERR342885     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342889     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342864     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342860     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342808     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342823     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342907     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342852     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342832     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342868     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342821     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342878     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342876     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342809     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342846     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342872     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342828     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342840     1  0.6192     0.2910 0.580 0.000 0.420
#> ERR342831     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342818     1  0.6280     0.2227 0.540 0.000 0.460
#> ERR342862     1  0.6309     0.0701 0.504 0.000 0.496
#> ERR342894     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342884     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342891     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342890     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342836     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342879     1  0.6168     0.3497 0.588 0.000 0.412
#> ERR342848     1  0.4291     0.7189 0.820 0.000 0.180
#> ERR342861     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342814     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342870     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342901     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342908     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342815     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342897     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342833     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342817     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342810     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342867     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342847     1  0.1529     0.8538 0.960 0.000 0.040
#> ERR342855     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342851     1  0.6045     0.4187 0.620 0.000 0.380
#> ERR342813     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342883     3  0.6274     0.0159 0.456 0.000 0.544
#> ERR342856     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342822     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342892     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342842     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342902     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342900     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342888     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342812     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342853     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342866     3  0.6267     0.0633 0.452 0.000 0.548
#> ERR342820     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342895     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342825     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342826     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342875     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342834     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342898     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342886     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342838     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342882     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342807     2  0.0000     0.9969 0.000 1.000 0.000
#> ERR342873     1  0.5859     0.4810 0.656 0.000 0.344
#> ERR342844     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342874     1  0.6291     0.1597 0.532 0.000 0.468
#> ERR342893     1  0.6126     0.3776 0.600 0.000 0.400
#> ERR342859     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342830     2  0.0424     0.9943 0.000 0.992 0.008
#> ERR342880     3  0.5882     0.3588 0.348 0.000 0.652
#> ERR342887     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342854     1  0.0000     0.8787 1.000 0.000 0.000
#> ERR342904     3  0.0000     0.9483 0.000 0.000 1.000
#> ERR342881     1  0.6215     0.2711 0.572 0.000 0.428
#> ERR342858     1  0.6286     0.2128 0.536 0.000 0.464

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> ERR342845     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342843     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342896     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342827     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342871     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342863     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342839     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342906     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342905     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342816     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342865     2   0.438     0.8864 0.000 0.704 NA 0.000
#> ERR342824     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342841     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342835     1   0.273     0.8150 0.896 0.000 NA 0.016
#> ERR342899     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342829     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342850     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342849     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342811     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342837     1   0.172     0.8363 0.944 0.000 NA 0.008
#> ERR342857     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342869     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342903     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342819     1   0.220     0.8308 0.920 0.000 NA 0.008
#> ERR342885     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342889     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342864     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342860     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342808     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342823     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342907     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342852     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342832     2   0.394     0.8784 0.000 0.764 NA 0.000
#> ERR342868     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342821     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342878     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342876     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342809     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342846     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342872     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342828     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342840     1   0.648     0.4105 0.564 0.000 NA 0.084
#> ERR342831     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342818     1   0.737    -0.2532 0.432 0.000 NA 0.408
#> ERR342862     1   0.676     0.3598 0.536 0.000 NA 0.104
#> ERR342894     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342884     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342891     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342890     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342836     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342879     4   0.741     0.3155 0.388 0.000 NA 0.444
#> ERR342848     1   0.364     0.6718 0.820 0.000 NA 0.172
#> ERR342861     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342814     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342870     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342901     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342908     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342815     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342897     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342833     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342817     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342810     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342867     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342847     1   0.400     0.7631 0.812 0.000 NA 0.024
#> ERR342855     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342851     1   0.720    -0.0959 0.484 0.000 NA 0.372
#> ERR342813     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342883     4   0.757     0.4153 0.340 0.000 NA 0.456
#> ERR342856     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342822     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342892     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342842     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342902     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342900     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342888     1   0.276     0.8205 0.872 0.000 NA 0.000
#> ERR342812     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342853     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342866     1   0.676     0.3598 0.536 0.000 NA 0.104
#> ERR342820     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342895     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342825     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342826     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342875     2   0.443     0.8868 0.000 0.696 NA 0.000
#> ERR342834     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342898     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342886     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342838     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342882     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342807     2   0.479     0.8752 0.000 0.620 NA 0.000
#> ERR342873     1   0.634     0.2329 0.600 0.000 NA 0.316
#> ERR342844     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342874     1   0.671     0.3685 0.540 0.000 NA 0.100
#> ERR342893     1   0.731    -0.2332 0.436 0.000 NA 0.412
#> ERR342859     4   0.000     0.6575 0.000 0.000 NA 1.000
#> ERR342830     2   0.000     0.8223 0.000 1.000 NA 0.000
#> ERR342880     4   0.761     0.5509 0.264 0.000 NA 0.476
#> ERR342887     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342854     1   0.000     0.8457 1.000 0.000 NA 0.000
#> ERR342904     4   0.500     0.8158 0.000 0.000 NA 0.508
#> ERR342881     1   0.631     0.4291 0.576 0.000 NA 0.072
#> ERR342858     4   0.743     0.3333 0.380 0.000 NA 0.448

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342843     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342896     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342871     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342863     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342906     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342905     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342816     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342865     2   0.029     0.8048 0.000 0.992 0.000 0.000 0.008
#> ERR342824     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342835     1   0.601     0.0624 0.528 0.000 0.000 0.344 0.128
#> ERR342899     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342829     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342849     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342811     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342837     1   0.512     0.2102 0.692 0.000 0.000 0.188 0.120
#> ERR342857     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342869     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342903     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342819     1   0.592     0.0740 0.564 0.000 0.000 0.304 0.132
#> ERR342885     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342889     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342860     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342808     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342823     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342852     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342832     2   0.167     0.7975 0.000 0.924 0.000 0.000 0.076
#> ERR342868     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342821     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342878     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342876     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342872     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342828     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342840     1   0.610     0.0378 0.480 0.000 0.000 0.392 0.128
#> ERR342831     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342818     4   0.393     0.5022 0.328 0.000 0.000 0.672 0.000
#> ERR342862     1   0.613     0.0259 0.456 0.000 0.000 0.416 0.128
#> ERR342894     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342884     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342891     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342836     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342879     4   0.345     0.6144 0.244 0.000 0.000 0.756 0.000
#> ERR342848     1   0.297     0.4224 0.816 0.000 0.000 0.184 0.000
#> ERR342861     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342870     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342901     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342815     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342897     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342833     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342817     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342810     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342867     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342847     1   0.615     0.0282 0.488 0.000 0.000 0.376 0.136
#> ERR342855     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4   0.393     0.5040 0.328 0.000 0.000 0.672 0.000
#> ERR342813     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342883     4   0.112     0.8405 0.044 0.000 0.000 0.956 0.000
#> ERR342856     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342822     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342900     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342888     5   0.423     1.0000 0.424 0.000 0.000 0.000 0.576
#> ERR342812     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342866     1   0.613     0.0259 0.456 0.000 0.000 0.416 0.128
#> ERR342820     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342895     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342826     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342875     2   0.000     0.8050 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342898     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342886     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342838     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2   0.511     0.7628 0.000 0.680 0.224 0.000 0.096
#> ERR342873     4   0.425     0.3377 0.432 0.000 0.000 0.568 0.000
#> ERR342844     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342874     1   0.612     0.0261 0.460 0.000 0.000 0.412 0.128
#> ERR342893     4   0.389     0.5141 0.320 0.000 0.000 0.680 0.000
#> ERR342859     3   0.331     1.0000 0.000 0.000 0.776 0.224 0.000
#> ERR342830     2   0.393     0.7820 0.000 0.672 0.000 0.000 0.328
#> ERR342880     4   0.029     0.8726 0.008 0.000 0.000 0.992 0.000
#> ERR342887     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1   0.000     0.6755 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4   0.000     0.8787 0.000 0.000 0.000 1.000 0.000
#> ERR342881     1   0.604     0.0516 0.488 0.000 0.000 0.392 0.120
#> ERR342858     4   0.321     0.6546 0.212 0.000 0.000 0.788 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2 p3    p4    p5    p6
#> ERR342845     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342843     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342896     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342827     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342871     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342863     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342839     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342906     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342905     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342816     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342865     2  0.1501      0.812 0.000 0.924  0 0.000 0.000 0.076
#> ERR342824     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342841     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342835     1  0.6103     -0.309 0.368 0.000  0 0.344 0.288 0.000
#> ERR342899     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342829     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342850     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342849     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342811     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342837     1  0.5602     -0.133 0.536 0.000  0 0.188 0.276 0.000
#> ERR342857     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342869     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342903     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342819     1  0.6062     -0.289 0.408 0.000  0 0.304 0.288 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342889     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342864     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342860     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342808     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342823     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342907     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342852     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342832     2  0.0713      0.819 0.000 0.972  0 0.000 0.000 0.028
#> ERR342868     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342821     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342878     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342876     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342872     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342828     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342840     4  0.6080     -0.254 0.316 0.000  0 0.396 0.288 0.000
#> ERR342831     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342818     4  0.3499      0.497 0.320 0.000  0 0.680 0.000 0.000
#> ERR342862     4  0.6069     -0.241 0.308 0.000  0 0.404 0.288 0.000
#> ERR342894     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342884     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342891     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342890     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342836     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342879     4  0.3101      0.597 0.244 0.000  0 0.756 0.000 0.000
#> ERR342848     1  0.2597      0.604 0.824 0.000  0 0.176 0.000 0.000
#> ERR342861     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342814     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342870     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342901     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342908     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342815     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342897     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342833     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342817     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342810     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342867     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342847     4  0.6099     -0.286 0.328 0.000  0 0.380 0.292 0.000
#> ERR342855     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342851     4  0.3482      0.503 0.316 0.000  0 0.684 0.000 0.000
#> ERR342813     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342883     4  0.1007      0.764 0.044 0.000  0 0.956 0.000 0.000
#> ERR342856     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342822     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342892     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342902     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342900     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342888     5  0.3198      1.000 0.260 0.000  0 0.000 0.740 0.000
#> ERR342812     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342853     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342866     4  0.6069     -0.241 0.308 0.000  0 0.404 0.288 0.000
#> ERR342820     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342895     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342875     2  0.1556      0.811 0.000 0.920  0 0.000 0.000 0.080
#> ERR342834     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342898     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342886     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342838     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342807     6  0.0000      1.000 0.000 0.000  0 0.000 0.000 1.000
#> ERR342873     4  0.3774      0.337 0.408 0.000  0 0.592 0.000 0.000
#> ERR342844     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342874     4  0.6069     -0.241 0.308 0.000  0 0.404 0.288 0.000
#> ERR342893     4  0.3464      0.509 0.312 0.000  0 0.688 0.000 0.000
#> ERR342859     3  0.0000      1.000 0.000 0.000  1 0.000 0.000 0.000
#> ERR342830     2  0.3198      0.846 0.000 0.740  0 0.000 0.260 0.000
#> ERR342880     4  0.0260      0.783 0.008 0.000  0 0.992 0.000 0.000
#> ERR342887     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.872 1.000 0.000  0 0.000 0.000 0.000
#> ERR342904     4  0.0000      0.787 0.000 0.000  0 1.000 0.000 0.000
#> ERR342881     4  0.6067     -0.242 0.324 0.000  0 0.400 0.276 0.000
#> ERR342858     4  0.2883      0.633 0.212 0.000  0 0.788 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:mclust**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.836           0.954       0.966         0.4888 0.499   0.499
#> 3 3 0.587           0.866       0.849         0.2876 0.836   0.682
#> 4 4 0.720           0.700       0.769         0.1274 0.852   0.629
#> 5 5 0.866           0.916       0.922         0.0724 0.968   0.887
#> 6 6 1.000           0.999       0.999         0.0731 0.932   0.730

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> ERR342845     2  0.0000      0.972 0.000 1.000
#> ERR342843     2  0.0000      0.972 0.000 1.000
#> ERR342896     1  0.0000      0.955 1.000 0.000
#> ERR342827     2  0.0000      0.972 0.000 1.000
#> ERR342871     1  0.4022      0.955 0.920 0.080
#> ERR342863     2  0.0000      0.972 0.000 1.000
#> ERR342839     2  0.0000      0.972 0.000 1.000
#> ERR342906     1  0.4022      0.955 0.920 0.080
#> ERR342905     2  0.0000      0.972 0.000 1.000
#> ERR342816     1  0.4022      0.955 0.920 0.080
#> ERR342865     2  0.0000      0.972 0.000 1.000
#> ERR342824     1  0.0376      0.956 0.996 0.004
#> ERR342841     2  0.0000      0.972 0.000 1.000
#> ERR342835     2  0.5519      0.870 0.128 0.872
#> ERR342899     2  0.0000      0.972 0.000 1.000
#> ERR342829     1  0.0000      0.955 1.000 0.000
#> ERR342850     1  0.4022      0.955 0.920 0.080
#> ERR342849     2  0.0000      0.972 0.000 1.000
#> ERR342811     1  0.4022      0.955 0.920 0.080
#> ERR342837     2  0.5519      0.870 0.128 0.872
#> ERR342857     1  0.4022      0.955 0.920 0.080
#> ERR342869     1  0.4022      0.955 0.920 0.080
#> ERR342903     1  0.0000      0.955 1.000 0.000
#> ERR342819     2  0.5519      0.870 0.128 0.872
#> ERR342885     1  0.4022      0.955 0.920 0.080
#> ERR342889     2  0.0000      0.972 0.000 1.000
#> ERR342864     1  0.4022      0.955 0.920 0.080
#> ERR342860     2  0.0000      0.972 0.000 1.000
#> ERR342808     1  0.4022      0.955 0.920 0.080
#> ERR342823     1  0.0376      0.956 0.996 0.004
#> ERR342907     2  0.0000      0.972 0.000 1.000
#> ERR342852     1  0.4022      0.955 0.920 0.080
#> ERR342832     2  0.0000      0.972 0.000 1.000
#> ERR342868     2  0.0000      0.972 0.000 1.000
#> ERR342821     1  0.4022      0.955 0.920 0.080
#> ERR342878     2  0.0000      0.972 0.000 1.000
#> ERR342876     1  0.0000      0.955 1.000 0.000
#> ERR342809     1  0.0000      0.955 1.000 0.000
#> ERR342846     1  0.4022      0.955 0.920 0.080
#> ERR342872     2  0.0000      0.972 0.000 1.000
#> ERR342828     2  0.0000      0.972 0.000 1.000
#> ERR342840     2  0.5519      0.870 0.128 0.872
#> ERR342831     2  0.0000      0.972 0.000 1.000
#> ERR342818     1  0.0376      0.956 0.996 0.004
#> ERR342862     2  0.5519      0.870 0.128 0.872
#> ERR342894     2  0.0000      0.972 0.000 1.000
#> ERR342884     2  0.0000      0.972 0.000 1.000
#> ERR342891     1  0.0000      0.955 1.000 0.000
#> ERR342890     2  0.0000      0.972 0.000 1.000
#> ERR342836     2  0.0000      0.972 0.000 1.000
#> ERR342879     1  0.0376      0.956 0.996 0.004
#> ERR342848     1  0.3114      0.956 0.944 0.056
#> ERR342861     1  0.0000      0.955 1.000 0.000
#> ERR342814     2  0.0000      0.972 0.000 1.000
#> ERR342870     1  0.4022      0.955 0.920 0.080
#> ERR342901     1  0.0000      0.955 1.000 0.000
#> ERR342908     1  0.4022      0.955 0.920 0.080
#> ERR342815     2  0.0000      0.972 0.000 1.000
#> ERR342897     1  0.4022      0.955 0.920 0.080
#> ERR342833     2  0.0000      0.972 0.000 1.000
#> ERR342817     1  0.4022      0.955 0.920 0.080
#> ERR342810     2  0.0000      0.972 0.000 1.000
#> ERR342867     1  0.4022      0.955 0.920 0.080
#> ERR342847     2  0.5519      0.870 0.128 0.872
#> ERR342855     1  0.0000      0.955 1.000 0.000
#> ERR342851     1  0.0376      0.956 0.996 0.004
#> ERR342813     2  0.0000      0.972 0.000 1.000
#> ERR342883     1  0.0376      0.956 0.996 0.004
#> ERR342856     1  0.4022      0.955 0.920 0.080
#> ERR342822     2  0.0000      0.972 0.000 1.000
#> ERR342892     1  0.0000      0.955 1.000 0.000
#> ERR342842     1  0.0000      0.955 1.000 0.000
#> ERR342902     2  0.0000      0.972 0.000 1.000
#> ERR342900     2  0.0000      0.972 0.000 1.000
#> ERR342888     2  0.0000      0.972 0.000 1.000
#> ERR342812     1  0.0000      0.955 1.000 0.000
#> ERR342853     2  0.0000      0.972 0.000 1.000
#> ERR342866     2  0.5519      0.870 0.128 0.872
#> ERR342820     1  0.4022      0.955 0.920 0.080
#> ERR342895     1  0.0000      0.955 1.000 0.000
#> ERR342825     1  0.4022      0.955 0.920 0.080
#> ERR342826     1  0.4022      0.955 0.920 0.080
#> ERR342875     2  0.0000      0.972 0.000 1.000
#> ERR342834     1  0.4022      0.955 0.920 0.080
#> ERR342898     1  0.4022      0.955 0.920 0.080
#> ERR342886     2  0.0000      0.972 0.000 1.000
#> ERR342838     1  0.0000      0.955 1.000 0.000
#> ERR342882     1  0.0000      0.955 1.000 0.000
#> ERR342807     2  0.0000      0.972 0.000 1.000
#> ERR342873     1  0.0376      0.956 0.996 0.004
#> ERR342844     1  0.4022      0.955 0.920 0.080
#> ERR342874     2  0.5519      0.870 0.128 0.872
#> ERR342893     1  0.0376      0.956 0.996 0.004
#> ERR342859     1  0.4022      0.955 0.920 0.080
#> ERR342830     2  0.0000      0.972 0.000 1.000
#> ERR342880     1  0.0376      0.956 0.996 0.004
#> ERR342887     1  0.0000      0.955 1.000 0.000
#> ERR342854     1  0.0000      0.955 1.000 0.000
#> ERR342904     1  0.4022      0.955 0.920 0.080
#> ERR342881     2  0.5519      0.870 0.128 0.872
#> ERR342858     1  0.0376      0.956 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> ERR342845     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342843     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342896     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342827     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342871     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342863     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342839     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342906     1  0.5016      0.795 0.760 0.000 0.240
#> ERR342905     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342816     1  0.5254      0.786 0.736 0.000 0.264
#> ERR342865     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342824     1  0.0000      0.850 1.000 0.000 0.000
#> ERR342841     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342835     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342899     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342829     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342850     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342849     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342811     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342837     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342857     1  0.5058      0.794 0.756 0.000 0.244
#> ERR342869     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342903     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342819     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342885     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342889     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342864     1  0.5016      0.795 0.760 0.000 0.240
#> ERR342860     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342808     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342823     1  0.0000      0.850 1.000 0.000 0.000
#> ERR342907     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342852     1  0.5098      0.793 0.752 0.000 0.248
#> ERR342832     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342868     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342821     1  0.5178      0.790 0.744 0.000 0.256
#> ERR342878     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342876     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342809     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342846     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342872     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342828     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342840     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342831     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342818     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342862     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342894     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342884     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342891     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342890     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342836     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342879     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342848     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342861     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342814     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342870     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342901     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342908     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342815     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342897     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342833     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342817     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342810     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342867     1  0.5098      0.793 0.752 0.000 0.248
#> ERR342847     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342855     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342851     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342813     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342883     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342856     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342822     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342892     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342842     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342902     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342900     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342888     2  0.1031      0.921 0.000 0.976 0.024
#> ERR342812     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342853     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342866     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342820     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342895     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342825     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342826     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342875     2  0.2711      0.921 0.000 0.912 0.088
#> ERR342834     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342898     1  0.5058      0.794 0.756 0.000 0.244
#> ERR342886     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342838     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342882     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342807     3  0.4861      0.871 0.008 0.192 0.800
#> ERR342873     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342844     1  0.5254      0.786 0.736 0.000 0.264
#> ERR342874     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342893     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342859     3  0.8442      0.878 0.188 0.192 0.620
#> ERR342830     2  0.2448      0.926 0.000 0.924 0.076
#> ERR342880     1  0.0237      0.850 0.996 0.000 0.004
#> ERR342887     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342854     1  0.2448      0.843 0.924 0.076 0.000
#> ERR342904     1  0.5591      0.762 0.696 0.000 0.304
#> ERR342881     2  0.1765      0.914 0.004 0.956 0.040
#> ERR342858     1  0.0237      0.850 0.996 0.000 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342843     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342896     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342827     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342871     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342863     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342839     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342906     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342905     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342816     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342865     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342824     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342841     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342835     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342899     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342829     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342850     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342849     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342811     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342837     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342857     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342869     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342903     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342819     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342885     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342889     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342864     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342860     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342808     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342823     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342907     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342852     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342832     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342868     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342821     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342878     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342876     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342846     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342872     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342828     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342840     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342831     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342818     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342862     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342894     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342884     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342891     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342890     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342836     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342879     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342848     1  0.0707      0.984 0.980 0.000 0.000 0.020
#> ERR342861     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342814     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342870     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342901     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342908     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342815     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342897     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342833     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342817     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342810     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342867     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342847     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342855     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342851     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342813     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342883     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342856     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342822     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342892     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342902     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342900     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342888     2  0.6627      0.590 0.000 0.556 0.096 0.348
#> ERR342812     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342853     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342866     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342820     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342895     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342825     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342826     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342875     2  0.0469      0.829 0.000 0.988 0.012 0.000
#> ERR342834     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342898     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342886     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342838     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342807     3  0.5077      1.000 0.000 0.160 0.760 0.080
#> ERR342873     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342844     4  0.4584      0.424 0.004 0.000 0.300 0.696
#> ERR342874     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342893     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342859     4  0.7249     -0.236 0.000 0.412 0.144 0.444
#> ERR342830     2  0.0000      0.833 0.000 1.000 0.000 0.000
#> ERR342880     1  0.0592      0.988 0.984 0.000 0.000 0.016
#> ERR342887     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.994 1.000 0.000 0.000 0.000
#> ERR342904     4  0.4722      0.424 0.008 0.000 0.300 0.692
#> ERR342881     2  0.3634      0.812 0.000 0.856 0.096 0.048
#> ERR342858     1  0.0592      0.988 0.984 0.000 0.000 0.016

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342843     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342896     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342871     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342863     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342839     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342906     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342905     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342816     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342865     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342824     1  0.0162      0.992 0.996 0.000 0.000 0.004 0.000
#> ERR342841     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342835     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342899     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342829     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342849     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342811     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342837     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342857     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342869     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342903     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342885     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342889     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342864     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342860     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342808     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342823     1  0.0162      0.992 0.996 0.000 0.000 0.004 0.000
#> ERR342907     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342852     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342832     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342868     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342821     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342878     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342876     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342872     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342828     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342840     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342831     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342818     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342862     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342894     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342884     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342891     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342836     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342879     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342848     1  0.1043      0.958 0.960 0.000 0.000 0.040 0.000
#> ERR342861     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342814     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342870     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342901     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342815     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342897     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342833     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342817     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342810     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342867     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342847     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342855     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342851     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342813     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342883     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342856     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342822     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342892     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342900     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342888     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342812     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342853     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342866     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342820     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342895     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342826     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342875     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342834     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342898     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342886     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342838     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.5477      1.000 0.000 0.648 0.132 0.000 0.220
#> ERR342873     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342844     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342874     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342893     1  0.0880      0.968 0.968 0.000 0.000 0.032 0.000
#> ERR342859     3  0.2424      1.000 0.000 0.000 0.868 0.132 0.000
#> ERR342830     5  0.0000      0.774 0.000 0.000 0.000 0.000 1.000
#> ERR342880     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000
#> ERR342887     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.993 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> ERR342881     5  0.4030      0.786 0.000 0.352 0.000 0.000 0.648
#> ERR342858     1  0.0404      0.988 0.988 0.000 0.000 0.012 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1 p2 p3    p4 p5 p6
#> ERR342845     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342843     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342896     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342827     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342871     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342863     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342839     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342906     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342905     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342816     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342865     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342824     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342841     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342835     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342899     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342829     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342850     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342849     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342811     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342837     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342857     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342869     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342903     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342819     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342885     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342889     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342864     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342860     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342808     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342823     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342907     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342852     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342832     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342868     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342821     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342878     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342876     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342809     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342846     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342872     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342828     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342840     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342831     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342818     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342862     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342894     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342884     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342891     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342890     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342836     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342879     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342848     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342861     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342814     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342870     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342901     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342908     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342815     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342897     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342833     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342817     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342810     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342867     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342847     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342855     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342851     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342813     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342883     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342856     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342822     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342892     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342842     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342902     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342900     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342888     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342812     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342853     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342866     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342820     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342895     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342825     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342826     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342875     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342834     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342898     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342886     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342838     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342882     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342807     6   0.000      1.000 0.000  0  0 0.000  0  1
#> ERR342873     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342844     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342874     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342893     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342859     3   0.000      1.000 0.000  0  1 0.000  0  0
#> ERR342830     2   0.000      1.000 0.000  1  0 0.000  0  0
#> ERR342880     1   0.026      0.994 0.992  0  0 0.008  0  0
#> ERR342887     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342854     1   0.000      0.997 1.000  0  0 0.000  0  0
#> ERR342904     4   0.000      1.000 0.000  0  0 1.000  0  0
#> ERR342881     5   0.000      1.000 0.000  0  0 0.000  1  0
#> ERR342858     1   0.026      0.994 0.992  0  0 0.008  0  0

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:NMF**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "NMF"]
# you can also extract it by
# res = res_list["ATC:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 15144 rows and 101 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4053 0.595   0.595
#> 3 3 1.000           0.998       0.997         0.6048 0.754   0.587
#> 4 4 0.827           0.926       0.915         0.1438 0.900   0.714
#> 5 5 0.863           0.926       0.929         0.0546 0.902   0.652
#> 6 6 0.887           0.837       0.857         0.0373 1.000   1.000

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette p1 p2
#> ERR342845     1       0          1  1  0
#> ERR342843     1       0          1  1  0
#> ERR342896     1       0          1  1  0
#> ERR342827     2       0          1  0  1
#> ERR342871     1       0          1  1  0
#> ERR342863     2       0          1  0  1
#> ERR342839     1       0          1  1  0
#> ERR342906     1       0          1  1  0
#> ERR342905     2       0          1  0  1
#> ERR342816     1       0          1  1  0
#> ERR342865     2       0          1  0  1
#> ERR342824     1       0          1  1  0
#> ERR342841     2       0          1  0  1
#> ERR342835     1       0          1  1  0
#> ERR342899     2       0          1  0  1
#> ERR342829     1       0          1  1  0
#> ERR342850     1       0          1  1  0
#> ERR342849     2       0          1  0  1
#> ERR342811     1       0          1  1  0
#> ERR342837     1       0          1  1  0
#> ERR342857     1       0          1  1  0
#> ERR342869     1       0          1  1  0
#> ERR342903     1       0          1  1  0
#> ERR342819     1       0          1  1  0
#> ERR342885     1       0          1  1  0
#> ERR342889     2       0          1  0  1
#> ERR342864     1       0          1  1  0
#> ERR342860     2       0          1  0  1
#> ERR342808     1       0          1  1  0
#> ERR342823     1       0          1  1  0
#> ERR342907     2       0          1  0  1
#> ERR342852     1       0          1  1  0
#> ERR342832     2       0          1  0  1
#> ERR342868     1       0          1  1  0
#> ERR342821     1       0          1  1  0
#> ERR342878     2       0          1  0  1
#> ERR342876     1       0          1  1  0
#> ERR342809     1       0          1  1  0
#> ERR342846     1       0          1  1  0
#> ERR342872     2       0          1  0  1
#> ERR342828     2       0          1  0  1
#> ERR342840     1       0          1  1  0
#> ERR342831     1       0          1  1  0
#> ERR342818     1       0          1  1  0
#> ERR342862     1       0          1  1  0
#> ERR342894     1       0          1  1  0
#> ERR342884     2       0          1  0  1
#> ERR342891     1       0          1  1  0
#> ERR342890     1       0          1  1  0
#> ERR342836     2       0          1  0  1
#> ERR342879     1       0          1  1  0
#> ERR342848     1       0          1  1  0
#> ERR342861     1       0          1  1  0
#> ERR342814     2       0          1  0  1
#> ERR342870     1       0          1  1  0
#> ERR342901     1       0          1  1  0
#> ERR342908     1       0          1  1  0
#> ERR342815     2       0          1  0  1
#> ERR342897     1       0          1  1  0
#> ERR342833     2       0          1  0  1
#> ERR342817     1       0          1  1  0
#> ERR342810     2       0          1  0  1
#> ERR342867     1       0          1  1  0
#> ERR342847     1       0          1  1  0
#> ERR342855     1       0          1  1  0
#> ERR342851     1       0          1  1  0
#> ERR342813     1       0          1  1  0
#> ERR342883     1       0          1  1  0
#> ERR342856     1       0          1  1  0
#> ERR342822     2       0          1  0  1
#> ERR342892     1       0          1  1  0
#> ERR342842     1       0          1  1  0
#> ERR342902     2       0          1  0  1
#> ERR342900     2       0          1  0  1
#> ERR342888     1       0          1  1  0
#> ERR342812     1       0          1  1  0
#> ERR342853     2       0          1  0  1
#> ERR342866     1       0          1  1  0
#> ERR342820     1       0          1  1  0
#> ERR342895     1       0          1  1  0
#> ERR342825     1       0          1  1  0
#> ERR342826     1       0          1  1  0
#> ERR342875     2       0          1  0  1
#> ERR342834     1       0          1  1  0
#> ERR342898     1       0          1  1  0
#> ERR342886     2       0          1  0  1
#> ERR342838     1       0          1  1  0
#> ERR342882     1       0          1  1  0
#> ERR342807     2       0          1  0  1
#> ERR342873     1       0          1  1  0
#> ERR342844     1       0          1  1  0
#> ERR342874     1       0          1  1  0
#> ERR342893     1       0          1  1  0
#> ERR342859     1       0          1  1  0
#> ERR342830     2       0          1  0  1
#> ERR342880     1       0          1  1  0
#> ERR342887     1       0          1  1  0
#> ERR342854     1       0          1  1  0
#> ERR342904     1       0          1  1  0
#> ERR342881     1       0          1  1  0
#> ERR342858     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1 p2    p3
#> ERR342845     1  0.0000      0.997 1.000  0 0.000
#> ERR342843     1  0.0000      0.997 1.000  0 0.000
#> ERR342896     1  0.0237      0.997 0.996  0 0.004
#> ERR342827     2  0.0000      1.000 0.000  1 0.000
#> ERR342871     3  0.0237      1.000 0.004  0 0.996
#> ERR342863     2  0.0000      1.000 0.000  1 0.000
#> ERR342839     1  0.0000      0.997 1.000  0 0.000
#> ERR342906     3  0.0237      1.000 0.004  0 0.996
#> ERR342905     2  0.0000      1.000 0.000  1 0.000
#> ERR342816     3  0.0237      1.000 0.004  0 0.996
#> ERR342865     2  0.0000      1.000 0.000  1 0.000
#> ERR342824     1  0.0237      0.997 0.996  0 0.004
#> ERR342841     2  0.0000      1.000 0.000  1 0.000
#> ERR342835     1  0.0000      0.997 1.000  0 0.000
#> ERR342899     2  0.0000      1.000 0.000  1 0.000
#> ERR342829     1  0.0237      0.997 0.996  0 0.004
#> ERR342850     3  0.0237      1.000 0.004  0 0.996
#> ERR342849     2  0.0000      1.000 0.000  1 0.000
#> ERR342811     3  0.0237      1.000 0.004  0 0.996
#> ERR342837     1  0.0000      0.997 1.000  0 0.000
#> ERR342857     3  0.0237      1.000 0.004  0 0.996
#> ERR342869     3  0.0237      1.000 0.004  0 0.996
#> ERR342903     1  0.0237      0.997 0.996  0 0.004
#> ERR342819     1  0.0000      0.997 1.000  0 0.000
#> ERR342885     3  0.0237      1.000 0.004  0 0.996
#> ERR342889     2  0.0000      1.000 0.000  1 0.000
#> ERR342864     3  0.0237      1.000 0.004  0 0.996
#> ERR342860     2  0.0000      1.000 0.000  1 0.000
#> ERR342808     3  0.0237      1.000 0.004  0 0.996
#> ERR342823     1  0.0237      0.997 0.996  0 0.004
#> ERR342907     2  0.0000      1.000 0.000  1 0.000
#> ERR342852     3  0.0237      1.000 0.004  0 0.996
#> ERR342832     2  0.0000      1.000 0.000  1 0.000
#> ERR342868     1  0.0000      0.997 1.000  0 0.000
#> ERR342821     3  0.0237      1.000 0.004  0 0.996
#> ERR342878     2  0.0000      1.000 0.000  1 0.000
#> ERR342876     1  0.0237      0.997 0.996  0 0.004
#> ERR342809     1  0.0237      0.997 0.996  0 0.004
#> ERR342846     3  0.0237      1.000 0.004  0 0.996
#> ERR342872     2  0.0000      1.000 0.000  1 0.000
#> ERR342828     2  0.0000      1.000 0.000  1 0.000
#> ERR342840     1  0.0000      0.997 1.000  0 0.000
#> ERR342831     1  0.0000      0.997 1.000  0 0.000
#> ERR342818     1  0.0592      0.994 0.988  0 0.012
#> ERR342862     1  0.0000      0.997 1.000  0 0.000
#> ERR342894     1  0.0000      0.997 1.000  0 0.000
#> ERR342884     2  0.0000      1.000 0.000  1 0.000
#> ERR342891     1  0.0237      0.997 0.996  0 0.004
#> ERR342890     1  0.0000      0.997 1.000  0 0.000
#> ERR342836     2  0.0000      1.000 0.000  1 0.000
#> ERR342879     1  0.0592      0.994 0.988  0 0.012
#> ERR342848     1  0.0592      0.994 0.988  0 0.012
#> ERR342861     1  0.0237      0.997 0.996  0 0.004
#> ERR342814     2  0.0000      1.000 0.000  1 0.000
#> ERR342870     3  0.0237      1.000 0.004  0 0.996
#> ERR342901     1  0.0237      0.997 0.996  0 0.004
#> ERR342908     3  0.0237      1.000 0.004  0 0.996
#> ERR342815     2  0.0000      1.000 0.000  1 0.000
#> ERR342897     3  0.0237      1.000 0.004  0 0.996
#> ERR342833     2  0.0000      1.000 0.000  1 0.000
#> ERR342817     3  0.0237      1.000 0.004  0 0.996
#> ERR342810     2  0.0000      1.000 0.000  1 0.000
#> ERR342867     3  0.0237      1.000 0.004  0 0.996
#> ERR342847     1  0.0000      0.997 1.000  0 0.000
#> ERR342855     1  0.0237      0.997 0.996  0 0.004
#> ERR342851     1  0.0592      0.994 0.988  0 0.012
#> ERR342813     1  0.0000      0.997 1.000  0 0.000
#> ERR342883     1  0.0592      0.994 0.988  0 0.012
#> ERR342856     3  0.0237      1.000 0.004  0 0.996
#> ERR342822     2  0.0000      1.000 0.000  1 0.000
#> ERR342892     1  0.0237      0.997 0.996  0 0.004
#> ERR342842     1  0.0237      0.997 0.996  0 0.004
#> ERR342902     2  0.0000      1.000 0.000  1 0.000
#> ERR342900     2  0.0000      1.000 0.000  1 0.000
#> ERR342888     1  0.0000      0.997 1.000  0 0.000
#> ERR342812     1  0.0237      0.997 0.996  0 0.004
#> ERR342853     2  0.0000      1.000 0.000  1 0.000
#> ERR342866     1  0.0000      0.997 1.000  0 0.000
#> ERR342820     3  0.0237      1.000 0.004  0 0.996
#> ERR342895     1  0.0237      0.997 0.996  0 0.004
#> ERR342825     3  0.0237      1.000 0.004  0 0.996
#> ERR342826     3  0.0237      1.000 0.004  0 0.996
#> ERR342875     2  0.0000      1.000 0.000  1 0.000
#> ERR342834     3  0.0237      1.000 0.004  0 0.996
#> ERR342898     3  0.0237      1.000 0.004  0 0.996
#> ERR342886     2  0.0000      1.000 0.000  1 0.000
#> ERR342838     1  0.0237      0.997 0.996  0 0.004
#> ERR342882     1  0.0237      0.997 0.996  0 0.004
#> ERR342807     2  0.0000      1.000 0.000  1 0.000
#> ERR342873     1  0.0592      0.994 0.988  0 0.012
#> ERR342844     3  0.0237      1.000 0.004  0 0.996
#> ERR342874     1  0.0000      0.997 1.000  0 0.000
#> ERR342893     1  0.0592      0.994 0.988  0 0.012
#> ERR342859     3  0.0237      1.000 0.004  0 0.996
#> ERR342830     2  0.0000      1.000 0.000  1 0.000
#> ERR342880     1  0.0592      0.994 0.988  0 0.012
#> ERR342887     1  0.0237      0.997 0.996  0 0.004
#> ERR342854     1  0.0237      0.997 0.996  0 0.004
#> ERR342904     3  0.0237      1.000 0.004  0 0.996
#> ERR342881     1  0.0000      0.997 1.000  0 0.000
#> ERR342858     1  0.0747      0.991 0.984  0 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> ERR342845     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342843     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342896     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342827     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342871     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342863     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342839     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342906     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342905     2  0.1637      0.952 0.000 0.940 0.060 0.000
#> ERR342816     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342865     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342824     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342841     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342835     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342899     2  0.1637      0.952 0.000 0.940 0.060 0.000
#> ERR342829     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342850     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342849     2  0.1389      0.959 0.000 0.952 0.048 0.000
#> ERR342811     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342837     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342857     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342869     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342903     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342819     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342885     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342889     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342864     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342860     2  0.2868      0.874 0.000 0.864 0.136 0.000
#> ERR342808     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342823     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342907     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342852     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342832     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342868     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342821     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342878     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342876     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342846     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342872     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342828     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342840     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342831     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342818     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342862     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342894     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342884     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342891     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342890     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342836     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342879     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342848     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342861     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342814     2  0.1022      0.967 0.000 0.968 0.032 0.000
#> ERR342870     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342901     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342908     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342815     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342897     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342833     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342817     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342810     2  0.1716      0.949 0.000 0.936 0.064 0.000
#> ERR342867     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342847     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342855     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342851     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342813     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342883     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342856     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342822     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342892     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342902     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342900     2  0.1022      0.967 0.000 0.968 0.032 0.000
#> ERR342888     3  0.3907      0.995 0.232 0.000 0.768 0.000
#> ERR342812     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342853     2  0.1022      0.967 0.000 0.968 0.032 0.000
#> ERR342866     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342820     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342895     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342825     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342826     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342875     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> ERR342834     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342898     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342886     2  0.1716      0.949 0.000 0.936 0.064 0.000
#> ERR342838     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342807     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> ERR342873     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342844     4  0.2216      0.906 0.000 0.000 0.092 0.908
#> ERR342874     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342893     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342859     4  0.2814      0.893 0.000 0.000 0.132 0.868
#> ERR342830     2  0.1716      0.949 0.000 0.936 0.064 0.000
#> ERR342880     1  0.4931      0.790 0.776 0.000 0.092 0.132
#> ERR342887     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      0.890 1.000 0.000 0.000 0.000
#> ERR342904     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> ERR342881     3  0.3975      0.995 0.240 0.000 0.760 0.000
#> ERR342858     1  0.4931      0.790 0.776 0.000 0.092 0.132

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> ERR342845     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342843     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342827     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342871     4  0.4004      0.755 0.004 0.000 0.172 0.784 0.040
#> ERR342863     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342839     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342906     4  0.0566      0.846 0.000 0.000 0.004 0.984 0.012
#> ERR342905     2  0.0404      0.957 0.000 0.988 0.000 0.000 0.012
#> ERR342816     4  0.0451      0.847 0.000 0.000 0.004 0.988 0.008
#> ERR342865     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342841     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342835     5  0.2433      0.961 0.056 0.000 0.012 0.024 0.908
#> ERR342899     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342850     4  0.4004      0.755 0.004 0.000 0.172 0.784 0.040
#> ERR342849     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342811     4  0.4125      0.752 0.008 0.000 0.172 0.780 0.040
#> ERR342837     5  0.2341      0.962 0.056 0.000 0.012 0.020 0.912
#> ERR342857     4  0.0324      0.847 0.000 0.000 0.004 0.992 0.004
#> ERR342869     4  0.4004      0.755 0.004 0.000 0.172 0.784 0.040
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342819     5  0.2341      0.962 0.056 0.000 0.012 0.020 0.912
#> ERR342885     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342889     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342864     4  0.0324      0.847 0.000 0.000 0.004 0.992 0.004
#> ERR342860     2  0.0794      0.946 0.000 0.972 0.000 0.000 0.028
#> ERR342808     4  0.4125      0.752 0.008 0.000 0.172 0.780 0.040
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342907     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342852     4  0.0451      0.847 0.000 0.000 0.004 0.988 0.008
#> ERR342832     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342868     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342821     4  0.0451      0.847 0.000 0.000 0.004 0.988 0.008
#> ERR342878     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342846     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342872     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342828     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342840     5  0.2270      0.961 0.052 0.000 0.012 0.020 0.916
#> ERR342831     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342818     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342862     5  0.2536      0.955 0.052 0.000 0.012 0.032 0.904
#> ERR342894     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342884     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342890     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342836     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342879     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342848     4  0.3242      0.758 0.172 0.000 0.000 0.816 0.012
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342814     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342870     4  0.4004      0.755 0.004 0.000 0.172 0.784 0.040
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342908     4  0.4125      0.752 0.008 0.000 0.172 0.780 0.040
#> ERR342815     2  0.0162      0.960 0.000 0.996 0.000 0.000 0.004
#> ERR342897     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342833     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342817     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342810     2  0.0510      0.955 0.000 0.984 0.000 0.000 0.016
#> ERR342867     4  0.0324      0.847 0.000 0.000 0.004 0.992 0.004
#> ERR342847     5  0.2341      0.962 0.056 0.000 0.012 0.020 0.912
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342851     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342813     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342883     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342856     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342822     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342902     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342900     2  0.0162      0.960 0.000 0.996 0.000 0.000 0.004
#> ERR342888     5  0.1892      0.964 0.080 0.000 0.004 0.000 0.916
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342853     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342866     5  0.2536      0.955 0.052 0.000 0.012 0.032 0.904
#> ERR342820     4  0.4004      0.755 0.004 0.000 0.172 0.784 0.040
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342825     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342826     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342875     2  0.0000      0.960 0.000 1.000 0.000 0.000 0.000
#> ERR342834     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342898     4  0.0324      0.847 0.000 0.000 0.004 0.992 0.004
#> ERR342886     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342807     2  0.2685      0.922 0.000 0.880 0.092 0.000 0.028
#> ERR342873     4  0.2624      0.811 0.116 0.000 0.000 0.872 0.012
#> ERR342844     4  0.0324      0.847 0.000 0.000 0.004 0.992 0.004
#> ERR342874     5  0.2536      0.955 0.052 0.000 0.012 0.032 0.904
#> ERR342893     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342859     3  0.2074      1.000 0.000 0.000 0.896 0.104 0.000
#> ERR342830     2  0.0290      0.959 0.000 0.992 0.000 0.000 0.008
#> ERR342880     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000
#> ERR342904     4  0.4125      0.752 0.008 0.000 0.172 0.780 0.040
#> ERR342881     5  0.2536      0.955 0.052 0.000 0.012 0.032 0.904
#> ERR342858     4  0.2574      0.814 0.112 0.000 0.000 0.876 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2   p3    p4    p5    p6
#> ERR342845     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342843     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342896     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342827     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342871     4  0.5957      0.626 0.000 0.000 0.06 0.600 0.212 0.128
#> ERR342863     2  0.0000      0.898 0.000 1.000 0.00 0.000 0.000 0.000
#> ERR342839     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342906     4  0.0891      0.743 0.000 0.000 0.00 0.968 0.008 0.024
#> ERR342905     2  0.0520      0.895 0.000 0.984 0.00 0.000 0.008 0.008
#> ERR342816     4  0.0508      0.746 0.000 0.000 0.00 0.984 0.004 0.012
#> ERR342865     2  0.0000      0.898 0.000 1.000 0.00 0.000 0.000 0.000
#> ERR342824     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342841     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342835     5  0.1789      0.790 0.032 0.000 0.00 0.044 0.924 0.000
#> ERR342899     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.008 0.004
#> ERR342829     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342850     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342849     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.008 0.004
#> ERR342811     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342837     5  0.1789      0.790 0.032 0.000 0.00 0.044 0.924 0.000
#> ERR342857     4  0.0146      0.746 0.000 0.000 0.00 0.996 0.000 0.004
#> ERR342869     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342903     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342819     5  0.1789      0.790 0.032 0.000 0.00 0.044 0.924 0.000
#> ERR342885     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342889     2  0.0000      0.898 0.000 1.000 0.00 0.000 0.000 0.000
#> ERR342864     4  0.0146      0.746 0.000 0.000 0.00 0.996 0.000 0.004
#> ERR342860     2  0.0622      0.893 0.000 0.980 0.00 0.000 0.012 0.008
#> ERR342808     4  0.5957      0.626 0.000 0.000 0.06 0.600 0.212 0.128
#> ERR342823     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342907     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342852     4  0.0146      0.746 0.000 0.000 0.00 0.996 0.000 0.004
#> ERR342832     2  0.0000      0.898 0.000 1.000 0.00 0.000 0.000 0.000
#> ERR342868     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342821     4  0.0603      0.745 0.000 0.000 0.00 0.980 0.004 0.016
#> ERR342878     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342876     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342809     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342846     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342872     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342828     2  0.0146      0.897 0.000 0.996 0.00 0.000 0.000 0.004
#> ERR342840     5  0.1713      0.791 0.028 0.000 0.00 0.044 0.928 0.000
#> ERR342831     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342818     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342862     5  0.2846      0.737 0.024 0.000 0.00 0.084 0.868 0.024
#> ERR342894     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342884     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342891     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342890     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342836     2  0.0000      0.898 0.000 1.000 0.00 0.000 0.000 0.000
#> ERR342879     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342848     4  0.5773      0.569 0.144 0.000 0.00 0.564 0.020 0.272
#> ERR342861     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342814     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.004 0.008
#> ERR342870     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342901     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342908     4  0.5957      0.626 0.000 0.000 0.06 0.600 0.212 0.128
#> ERR342815     2  0.0260      0.897 0.000 0.992 0.00 0.000 0.000 0.008
#> ERR342897     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342833     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342817     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342810     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.004 0.008
#> ERR342867     4  0.0000      0.746 0.000 0.000 0.00 1.000 0.000 0.000
#> ERR342847     5  0.1644      0.792 0.028 0.000 0.00 0.040 0.932 0.000
#> ERR342855     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342851     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342813     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342883     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342856     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342822     2  0.0146      0.897 0.000 0.996 0.00 0.000 0.000 0.004
#> ERR342892     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342842     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342902     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342900     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.008 0.004
#> ERR342888     5  0.4152      0.798 0.032 0.000 0.00 0.000 0.664 0.304
#> ERR342812     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342853     2  0.0520      0.895 0.000 0.984 0.00 0.000 0.008 0.008
#> ERR342866     5  0.2358      0.774 0.028 0.000 0.00 0.056 0.900 0.016
#> ERR342820     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342895     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342825     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342826     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342875     2  0.0146      0.897 0.000 0.996 0.00 0.000 0.000 0.004
#> ERR342834     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342898     4  0.0000      0.746 0.000 0.000 0.00 1.000 0.000 0.000
#> ERR342886     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.008 0.004
#> ERR342838     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342882     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342807     2  0.3464      0.776 0.000 0.688 0.00 0.000 0.000 0.312
#> ERR342873     4  0.4436      0.680 0.028 0.000 0.00 0.680 0.020 0.272
#> ERR342844     4  0.0146      0.746 0.000 0.000 0.00 0.996 0.000 0.004
#> ERR342874     5  0.2763      0.749 0.028 0.000 0.00 0.072 0.876 0.024
#> ERR342893     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342859     3  0.0000      1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> ERR342830     2  0.0405      0.896 0.000 0.988 0.00 0.000 0.008 0.004
#> ERR342880     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272
#> ERR342887     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342854     1  0.0000      1.000 1.000 0.000 0.00 0.000 0.000 0.000
#> ERR342904     4  0.5980      0.624 0.000 0.000 0.06 0.596 0.216 0.128
#> ERR342881     5  0.2917      0.751 0.032 0.000 0.00 0.072 0.868 0.028
#> ERR342858     4  0.4363      0.682 0.024 0.000 0.00 0.684 0.020 0.272

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.

Session info

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#> 
#> Matrix products: default
#> BLAS:   /usr/lib64/libblas.so.3.4.2
#> LAPACK: /usr/lib64/liblapack.so.3.4.2
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
#>  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
#> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] grid      stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] genefilter_1.66.0    ComplexHeatmap_2.3.1 markdown_1.1         knitr_1.26          
#> [5] GetoptLong_0.1.7     cola_1.3.2          
#> 
#> loaded via a namespace (and not attached):
#>  [1] circlize_0.4.8       shape_1.4.4          xfun_0.11            slam_0.1-46         
#>  [5] lattice_0.20-38      splines_3.6.0        colorspace_1.4-1     vctrs_0.2.0         
#>  [9] stats4_3.6.0         blob_1.2.0           XML_3.98-1.20        survival_2.44-1.1   
#> [13] rlang_0.4.2          pillar_1.4.2         DBI_1.0.0            BiocGenerics_0.30.0 
#> [17] bit64_0.9-7          RColorBrewer_1.1-2   matrixStats_0.55.0   stringr_1.4.0       
#> [21] GlobalOptions_0.1.1  evaluate_0.14        memoise_1.1.0        Biobase_2.44.0      
#> [25] IRanges_2.18.3       parallel_3.6.0       AnnotationDbi_1.46.1 highr_0.8           
#> [29] Rcpp_1.0.3           xtable_1.8-4         backports_1.1.5      S4Vectors_0.22.1    
#> [33] annotate_1.62.0      skmeans_0.2-11       bit_1.1-14           microbenchmark_1.4-7
#> [37] brew_1.0-6           impute_1.58.0        rjson_0.2.20         png_0.1-7           
#> [41] digest_0.6.23        stringi_1.4.3        polyclip_1.10-0      clue_0.3-57         
#> [45] tools_3.6.0          bitops_1.0-6         magrittr_1.5         eulerr_6.0.0        
#> [49] RCurl_1.95-4.12      RSQLite_2.1.4        tibble_2.1.3         cluster_2.1.0       
#> [53] crayon_1.3.4         pkgconfig_2.0.3      zeallot_0.1.0        Matrix_1.2-17       
#> [57] xml2_1.2.2           httr_1.4.1           R6_2.4.1             mclust_5.4.5        
#> [61] compiler_3.6.0