UNPKG

@mojir/lits

Version:

Lits is a pure functional programming language implemented in TypeScript

9 lines (8 loc) 322 B
/** * Calculates the Shannon entropy of a vector. * Entropy measures the amount of uncertainty or randomness in the data. * * @param vector - An array of values to calculate entropy for * @returns The entropy value (in bits) or 0 for empty arrays */ export declare function calculateEntropy<T>(vector: T[]): number;