one-hot-json
on development
Purpose
flattening and encoding JSON Objects
Spark of Need
Many multivariate algorithms depend on array-like data. There is a need for modules to transform JSON Objects into such kind of data in a reasonable and easy to use manner. The main goal is to deliver a module with a generic encoding and decoding functionality for a collection of JSON Objects of the same Schema.
Approach
Flattening JSON Objects and encoding string values via one-hot approach.
Example
const Onehot = ; const input = user: id: 1 name: 'Dalton' prename: 'John' online: true project: id: 1 name: 'lodash' user: id: 1 name: 'Dalton' prename: 'John' online: true project: id: 2 name: 'docdown' user: id: 1 name: 'Dalton' prename: 'John' online: true project: id: 3 name: 'lodash-cli' user: id: 2 name: '-' prename: 'contra' online: false project: id: 4 name: 'gulp' user: id: 3 name: '-' prename: 'phated' online: true project: id: 4 name: 'gulp' ;
Initiate the one-hot-json transcriptor by a sample from targeting collection.
let sample = _;const User = ; let encoded: = User;// encoded:
Decoding:
let decoded = User;console;//true
Usecase: encoded matrix as output from a replication or machine learning algorithms.
let deformatedEncoding = 09 01 02 23 08 001 11 02 03 22 21 135 08 01 01 23 32 211 19 09 12 31 42 331 29 11 22 21 43 322 ; let decodedDeformation = User;console;//true