0.11.7 • Published 7 months ago

@types/skmeans v0.11.7

Weekly downloads
2,147
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/skmeans

Summary

This package contains type definitions for skmeans (https://github.com/solzimer/skmeans).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/skmeans.

index.d.ts

// Type definitions for skmeans 0.11
// Project: https://github.com/solzimer/skmeans
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

type CentroidValues = number[] | number[][] | 'kmrand' | 'kmpp' | null;

interface Data {
    it: number;
    k: number;
    centroids: number[] | number[][];
    idxs: number[];
    test: (x: number, point?: (x1: number, x2: number) => number) => void;
}

/**
 * Calculates unidimiensional and multidimensional k-means clustering on data.
 *
 * @param data Unidimiensional or multidimensional array of values to be clustered.
 * @param k Number of clusters.
 * @param centroids Initial centroid values.
 * @param iterations Maximum number of iterations. If not provided, it will be set to 10000.
 * @param distance Custom distance function. Takes two points as arguments and returns a scalar number.
 */
declare function skmeans(
    data: number[] | number[][],
    k: number,
    centroids?: CentroidValues,
    iterations?: number | null,
    distance?: (x: number, y: number) => number
): Data;

export = skmeans;

Additional Details

  • Last updated: Thu, 23 Dec 2021 23:35:51 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by DefinitelyTyped.

0.11.5

8 months ago

0.11.6

7 months ago

0.11.7

7 months ago

0.11.4

1 year ago

0.11.3

2 years ago

0.11.2

3 years ago

0.11.1

3 years ago

0.11.0

4 years ago