Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netsaur/packages/utilities/mod.ts

Powerful machine learning, accelerated by WebGPU
Go to Latest
import * as netsaur from "https://deno.land/x/netsaur@0.4.0-patch/packages/utilities/mod.ts";

Image-related utilities for machine learning.

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.

Interfaces

nDArray type

The base type implemented by Tensor

Type Aliases

The base type implemented by Matrix

Order of the tensor

An array with n items