#proc-macro #machine-learning #onehot-encoding #hot-encoding

onehot

One-hot encoding trait and proc macro for auto deriving

1 unstable release

0.1.0 Oct 11, 2020

#696 in Machine learning

25 downloads per month

MIT license

11KB
274 lines

onehot & onehot-derive

Rust crates for one-hot encoding structs and enums. Provides a trait and a proc macro for auto deriving.

Cargo Documentation

Features

  • Generic trait for encoding arbitrary (including composite) types.
  • Proc macro for auto deriving.
  • Optional bitmatrix support, including vertical and horizontal encoding.
  • No unsafe code.

Licence

onehot is licenced under the MIT Licence.


lib.rs:

This crate provides a trait for one-hot encoding of arbitrary structs and enums. You will probably wan't to use the custom derive from onehot-derive most of the time.

It also provides functions for encoding a collection of records into a bitmatrix.

Features

  • derive: enables the derive macros.
  • matrix: enables functions for encoding data into a bitmatrix.

Dependencies

~0–355KB