Skip to main content

Built and signed on GitHub Actions

Machine Learning utilities for TypeScript

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.7.5)

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Machine Learning utilities for TypeScript.

Examples

Example 1

const data = [
  "twinkle twinkle little star",
  "How I wonder what you are",
  "up above the world so high",
  "like a diamond in the sky",
];

// Clean the text
const cleaner = new TextCleaner({
  lowercase: true,
  stripHtml: true,
  stripNewlines: true,
  normalizeWhiteSpaces: true,
});
x = cleaner.clean(x);

// Tokenize the text
const tokenizer = new SplitTokenizer();
tokenizer.fit(x);
const x_tokens = tokenizer.transform(x);

// Vectorize the tokens
const vectorizer = new CountVectorizer(tokenizer.vocabulary.size);
const x_vec = vectorizer.transform(x_tokens, "f32");

// Apply Tf-Idf transformation
const transformer = new TfIdfTransformer();
console.log(transformer.fit(x_vec).transform(x_vec));
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@lala/appraisal

Import symbol

import * as appraisal from "@lala/appraisal";

---- OR ----

Import directly with a jsr specifier

import * as appraisal from "jsr:@lala/appraisal";

Add Package

npx jsr add @lala/appraisal

Import symbol

import * as appraisal from "@lala/appraisal";

Add Package

yarn dlx jsr add @lala/appraisal

Import symbol

import * as appraisal from "@lala/appraisal";

Add Package

pnpm dlx jsr add @lala/appraisal

Import symbol

import * as appraisal from "@lala/appraisal";

Add Package

bunx jsr add @lala/appraisal

Import symbol

import * as appraisal from "@lala/appraisal";