🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign 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

ts3.6
ts3.7
Source
npmnpm
Version
0.11.2
Version published
Weekly downloads
4.7K
14.68%
Maintainers
1
Weekly downloads
 
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 definitions for skmeans 0.11
// Project: https://github.com/solzimer/skmeans
// Definitions by:  Adam Zerella <https://github.com/adamzerella>
// 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: Fri, 18 Jun 2021 11:31:15 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Adam Zerella.

FAQs

Package last updated on 18 Jun 2021

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