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

x/vectorizer/src/encoding/mod.ts>CategoricalEncoder

Feature Extraction and Feature Selection in TypeScript
Go to Latest
class CategoricalEncoder
import { CategoricalEncoder } from "https://deno.land/x/vectorizer@v0.3.7/src/encoding/mod.ts";

Constructors

new
CategoricalEncoder()

Properties

mapping: Map<T, number>

Map categories to indices

Methods

fit(targets: T[]): this

Construct a mapping from a given set of text.

getOg(data: number): T | undefined
transform<DT extends DataType>(targets: T[], dType: DT): Matrix<DT>

One-hot encoding of categorical values

untransform<DT extends DataType>(data: Matrix<DT>): T[]

Static Methods

fromSoftmax<DT extends DataType>(data: Matrix<DT>): Matrix<DT>

Convert softmax outputs into categorical outputs This method mutates the original matrix.