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

x/netsaur/packages/utilities/src/encoding/mod.ts>OneHotEncoder

Powerful Powerful Machine Learning library with GPU, CPU and WASM backends
Latest
class OneHotEncoder
Re-export
import { OneHotEncoder } from "https://deno.land/x/netsaur@0.4.2/packages/utilities/src/encoding/mod.ts";

Convert an array of indices into one-hot encoded vectors.

Constructors

new
OneHotEncoder(mappingSize: number)

Properties

mappingSize: number

Size of one-hot encoded vectors.

Methods

transform<DT extends DataType>(targets: number[], dType: DT): Matrix<DT>

One-hot encoding of values

untransform<DT extends DataType>(data: MatrixLike<DT>): number[]