Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libsvm-wasm

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libsvm-wasm

## Brief This is a wasm export for [`libsvm`](https://github.com/cjlin1/libsvm) It allows you to directly run & train svm model in js env without installing any non-js dependency.

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

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

  • prereq: emscripten
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

FAQs

Package last updated on 26 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc