0.7.1 • Published 3 years ago

@tangramdotdev/tangram v0.7.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Tangram for JavaScript

The Tangram JavaScript package makes it easy to make predictions with your Tangram machine learning model from JavaScript.

Setup

Node.js

$ npm install @tangramdotdev/tangram
let tangram = require("@tangramdotdev/tangram")

Deno

import tangram from "https://js.tangram.dev/deno"

Bundler

If you are using a bundler that supports WebAssembly modules such as Webpack >= 4, you can use the package from npm.

$ npm install @tangramdotdev/tangram
import tangram from "@tangramdotdev/tangram"

Browser

If you are targeting a modern browser with support for ES Modules, WebAssembly, and top-level await, you can import the tangram library from https://js.tangram.dev.

import tangram from "https://js.tangram.dev"

Usage

let model = new tangram.Model("./heart_disease.tangram")

let input = {
	age: 63,
	gender: "male",
	// ...
}

let output = model.predict(input)

For more information, read the docs.

Examples

The source for this package contains a number of examples in the examples directory. Each example has a README.md explaining how to run it.