Skip to content

Latest commit

 

History

History
248 lines (149 loc) · 6.56 KB

File metadata and controls

248 lines (149 loc) · 6.56 KB

@wholebuzz/cluster / Exports / cluster

Module: cluster

Table of contents

Type aliases

Variables

Functions

Type aliases

Cluster

Ƭ Cluster<Item>: Item[]

Type parameters

Name
Item

Defined in: cluster.ts:8


ClusterId

Ƭ ClusterId: number

Defined in: cluster.ts:7


Clusters

Ƭ Clusters<Item>: Cluster<Item>[]

Type parameters

Name
Item

Defined in: cluster.ts:9


ItemClustering

Ƭ ItemClustering: Record<ItemLabel, ClusterId>

Defined in: cluster.ts:10


ItemGraph

Ƭ ItemGraph<Item>: Record<ItemLabel, Set<Item>>

Type parameters

Name
Item

Defined in: cluster.ts:11

Variables

intersect

Const intersect: any

Defined in: cluster.ts:4


merge

Const merge: any

Defined in: cluster.ts:3


overlaps

Const overlaps: any

Defined in: cluster.ts:5

Functions

clustersFromLabels

clustersFromLabels<Item>(data: LabeledDataset<Item>, clustering: ItemClustering, itemFilter?: (item: Item) => Item | null): Clusters<Item>

Splits [LabeledDataset] items into [Clusters] according to clustering.

Type parameters

Name
Item

Parameters

Name Type
data LabeledDataset<Item>
clustering ItemClustering
itemFilter? (item: Item) => Item | null

Returns: Clusters<Item>

Defined in: cluster.ts:16


dbclum

dbclum<Item>(graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>, shouldMerge: (C1: Item[], C2: Item[], graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>) => true, mostBelongs: (P: Item, C1: Item[], C2: Item[], graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>) => true, minPoints?: number): ItemClustering

DBCLUM: Density-based Clustering References: [1]

optional minPoints Minimum number of points to form cluster.

Type parameters

Name
Item

Parameters

Name Type Default value Description
graph ItemGraph<Item> - Record mapping [[News]] [[guid]] to neighbors.
getItemLabel GetItemLabel<Item> - -
shouldMerge (C1: Item[], C2: Item[], graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>) => true - -
mostBelongs (P: Item, C1: Item[], C2: Item[], graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>) => true - -
minPoints number 2 -

Returns: ItemClustering

label Record mapping [[News]] [[`guid]] to cluster label.

Defined in: cluster.ts:113


dbclumscan

dbclumscan<Item>(graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>, minPoints?: number): ItemClustering

Type parameters

Name
Item

Parameters

Name Type Default value
graph ItemGraph<Item> -
getItemLabel GetItemLabel<Item> -
minPoints number 2

Returns: ItemClustering

Defined in: cluster.ts:92


dbscan

dbscan<Item>(graph: ItemGraph<Item>, getItemLabel: GetItemLabel<Item>, minPoints?: number): ItemClustering

Density-based spatial clustering of applications with noise. References: [1]

optional minPoints Minimum number of points to form cluster.

Type parameters

Name
Item

Parameters

Name Type Default value Description
graph ItemGraph<Item> - Mapping of ItemLabel to nearest neighbor Items.
getItemLabel GetItemLabel<Item> - -
minPoints number 2 -

Returns: ItemClustering

label Mapping of ItemLabel to ClusterId.

Defined in: cluster.ts:54


labelsFromClusters

labelsFromClusters<Item>(clusters: Clusters<Item>, getItemLabel: GetItemLabel<Item>): ItemClustering

Builds an ItemLabel to ClusterId map from existing Clusters.

Type parameters

Name
Item

Parameters

Name Type
clusters Clusters<Item>
getItemLabel GetItemLabel<Item>

Returns: ItemClustering

Defined in: cluster.ts:36