# @robzzson/silhouette

> JavaScript implementation of Silhouette Coefficient used for the evaluation of clustering quality

Latest version **0.0.7** (published 2020-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @robzzson/silhouette
pnpm add @robzzson/silhouette
yarn add @robzzson/silhouette
bun add @robzzson/silhouette
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-07-03 |
| First published | 2020-07-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Robert Grodecki |
| Maintainers | robzzson |
| Keywords | silhouette, coefficient, cluster, quality |

## Links

- npm: https://www.npmjs.com/package/@robzzson/silhouette
- Repository: https://github.com/Robzzson/silhouette-coefficient
- Homepage: https://github.com/Robzzson/silhouette-coefficient#readme
- Issues: https://github.com/Robzzson/silhouette-coefficient/issues
- npm.io page: https://npm.io/package/@robzzson/silhouette

## Dependencies (2)

- [ml-distance-matrix](https://npm.io/package/ml-distance-matrix.md) ^2.0.1
- [ml-distance-euclidean](https://npm.io/package/ml-distance-euclidean.md) ^2.0.0

## Recent versions

- 0.0.7 (latest) — 2020-07-03
- 0.0.6 — 2020-07-03
- 0.0.5 — 2020-07-03
- 0.0.4 — 2020-07-03
- 0.0.2 — 2020-07-03
- 0.0.1 — 2020-07-03

## README

# Silhouette Coefficient
This is JavaScript implementation of Silhouette Coefficient used for the evaluation of clustering quality.
The SC takes values from the interval [-1; 1]. The higher the SC the better clustering quality.

## Installation
`npm i @robzzson/silhouette`

## Example
```JavaScript
const silhouette = require('@robzzson/silhouette');

const data = [
  [-9.67867, -4.20271],
  [0.08525, 3.64528],
  [-7.38729, -8.53728],
  [-5.93111, -9.25311],
  [-8.5356, -6.01348],
  [-2.18773, 3.33352],
  [-0.79415, 2.10495],
];
const labels = [1, 0, 2, 2, 1, 0, 0];

let score = silhouette(data, labels);
console.log(score);
```

## License
[MIT](https://github.com/Robzzson/silhouette-coefficient/blob/master/LICENSE)

---
_Source: https://npm.io/package/@robzzson/silhouette · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
