Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/vectorizer/mod.ts

Machine Learning utilities for TypeScript
Latest
import * as vectorizer from "https://deno.land/x/vectorizer@v0.7.5/mod.ts";

Encoding data into different representations.

Classes

Convert class labels into categorical variables (one-hot)

A report with metrics for classification results

Confusion matrix for the result.

Convert tokens into vectors based on term frequency

Class for 2D Arrays. This is not akin to a mathematical Matrix (a collection of column vectors). This is a collection of row vectors. A special case of Tensor for 2D data.

Convert tokens into vectors based on term frequency

Tokenize text based on separator (whitespace)

A Tensor of order O.

Simple text cleaner

TODO

Convert tf features (CountVectorizer) into tf-idf features.

Variables

The fraction of positives that were predicted correctly

Functions

The fraction of predictions that were correct

Compute Cohen's Kappa to find Agreement

Extract colors from an image.

Compute F1 Score

Get a histogram of frequency of colors.

Mean Absolute Error

Mean Square Error

Extract patches from a 2d image

The fraction of "positive" predictions that were actually positive

Function for quick cleaning of text

R2 Score for regression

Root Mean Square Error

The fraction of positives that were predicted correctly

The fraction of negatives that were predicted correctly

Generate a normal random variate.

Generate a normally distributed array.

Get n evenly distributed numbers in a range.

Rearrange characters in a string randomly.

Get random number from range

Get an array of numbers between a given range, incremented by a step.

Shuffle a given array in-place.

Split arrays by their first axis

Remove duplicate values in an array. Uses a strict = for identifying duplicates.

Roll one from an array of weighted choices.

Type Aliases

The base type implemented by Matrix

nDArray type

Order of the tensor

An array with n items

The base type implemented by Tensor