
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@types/skmeans
Advanced tools
npm install --save @types/skmeans
This package contains type definitions for skmeans (https://github.com/solzimer/skmeans).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/skmeans.
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;
These definitions were written by .
FAQs
TypeScript definitions for skmeans
We found that @types/skmeans demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.