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:
- a
ClustersEstimatorwith a hierarchical clustering algorithm, - a
NetworkClustersEstimatorwith a hierarchical clustering algorithm, - a
Clustersresult that holds aClustering.Hclust.
It is the bound of the cle argument of plot_dendrogram and plot_clusters, which need a dendrogram.
Related
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
Cluster
Pintores, through the branch thatalgselects.HClustAlgorithm:branch_ordered_hclustunderalg.linkageonVal(branchorder).DBHT:DBHTsoverPandS. The last value that it returns is the clustering.AbstractNonHierarchicalClusteringAlgorithm:optimal_number_clusters, which returns the clustering and the number of clusters together.
Select the number of clusters
kwithoptimal_number_clustersoveronc,resandP. The third branch already haskfrom step 1.Return the
Clustersresult ofres,S,D,Pandk.
Arguments
alg: Clustering algorithm.alg::HClustAlgorithm: Hierarchical clustering ofPwithbranch_ordered_hclust.alg::DBHT: Direct Bubble Hierarchical Tree clustering ofPandSwithDBHTs.alg::AbstractNonHierarchicalClusteringAlgorithm: Non-hierarchical clustering ofPwithoptimal_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,:optimalby default.branch_ordered_hclustandDBHTsstate 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