Skip to content

Commit 6a57eb2

Browse files
Merge pull request #40 from Kanaries/codex/optimize-readme-with-algorithm-list-and-asyncmode-example
Improve README with algorithm list
2 parents 757c252 + 2ca3489 commit 6a57eb2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,36 @@ const result = knn.predict(testX);
4848
console.log(result);
4949
```
5050

51+
## Supported Algorithms
52+
53+
The library exposes several categories of algorithms:
54+
55+
- **Tree**: `DecisionTreeClassifier`, `DecisionTreeRegressor`
56+
- **Neighbors**: `KNearstNeighbors`, `BallTree`, `KDTree`
57+
- **Linear Models**: `LinearRegression`, `LogisticRegression`
58+
- **Support Vector Machines**: `SVC`, `NuSVC`, `LinearSVC`
59+
- **Naive Bayes**: `BernoulliNB`, `CategoricalNB`
60+
- **Clustering**: `KMeans`, `kmeansPlusPlus`, `DBScan`, `OPTICS`, `MeanShift`, `HDBScan`
61+
- **Decomposition**: `PCA`
62+
- **Manifold Learning**: `SpectralEmbedding`, `MDS`, `LocallyLinearEmbedding`, `TSNE`
63+
- **Ensemble**: `IsolationForest`
64+
- **Utilities**: linear algebra helpers and math functions
65+
66+
## Advanced Features
67+
68+
### asyncMode
69+
70+
`asyncMode` runs a synchronous function in a worker (Web Worker or Node.js worker thread) and returns a `Promise`.
71+
72+
```ts
73+
import { utils } from '@kanaries/ml';
74+
75+
const heavy = (x: number) => x * x;
76+
const runAsync = utils.asyncMode(heavy);
77+
78+
const result = await runAsync(5);
79+
```
80+
5181
## Development
5282

5383
```sh

0 commit comments

Comments
 (0)