Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@types/skmeans

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/skmeans

TypeScript definitions for skmeans

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
Source
npmnpm
Version
0.11.7
Version published
Maintainers
1
Created
Source

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 CentroidValues<TPoint extends number | number[]> = TPoint[] | "kmrand" | "kmpp";

interface DataResult<TPoint extends number | number[]> {
    it: number;
    k: number;
    centroids: TPoint[];
    idxs: number[];
    test: (x: TPoint, distance?: (x: TPoint, y: TPoint) => 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<TPoint extends number | number[]>(
    data: TPoint[],
    k: number,
    centroids?: CentroidValues<TPoint> | null,
    iterations?: number | null,
    distance?: (x: TPoint, y: TPoint) => number | null,
): DataResult<TPoint>;

export = skmeans;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by .

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts