Developer Index

This page lists the types and functions that are internal to the ClusterValidityIndices.jl package. Because they are not part of the public API, these names might change relatively frequently between versions and so should not be relied upon.

All internal names are listed in the Index, and each of these entries link to the docstrings in the Docs section.

Index

This section contains a list of internal names that link to their corresponding Documentation.

Methods

Types

Constants

    Docs

    Documentation for all internal names are listed below.

    ClusterValidityIndices.CVIElasticParamsType
    CVIElasticParams(
    
    ) -> ClusterValidityIndices.CVIElasticParams
    CVIElasticParams(
        dim::Integer
    ) -> ClusterValidityIndices.CVIElasticParams
    CVIElasticParams(
        dim::Integer,
        n_clusters::Integer
    ) -> ClusterValidityIndices.CVIElasticParams
    

    Summary

    Constructor for the CVIElasticParams struct, using the dimension to prime the 2-D elastic matrices.

    The empty constructor should only be used when initializing empty CVIs before setup. CVI setup should instead create this struct with a specified dimension dim, and batch updates can set both dim and n_clusters immediately.

    Arguments

    • dim::Integer: the dimension to use for the first dimension of the 2-D matrices.
    • n_clusters::Integer: optional, the number of clusters if known. Default 0.

    Method List / Definition Locations

    CVIElasticParams()
    CVIElasticParams(dim)
    CVIElasticParams(dim, n_clusters)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:135.

    source
    ClusterValidityIndices.CVIElasticParamsType
    struct CVIElasticParams

    Summary

    Container for the common elastic parameters of CVIs.

    This is defined as an immutable struct because the

    Fields

    • n::Vector{Int64}: Number of samples per cluster, size of cvi.n_clusters.
    • CP::Vector{Float64}: Compactness of each cluster, size of cvi.n_clusters.
    • v::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}: Prototype/centroid of each cluster, size of (cvi.dim, cvi.n_clusters).
    • G::ElasticArrays.ElasticMatrix{Float64, V} where V<:DenseVector{Float64}: Compacness parameter G, size of (cvi.dim, cvi.n_clusters)
    • SEP::Vector{Float64}: The measure of separation, size of cvi.n_clusters.
    source
    ClusterValidityIndices.CVIExpandTensorType

    CVIExpandTensor

    Description

    The type of tensor used by the ClusterValidityIndices.jl package, used to configure array growth behavior.

    Though perhaps an abuse of notation, CVIExpandTensor is defined as only a 3-D array here due to the frequent use of 3-dimensional arrays in the package. This maintains that the Julia Array type allows multiple orders (i.e., 3-D and onwards).

    source
    ClusterValidityIndices.CVIParamConfigType
    struct CVIParamConfig

    Summary

    An object containing all of the information about a single type of CVI parameter.

    This includes symbolic pointers to its related functions, the type of the parameter, its shape, and the subsequent element type for expansion.

    Fields

    • update::Symbol

    • add::Symbol

    • expand::Symbol

    • type::Type

    • shape::Int64

    • el_type::Type

    • to_expand::Bool

    • monocyclic::Bool

    source
    ClusterValidityIndices.add_cluster!Method
    add_cluster!(
        cvi::CVI,
        sample::AbstractVector{T} where T<:Real;
        alt_CP
    )
    

    Summary

    Adds a cluster to the a CVI, updating the count and elastic parameters accordingly.

    Arguments

    • cvi::CVI: the CVI to add a cluster to.
    • sample::RealVector: the feature sample to base the new cluster off of.
    • alt_CP::Bool: optional, alternate compactness definition.

    Method List / Definition Locations

    add_cluster!(cvi, sample; alt_CP)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:288.

    source
    ClusterValidityIndices.evaluate!Method

    Summary

    Compute the criterion value of the CVI.

    After computation, the resulting criterion value can be extracted from cvi.criterion_value. The criterion value is a function of the CVI/ICVI internal parameters, so at least two classes (i.e., unique labels) must be presented to the CVI in param_inc! or param_batch! before a non-zero value is returned.

    Arguments

    • cvi::CVI: the stateful information of the CVI/ICVI to use for computing the criterion value.

    Examples

    julia> my_cvi = CH()
    julia> data = load_some_data()
    julia> labels = my_cluster_algorithm(data)
    julia> param_batch!(my_cvi, data, labels)
    julia> evaluate!(my_cvi)
    julia> my_criterion_value = my_cvi.criterion_value

    Method List / Definition Locations

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/CH.jl:125.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/DB.jl:164.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD43.jl:164.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD53.jl:154.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/PS.jl:129.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/WB.jl:129.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/XB.jl:152.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/cSIL.jl:196.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/rCIP.jl:204.

    evaluate!(cvi)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/base_cvi.jl:151.

    source
    ClusterValidityIndices.expand_params!Method
    expand_params!(
        params::ClusterValidityIndices.CVIElasticParams,
        n::Integer,
        CP::Float64,
        v::AbstractVector{T} where T<:Real,
        G::AbstractVector{T} where T<:Real
    )
    

    Summary

    Expands the CVIElasticParams struct with the provided CVI parameters.

    Arguments

    • params::CVIElasticParams: the CVI elastic parameters to expand.
    • n::Integer: the sample count of the new cluster.
    • CP::Float: the compactness of the new cluster.
    • v::RealVector: the prototype of the new cluster.
    • G::RealVector:

    Method List / Definition Locations

    expand_params!(params, n, CP, v, G)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:260.

    source
    ClusterValidityIndices.expand_strategy_1d!Method
    expand_strategy_1d!(cvi_vec::Vector, n_new::Real) -> Vector
    

    Summary

    Implements the strategy for expanding a 1-D CVIExpandVector with an arbitrary number.

    Arguments

    • cvi_vec::CVIExpandVector: the 1-D vector to append a number to.
    • n_new::Real: a floating point or integer number to append to the vector.

    Method List / Definition Locations

    expand_strategy_1d!(cvi_vec, n_new)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:221.

    source
    ClusterValidityIndices.expand_strategy_2d!Method
    expand_strategy_2d!(
        cvi_mat::ElasticArrays.ElasticMatrix{T} where T,
        v_new::AbstractVector{T} where T<:Real
    ) -> ElasticArrays.ElasticMatrix{T} where T
    

    Summary

    Implements the strategy for expanding a 2-D CVIExpandMatrix with a vector on the last dimension.

    Arguments

    • mat::CVIExpandMatrix: the 2-D matrix to append a vector to its last dimension.
    • v_new::RealVector: the 1-D vector to append to the matrix.

    Method List / Definition Locations

    expand_strategy_2d!(cvi_mat, v_new)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:233.

    source
    ClusterValidityIndices.expand_strategy_3d!Method
    expand_strategy_3d!(
        cvi_mat::ElasticArrays.ElasticArray{T, 3, M, V} where {T<:Real, M, V<:DenseVector{T}},
        mat_new::AbstractMatrix{T} where T<:Real
    ) -> ElasticArrays.ElasticArray{T, 3, M, V} where {T<:Real, M, V<:DenseVector{T}}
    

    Summary

    Implements the strategy for expanding a 3-D CVI array with a 2-D matrix.

    Arguments

    • cvi_mat::CVIExpandTensor: the 3-D CVI array to append to.
    • mat_new::RealMatrix: the 2-D matrix to append to the CVI array.

    Method List / Definition Locations

    expand_strategy_3d!(cvi_mat, mat_new)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:245.

    source
    ClusterValidityIndices.get_internal_label!Method
    get_internal_label!(
        label_map::Dict{Int64, Int64},
        label::Integer
    ) -> Int64
    

    Summary

    Get the internal label and update the label map if the label is new.

    Arguments

    • label_map::LabelMap: label map to extract the internal label from.
    • label::Integer: the external label that corresponds to an internal label.

    Method List / Definition Locations

    get_internal_label!(label_map, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:450.

    source
    ClusterValidityIndices.init_cvi_update!Method
    init_cvi_update!(
        cvi::CVI,
        data::AbstractMatrix{T} where T<:Real,
        labels::AbstractVector{T} where T<:Integer
    ) -> Any
    

    Summary

    Initializes batch CVI updates.

    Arguments

    • cvi::CVI: the CVI to prime for batch update.
    • data::RealMatrix: the data to use for batch initialization.
    • labels::IntegerVector: the labels corresponding to the provided data.

    Method List / Definition Locations

    init_cvi_update!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:201.

    source
    ClusterValidityIndices.init_cvi_update!Method
    init_cvi_update!(
        cvi::CVI,
        sample::AbstractVector{T} where T<:Real,
        label::Integer
    ) -> Int64
    

    Summary

    Initializes incremental CVI updates.

    Arguments

    • cvi::CVI: the CVI to initialize incremental evaluation for.
    • sample::RealVector: the sample used for the incremental update.
    • label::Integer: the label provided with the sample for the incremental update.

    Method List / Definition Locations

    init_cvi_update!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/base_cvi.jl:117.

    init_cvi_update!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:173.

    source
    ClusterValidityIndices.param_batch!Method

    Summary

    Compute the CVI parameters in batch.

    This method updates only the internal parameters of the CVI algorithm in batch. When the criterion value itself is needed, use evaluate! and extract it from cvi.criterion_value.

    Arguments

    • cvi::CVI: the stateful information of the CVI/ICVI algorithm.
    • data::RealMatrix: a matrix of data where rows are features and columns are samples, used in the external clustering algorithm.
    • labels::IntegerVector: a vector of labels that the external clustering algorithm prescribed to each column in data.

    Examples

    julia> my_cvi = CH()
    julia> data = load_some_data()
    julia> labels = my_cluster_algorithm(data)
    julia> param_batch!(my_cvi, data, labels)

    Method List / Definition Locations

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/CH.jl:111.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/DB.jl:136.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD43.jl:142.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD53.jl:132.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/PS.jl:111.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/WB.jl:115.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/XB.jl:130.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/cSIL.jl:171.

    param_batch!(cvi, data, labels)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/rCIP.jl:168.

    source
    ClusterValidityIndices.param_inc!Method

    Summary

    Compute the CVI parameters incrementally.

    This method updates only internal parameters of the ICVI algorithm incrementally. When the criterion value itself is needed, use evaluate! and extract it from cvi.criterion_value.

    Arguments

    • cvi::CVI: the stateful information of the CVI/ICVI algorithm.
    • sample::RealVector: a vector of features used in the external clustering algorithm.
    • label::Integer: the label that the external clustering algorithm prescribed to the sample.

    Examples

    julia> my_cvi = CH()
    julia> data = load_some_data()
    julia> labels = my_cluster_algorithm(data)
    julia> param_inc!(my_cvi, data[:, 1], labels[1])

    Method List / Definition Locations

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/CH.jl:77.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/DB.jl:78.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD43.jl:82.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/GD53.jl:82.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/PS.jl:71.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/WB.jl:82.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/XB.jl:76.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/cSIL.jl:78.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/CVI/rCIP.jl:103.

    param_inc!(cvi, sample, label)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/base_cvi.jl:138.

    source
    ClusterValidityIndices.setup!Method
    setup!(
        cvi::CVI,
        sample::AbstractVector{T} where T<:Real
    ) -> ClusterValidityIndices.CVIElasticParams
    

    Summary

    Internal method, sets up the CVI based upon the type of the provided sample.

    Arguments

    • cvi::CVI: the CVI to setup to the correct dimensions.
    • sample::RealVector: The sample to use as a basis for setting up the CVI.

    Method List / Definition Locations

    setup!(cvi, sample)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:337.

    source
    ClusterValidityIndices.update_meanMethod
    update_mean(
        old_mean::AbstractVector{T} where T<:Real,
        sample::AbstractVector{T} where T<:Real,
        n_new::Integer
    ) -> Any
    

    Summary

    Returns an updated mean vector with a new vector and adjusted count of samples.

    Arguments

    • old_mean::RealVector: the old mean to update incrementally.
    • sample::RealVector: the sample to use for updating the mean.
    • n_new::Integer: the new sample count to use for the updated average.

    Method List / Definition Locations

    update_mean(old_mean, sample, n_new)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:157.

    source
    ClusterValidityIndices.update_params!Method
    update_params!(
        params::ClusterValidityIndices.CVIElasticParams,
        index::Integer,
        n::Integer,
        CP::Float64,
        v::AbstractVector{T} where T<:Real,
        G::AbstractVector{T} where T<:Real
    )
    

    Summary

    Updates the elastic CVI parameters in place at index.

    Arguments

    • params::CVIElasticParams: the CVI elastic parameters to update in place.
    • index::Integer: the cluster index to update for all elastic parameters.
    • n::Integer: the new cluster count at the index.
    • CP::Float: the new compactness at the index.
    • v::RealVector: the new prototype at the index.
    • G::RealVector:

    Method List / Definition Locations

    update_params!(params, index, n, CP, v, G)

    defined at /home/runner/work/ClusterValidityIndices.jl/ClusterValidityIndices.jl/src/common.jl:313.

    source