Skip to content

Instantly share code, notes, and snippets.

@jaor
jaor / JSON Model Schemas.md
Last active December 11, 2015 07:19 — forked from aficionado/JSON PML schemas.md
JSON schemas for models

JSON schemas for models

  • model-schema.json A generic ML model, containing fields shared by most models despite of their concrete type. It uses:
    • sample-schema.json The schema for dataset sampling specifications
    • field-collection-schema.json Auxiliary schema describing a collection of field (or "properties") descriptors
    • generic-field-schema.json Properties shared by all fields, regardless of their type.
    • field-schema.json The union schema of all field descriptor types, with their specific properties.
  • tree-model-schema.json A specialization of the model schema to decision tree models. It uses:
  • node-schema The schema for the nodes in a decision tree
@jaor
jaor / histogram.clj
Created June 15, 2011 18:34
Single-pass histogram
(ns histogram
(:use
[clojure.contrib.math :only [abs]]
[clojure.contrib.priority-map]))
(defn- bin-weight [bin]
(* (double (first bin)) (double (second bin))))
(defn- combine-bins [prev-bin next-bin]
(let [first-weight (bin-weight prev-bin)