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. Provides a single function and two typeclasses to encode values of sum types as one-hot vectors.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 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
Home page https://github.com/ocramz/record-encode
Source repo head: git clone https://github.com/ocramz/record-encode
Uploaded by ocramz at 2018-08-19T17:48:54Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2646 total (19 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-0.1.0.0

[back to package description]

record-encode

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 (== 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
    [0,1,0]

Acknowledgements

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.