Skip to content

WenheLI/libsvm-wasm

Repository files navigation

libsvm-wasm

Brief

This is a wasm export for libsvm It allows you to directly run & train svm model in js env without installing any non-js dependency.

Build

git submodule init
git submodule update
make

After this command, you will get the wasm in dist folder.

Usage

Note: No bundle support for now. You may want to build on yourself or use ts-node to write a ts script.

import {SVM} from './src/libsvm';

const svm = new SVM();
await svm.init()
const data = [[-1, -1], [1, 1], [2, 2], [-2, -2]]
const label = [-1, 1, 1, -1];

svm.feedSamples(data, label);
await svm.train();
svm.predict([3, 3]);

Roadmap

  • Building & Bundling & Packaging
  • Benchmark V.S. native
  • More API
  • SIMD operation to enhance performance
  • Store Model using native fs API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages