@wholebuzz/cluster / Exports / math
• Const
objectCosineSimilarity: any
Defined in: math.ts:2
• Const
vectorCosineSimilarity: any
Defined in: math.ts:1
▸ isOneDimensional(arr
: number[] | number[][]): arr is number[]
Name | Type |
---|---|
arr |
number[] | number[][] |
Returns: arr is number[]
Defined in: math.ts:4
▸ mahalanobisDistance2(mean
: number[], diagCovar
: number[], vector
: number[]): number
Computes Mahalanobis distance squared from mean to vector, given a diagonal covariance matrix. This is the primary term in Guassian PDF. References: [1]
Name | Type | Description |
---|---|---|
mean |
number[] | The center to measure distance from. |
diagCovar |
number[] | Array specifying the diagonal of the covariance matrix. |
vector |
number[] | The query vector to measure distance to. |
Returns: number
Defined in: math.ts:37
▸ maxIndex(arr
: number[]): number
Name | Type |
---|---|
arr |
number[] |
Returns: number
Defined in: math.ts:8
▸ Const
maxKey(obj
: Record<string, number>): string
Name | Type |
---|---|
obj |
Record<string, number> |
Returns: string
Defined in: math.ts:12
▸ newPermutation(d
: number): bigint[]
Creates a random permutation of the integers from 0 to d - 1.
Name | Type | Description |
---|---|---|
d |
number | The number of integers in the set. |
Returns: bigint[]
Defined in: math.ts:50
▸ objectMean(arr
: Record<string, number>[] | number[][]): Record<string, number>
Name | Type |
---|---|
arr |
Record<string, number>[] | number[][] |
Returns: Record<string, number>
Defined in: math.ts:22
▸ softMax(values
: number[]): number[]
Name | Type |
---|---|
values |
number[] |
Returns: number[]
Defined in: math.ts:15