MlbendPreprocess.one_hot: def of mlbend-preprocess@0.1.0.0 Import: import mlbend-preprocess@0.1.0.0/main.bend as MlbendPreprocess Lines 272-276 of mlbend-preprocess@0.1.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-preprocess@0.1.0.0/main.bend&start_line=272&end_line=276 import Base import bend-ml-tensor@0.1.0.0/main.bend as T # The one-hot encoding: a row of k numbers for every label, with a one # in the column of the label. It is Nothing when there are not exactly # n labels. def one_hot(+k: Nat, +n: Nat, labels: List<&2, Nat>) -> Maybe<&2, T.Mat>: T.Mat.of(n, k, one_hot_rows(labels, k)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor@0.1.2.0/main.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor@0.1.2.0/main.bend&name=Mat.of https://jend.leeeet.dev/definition.txt?path=mlbend-preprocess@0.1.0.0/main.bend&name=one_hot_rows