HierarchicalClustering Module

Types and nested modules

Type/Module Description

Linker

The linkage criterion determines the distance between sets of observations as a function of the pairwise distances between observations

Cluster<'T>

Binary distance tree

ClusterIndex

Distance<'a>

Euclidean distance of two coordinate arrays

DistanceCaching<'T>

Class for chaching already calculated distances to speed up cluster build

Functions and values

Function or value Description

aggregateClusterBy predicate cluster

Full Usage: aggregateClusterBy predicate cluster

Parameters:
    predicate : float -> int -> bool -
    cluster : Cluster<'T> -

Returns: Cluster<'T list>

Aggregates the subbranches of a node to leafs, if the predicate function taking the distance and the number of subLeafs returns true

predicate : float -> int -> bool

cluster : Cluster<'T>

Returns: Cluster<'T list>

Example

aggregateClusterByDistance distanceCutoff cluster

Full Usage: aggregateClusterByDistance distanceCutoff cluster

Parameters:
    distanceCutoff : float -
    cluster : Cluster<'T> -

Returns: Cluster<'T list>

Aggregates the subbranches of a node to leafs, if the distance between them is smaller than the given distanceCutoff

distanceCutoff : float

cluster : Cluster<'T>

Returns: Cluster<'T list>

Example

createCluster id dist left right

Full Usage: createCluster id dist left right

Parameters:
Returns: Cluster<'T>

Create a cluster Node containing the two given subbranches

id : int
dist : float
left : Cluster<'T>
right : Cluster<'T>
Returns: Cluster<'T>

createClusterValue id value

Full Usage: createClusterValue id value

Parameters:
    id : int -
    value : 'T -

Returns: Cluster<'T>

Create a cluster Leaf

id : int

value : 'T

Returns: Cluster<'T>

Example

cutHClust desiredNumber clusterTree

Full Usage: cutHClust desiredNumber clusterTree

Parameters:
    desiredNumber : int -
    clusterTree : Cluster<float array> -

Returns: Cluster<float array> list list

cuts tree in chosen amount of clusters

desiredNumber : int

clusterTree : Cluster<float array>

Returns: Cluster<float array> list list

Example

euclidean a1 a2

Full Usage: euclidean a1 a2

Parameters:
    a1 : ^a array
    a2 : ^a array

Returns: float
Modifiers: inline
a1 : ^a array
a2 : ^a array
Returns: float

flattenHClust clusterTree

Full Usage: flattenHClust clusterTree

Parameters:
    clusterTree : Cluster<float array>

Returns: Cluster<float array> list
clusterTree : Cluster<float array>
Returns: Cluster<float array> list

fromFileWithSep separator filePath

Full Usage: fromFileWithSep separator filePath

Parameters:
    separator : char
    filePath : string

Returns: seq<string[]>
separator : char
filePath : string
Returns: seq<string[]>

generate distance linker data

Full Usage: generate distance linker data

Parameters:
Returns: Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>

Builds a hierarchy of clusters of data containing cluster labels

distance : Distance<float[]>
linker : LancWilliamsLinker
data : float[] array
Returns: Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>

get clusterTree

Full Usage: get clusterTree

Parameters:
    clusterTree : Cluster<float array> -

Returns: seq<float * int * int>

Converts clusters into string seq

clusterTree : Cluster<float array>

Returns: seq<float * int * int>

Example

getClusterId c

Full Usage: getClusterId c

Parameters:
Returns: int

Returns cluster Id

c : Cluster<'T>

Returns: int

Example

getClusterMemberCount c

Full Usage: getClusterMemberCount c

Parameters:
Returns: int

Returns cluster member count

c : Cluster<'T>

Returns: int

Example

getClusterMemberLabels cluster

Full Usage: getClusterMemberLabels cluster

Parameters:
Returns: int list list
cluster : Cluster<'a>
Returns: int list list

getDistance cluster

Full Usage: getDistance cluster

Parameters:
Returns: float
cluster : Cluster<'a>
Returns: float

getDistancesAndLabels cluster

Full Usage: getDistancesAndLabels cluster

Parameters:
Returns: (int * float) list

Returns a list of the distances between the subclusters

cluster : Cluster<'T>

Returns: (int * float) list

Example

getDistancesOfCluster cluster

Full Usage: getDistancesOfCluster cluster

Parameters:
Returns: float list

Returns a list of the distances between the subclusters

cluster : Cluster<'T>

Returns: float list

Example

getLeafNamesOfCluster cluster

Full Usage: getLeafNamesOfCluster cluster

Parameters:
Returns: int list

Returns a list of the leaf names

cluster : Cluster<'T>

Returns: int list

Example

getLeafsOfCluster cluster

Full Usage: getLeafsOfCluster cluster

Parameters:
Returns: 'T list

Returns a list of the leaf names

cluster : Cluster<'T>

Returns: 'T list

Example

getLeftChild cluster

Full Usage: getLeftChild cluster

Parameters:
Returns: Cluster<'a>
cluster : Cluster<'a>
Returns: Cluster<'a>

getRightChild cluster

Full Usage: getRightChild cluster

Parameters:
Returns: Cluster<'a>
cluster : Cluster<'a>
Returns: Cluster<'a>

getWithClusterName clusterTree

Full Usage: getWithClusterName clusterTree

Parameters:
    clusterTree : Cluster<float array>

Returns: seq<int * float * int * int>
clusterTree : Cluster<float array>
Returns: seq<int * float * int * int>

initPairsNR cachedDist arr

Full Usage: initPairsNR cachedDist arr

Parameters:
Returns: Dictionary<Cluster<float[]>, FastPriorityQueue<ClusterIndex>>
cachedDist : DistanceCaching<float[]>
arr : float[] array
Returns: Dictionary<Cluster<float[]>, FastPriorityQueue<ClusterIndex>>

mapClusterLeaftags mapF cluster

Full Usage: mapClusterLeaftags mapF cluster

Parameters:
    mapF : 'T -> 'U -
    cluster : Cluster<'T> -

Returns: Cluster<'U>

Maps the tags of the leafs of the cluster by applying a given mapping function

mapF : 'T -> 'U

cluster : Cluster<'T>

Returns: Cluster<'U>

Example

minDequeue source

Full Usage: minDequeue source

Parameters:
Returns: KeyValuePair<Cluster<float array>, FastPriorityQueue<ClusterIndex>>
source : Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>
Returns: KeyValuePair<Cluster<float array>, FastPriorityQueue<ClusterIndex>>

printHClust clusterTree

Full Usage: printHClust clusterTree

Parameters:
    clusterTree : Cluster<float array> -

Returns: seq<string>

Converts clusters into string seq

clusterTree : Cluster<float array>

Returns: seq<string>

Example

tryGetLeafValue c

Full Usage: tryGetLeafValue c

Parameters:
Returns: 'T option

Returns cleaf value

c : Cluster<'T>

Returns: 'T option

Example

usedDistancesAndLabels cluster

Full Usage: usedDistancesAndLabels cluster

Parameters:
Returns: (float * int list) list
cluster : Cluster<'a>
Returns: (float * int list) list

whileLoop cachedDist source countIndex

Full Usage: whileLoop cachedDist source countIndex

Parameters:
Returns: Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>
cachedDist : DistanceCaching<float[]>
source : Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>
countIndex : int
Returns: Dictionary<Cluster<float array>, FastPriorityQueue<ClusterIndex>>