record-encode: Generic encoding of records

[ bsd3, data, data-mining, data-science, deprecated, library, machine-learning ] [ Propose Tags ]
Deprecated. in favor of heidi

Generic encoding of records. It currently provides a single, polymorphic function to encode sum types (i.e. categorical variables) as one-hot vectors.

[Skip to Readme]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],, 0.2, 0.2.1, 0.2.2, 0.2.3
Dependencies base (>=4.7 && <5), generics-sop, vector [details]
License BSD-3-Clause
Copyright 2018 Marco Zocca
Author Marco Zocca
Maintainer ocramz fripost org
Category Data, Data Science, Data Mining, Machine Learning
Home page
Source repo head: git clone
Uploaded by ocramz at 2018-08-19T17:57:58Z
Distributions NixOS:0.2.3
Downloads 2462 total (30 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-08-19 [all 1 reports]

Readme for record-encode-

[back to package description]


Build Status

This library provides generic machinery to encode values of some algebraic type as points in a vector space.

Analyzing datasets that have one or more categorical variables (that is, values having a sum type) typically requires a series of boilerplate transformations, and the encodeOneHot function provided here does precisely that.

Usage example

    {-# language DeriveGeneric -#}

    import qualified GHC.Generics as G
    import qualified Generics.SOP as SOP
    import Data.Record.Encode

    data X = A | B | C deriving (G.Generic)
    instance SOP.Generic X
    > encodeOneHot B


Gagandeep Bhatia (@gagandeepb) for his GSoC '18 work on Frames-beam, Mark Karpov (@mrkkrp) for his Template Haskell tutorial, Anthony Cowley (@acowley) for vinyl and Frames, @mniip on Freenode #haskell for helping me better understand what can be done with generic programming.