Skip to main content

A JS/TS implementation of the k-means and k-means++ clustering algorithm.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
5 hours ago (2.2.0)
class KMPP

KMPP class for performing k-means and k-means++ clustering.

Constructors

new
KMPP(points: I_points_data)

Properties

range: Lazy<Range>

Methods

k_means(k: number): Result | Points

Performs k-means clustering on the input data points.

k_means_pp(k: number): Result | Points

Performs k-means++ clustering on the input data points.

Add Package

deno add @ppz/k-means-pp

Import symbol

import { KMPP } from "@ppz/k-means-pp";

---- OR ----

Import directly with a jsr specifier

import { KMPP } from "jsr:@ppz/k-means-pp";

Add Package

npx jsr add @ppz/k-means-pp

Import symbol

import { KMPP } from "@ppz/k-means-pp";

Add Package

yarn dlx jsr add @ppz/k-means-pp

Import symbol

import { KMPP } from "@ppz/k-means-pp";

Add Package

pnpm dlx jsr add @ppz/k-means-pp

Import symbol

import { KMPP } from "@ppz/k-means-pp";

Add Package

bunx jsr add @ppz/k-means-pp

Import symbol

import { KMPP } from "@ppz/k-means-pp";