Phylogeny Clustering: private API

PortfolioOptimisers.HClE_HCl — Type
const HClE_HCl = Union{ClustersEstimator{<:Any, <:Any,
                                           <:AbstractHierarchicalClusteringAlgorithm,
                                           <:Any},
                       Clusters{<:Clustering.Hclust, <:Any, <:Any, <:Any},
                       NetworkClustersEstimator{<:Any,
                                              <:AbstractHierarchicalClusteringAlgorithm}}

Union of the hierarchical clustering estimators and results.

It matches three types:

It is the bound of the cle argument of plot_dendrogram and plot_clusters, which need a dendrogram.

Related

source
PortfolioOptimisers._clusterise — Method
_clusterise(
    alg::HClustAlgorithm,
    onc::AbstractOptimalNumberClustersEstimator,
    S::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
    D::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
    P::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}};
    branchorder
) -> Clusters{Clustering.Hclust{T}, var"#s185", var"#s1851", <:AbstractMatrix{var"#s166"}, <:Integer} where {T<:Real, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s185"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}

Cluster a matrix of pseudo-distances with alg, and return a Clusters result.

The type of alg selects the clustering routine, and onc selects the number of clusters. Both clusterise methods of a NetworkClustersEstimator call this function.

Algorithm

  1. Cluster P into res, through the branch that alg selects.

  2. Select the number of clusters k with optimal_number_clusters over onc, res and P. The third branch already has k from step 1.

  3. Return the Clusters result of res, S, D, P and k.

Arguments

  • alg: Clustering algorithm.

    • alg::HClustAlgorithm: Hierarchical clustering of P with branch_ordered_hclust.
    • alg::DBHT: Direct Bubble Hierarchical Tree clustering of P and S with DBHTs.
    • alg::AbstractNonHierarchicalClusteringAlgorithm: Non-hierarchical clustering of P with optimal_number_clusters.
  • onc: Estimator of the optimal number of clusters.

  • S: Similarity matrix.

  • D: Distance matrix.

  • P::MatNum: Symmetric matrix of pseudo-distances from the network.

  • branchorder: Order method for the dendrogram branches, :optimal by default. branch_ordered_hclust and DBHTs state what each value does.

Returns

  • clr::Clusters: Clustering result. It holds the clustering, the similarity matrix, the distance matrix, the matrix of pseudo-distances and the number of clusters.

Related

source