Skip to content
Newer
Older
100644 396 lines (333 sloc) 13.3 KB
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored Apr 30, 2012
1 # Overview
21d47c8 @ashenfad adding a markdown readme
ashenfad authored Jul 12, 2011
2
6aa49cd @ashenfad Prettier formatting
ashenfad authored Dec 12, 2011
3 This project is an implementation of the streaming, one-pass
4 histograms described in Ben-Haim's [Streaming Parallel Decision
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
5 Trees](http://jmlr.csail.mit.edu/papers/v11/ben-haim10a.html). Inspired
6 by Tyree's [Parallel Boosted Regression
7 Trees](http://research.engineering.wustl.edu/~tyrees/Publications_files/fr819-tyreeA.pdf),
8 the histograms are extended to track multiple values.
9
10 The histograms act as an approximation of the underlying dataset. They
11 can be used for learning, visualization, discretization, or analysis.
12 The histograms may be built independently and merged, convenient for
13 parallel and distributed algorithms.
21d47c8 @ashenfad adding a markdown readme
ashenfad authored Jul 13, 2011
14
9971f0b @ashenfad added an example
ashenfad authored Jul 12, 2011
15 # Building
21d47c8 @ashenfad adding a markdown readme
ashenfad authored Jul 13, 2011
16
5b5d02c @ashenfad Java version requirement is more accurate
ashenfad authored Jan 16, 2012
17 1. Make sure you have Java 1.6 or newer
edbed95 @ashenfad Fewer lies in the readme
ashenfad authored Jan 14, 2012
18 2. Install [leiningen](https://github.com/technomancy/leiningen)
19 3. Checkout the histogram project with git
20 4. Run `lein jar`
21d47c8 @ashenfad adding a markdown readme
ashenfad authored Jul 13, 2011
21
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
22 # Basics
23
24 In the following examples we use [Incanter](http://incanter.org/) to
25 generate data and for charting.
26
27 The simplest way to use a histogram is to `create` one and then
28 `insert!` points. In the example below, `ex/normal-data` refers to a
29 sequence of 100K samples from a normal distribution (mean 0, variance
30 1).
31
32 ```clojure
33 user> (ns examples
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 18, 2012
34 (:use [histogram.core])
35 (:require (histogram.test [examples :as ex])))
36 examples> (def hist (reduce insert! (create) ex/normal-data))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
37 ```
38
39 You can use the `sum` fn to find the approximate number of points less
40 than a given threshold:
41
42 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
43 examples> (sum hist 0)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 27, 2013
44 99814.63248
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
45 ```
46
47 The `density` fn gives us an estimate of the point density at the
48 given location:
49
50 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
51 examples> (density hist 0)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
52 80936.98291
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
53 ```
54
55 The `uniform` fn returns a list of points that separate the
56 distribution into equal population areas. Here's an example that
57 produces quartiles:
58
59 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
60 examples> (uniform hist 4)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
61 (-0.66904 0.00229 0.67605)
62 ```
63 Arbritrary percentiles can be found using `percentiles`:
64
65 ```clojure
66 examples> (percentiles hist 0.5 0.95 0.99)
67 {0.5 0.00229, 0.95 1.63853, 0.99 2.31390}
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
68 ```
69
70 We can plot the sums and density estimates as functions. The red line
71 represents the sum, the blue line represents the density. If we
72 normalized the values (dividing by 100K), these lines approximate the
73 [cumulative distribution
74 function](http://en.wikipedia.org/wiki/Cumulative_distribution_function)
75 and the [probability distribution
76 function](http://en.wikipedia.org/wiki/Probability_density_function)
77 for the normal distribution.
78
79 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
80 examples> (ex/sum-density-chart hist) ;; also see (ex/cdf-pdf-chart hist)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
81 ```
82 ![Histogram from normal distribution]
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
83 (https://www.evernote.com/shard/s4/sh/acee03ad-4f5f-4fbf-82f1-5dc7301fc260/85e8b22b12e02a302198110ca77a89b2/res/eb14258d-2830-4362-aca4-590c83866946/skitch.png)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
84
85 The histogram approximates distributions using a constant number of
86 bins. This bin limit is a parameter when creating a histogram
87 (`:bins`, defaults to 64). A bin contains a `:count` of the points
88 within the bin along with the `:mean` for the values in the bin. The
89 edges of the bin aren't captured. Instead the histogram assumes that
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
90 points of a bin are distributed with half the points less than the bin
91 mean and half greater. This explains the fractional sum in the example
92 below:
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
93
94 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
95 examples> (def hist (-> (create :bins 3)
96 (insert! 1)
97 (insert! 2)
98 (insert! 3)))
99 examples> (bins hist)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
100 ({:mean 1.0, :count 1} {:mean 2.0, :count 1} {:mean 3.0, :count 1})
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
101 examples> (sum hist 2)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
102 1.5
103 ```
104
105 As mentioned earlier, the bin limit constrains the number of unique
106 bins a histogram can use to capture a distribution. The histogram
107 above was created with a limit of just three bins. When we add a
108 fourth unique value it will create a fourth bin and then merge the
109 nearest two.
110
111 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
112 examples> (bins (insert! hist 0.5))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
113 ({:mean 0.75, :count 2} {:mean 2.0, :count 1} {:mean 3.0, :count 1})
114 ```
115
116 A larger bin limit means a higher quality picture of the distribution,
117 but it also means a larger memory footprint. In the chart below, the
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
118 red line represents a histogram with 8 bins and the blue line
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
119 represents 64 bins.
120
121 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
122 examples> (ex/multi-pdf-chart
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
123 [(reduce insert! (create :bins 8) ex/mixed-normal-data)
124 (reduce insert! (create :bins 64) ex/mixed-normal-data)])
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
125 ```
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
126 ![8 and 64 bins histograms]
127 (https://www.evernote.com/shard/s4/sh/580f6e58-2e9d-42f1-8288-d84013fa962d/38b9d70534c37ff680c68bd2f251d710/res/9451f44b-e364-499e-af78-a827729b9612/skitch.png)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
128
129 Another option when creating a histogram is to use *gap
130 weighting*. When `:gap-weighted?` is true, the histogram is encouraged
131 to spend more of its bins capturing the densest areas of the
132 distribution. For the normal distribution that means better resolution
133 near the mean and less resolution near the tails. The chart below
134 shows a histogram without gap weighting in blue and with gap weighting
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
135 in red. Near the center of the distribution, red uses more bins and
136 better captures the gaussian distribution's true curve.
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
137
138 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
139 examples> (ex/multi-pdf-chart
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
140 [(reduce insert! (create :bins 8 :gap-weighted? true)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
141 ex/normal-data)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
142 (reduce insert! (create :bins 8 :gap-weighted? false)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
143 ex/normal-data)])
144 ```
145 ![Gap weighting vs. No gap weighting]
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
146 (https://www.evernote.com/shard/s4/sh/526873b6-e8dc-458a-a7e5-805faa66d9a0/e6144df90e693bdba08256bab325f241/res/6acb5020-0e4e-4bc5-8185-249f7f090a88/skitch.png)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
147
148 # Merging
149
150 A strength of the histograms is their ability to merge with one
151 another. Histograms can be built on separate data streams and then
152 combined to give a better overall picture.
153
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
154 In this example, the blue line shows a density distribution from a
155 histogram after merging 300 noisy histograms. The red shows one of the
156 original histograms:
157
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
158 ```clojure
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
159 examples> (let [samples (partition 1000 ex/mixed-normal-data)
160 hists (map #(reduce insert! (create) %) samples)
161 merged (reduce merge! (create) (take 300 hists))]
162 (ex/multi-pdf-chart [(first hists) merged]))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
163 ```
164 ![Merged histograms]
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
165 (https://www.evernote.com/shard/s4/sh/3ed19b0c-11a9-4c21-a751-5d5cdaede224/f0429a26c621f89ccaa52e6c476d98bb/res/a6ea07e9-90d5-4309-968b-e1095505a13d/skitch.png)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
166
167 # Targets
168
169 While a simple histogram is nice for capturing the distribution of a
170 single variable, it's often important to capture the correlation
171 between variables. To that end, the histograms can track a second
172 variable called the *target*.
173
174 The target may be either numeric or categorical. The `insert!` fn is
175 overloaded to accept either type of target. Each histogram bin will
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
176 contain information summarizing the target. For numeric targets the
177 sum and sum-of-squares are tracked. For categoricals, a map of
178 counts is maintained.
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
179
180 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
181 examples> (-> (create)
182 (insert! 1 9)
183 (insert! 2 8)
184 (insert! 3 7)
185 (insert! 3 6)
186 (bins))
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
187 ({:target {:sum 9.0, :sum-squares 81.0, :missing-count 0.0},
188 :mean 1.0,
189 :count 1}
190 {:target {:sum 8.0, :sum-squares 64.0, :missing-count 0.0},
191 :mean 2.0,
192 :count 1}
193 {:target {:sum 13.0, :sum-squares 85.0, :missing-count 0.0},
194 :mean 3.0,
195 :count 2})
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
196 examples> (-> (create)
197 (insert! 1 :a)
198 (insert! 2 :b)
199 (insert! 3 :c)
200 (insert! 3 :d)
201 (bins))
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
202 ({:target {:counts {:a 1.0}, :missing-count 0.0},
203 :mean 1.0,
204 :count 1}
205 {:target {:counts {:b 1.0}, :missing-count 0.0},
206 :mean 2.0,
207 :count 1}
208 {:target {:counts {:d 1.0, :c 1.0}, :missing-count 0.0},
209 :mean 3.0,
210 :count 2})
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
211 ```
212
213 Mixing target types isn't allowed:
214
215 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
216 examples> (-> (create)
217 (insert! 1 :a)
218 (insert! 2 999))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
219 Can't mix insert types
220 [Thrown class com.bigml.histogram.MixedInsertException]
221 ```
222
223 `insert-numeric!` and `insert-categorical!` allow target types to be
224 set explicitly:
225
226 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
227 examples> (-> (create)
228 (insert-categorical! 1 1)
229 (insert-categorical! 1 2)
230 (bins))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
231 ({:target {:counts {2 1.0, 1 1.0}, :missing-count 0.0}, :mean 1.0, :count 2})
232 ```
233
234 The `extended-sum` fn works similarly to `sum`, but returns a result
235 that includes the target information:
236
237 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
238 examples> (-> (create)
239 (insert! 1 :a)
240 (insert! 2 :b)
241 (insert! 3 :c)
242 (extended-sum 2))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
243 {:sum 1.5, :target {:counts {:c 0.0, :b 0.5, :a 1.0}, :missing-count 0.0}}
244 ```
245
246 The `average-target` fn returns the average target value given a
247 point. To illustrate, the following histogram captures a dataset where
248 the input field is a sample from the normal distribution while the
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
249 target value is the sine of the input. The density is in red and the
250 average target value is in blue:
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
251
252 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
253 examples> (def make-y (fn [x] (Math/sin x)))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
254 examples> (def hist (let [target-data (map (fn [x] [x (make-y x)])
255 ex/normal-data)]
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
256 (reduce (fn [h [x y]] (insert! h x y))
257 (create)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
258 target-data)))
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
259 examples> (ex/pdf-target-chart hist)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
260 ```
261 ![Numeric target]
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
262 (https://www.evernote.com/shard/s4/sh/34b51a39-b090-4f33-93a2-7be1112b869e/e3d276b3adb347b3c493a295bb585f8d/res/4a254bbb-6111-43cb-826d-f09d8d3048c7/skitch.png)
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
263
264 Continuing with the same histogram, we can see that `average-target`
265 produces values close to original target:
9971f0b @ashenfad added an example
ashenfad authored Jul 13, 2011
266
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
267 ```clojure
268 examples> (def view-target (fn [x] {:actual (make-y x)
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
269 :approx (:sum (average-target hist x))}))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
270 examples> (view-target 0)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
271 {:actual 0.0, :approx -0.00051}
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
272 examples> (view-target (/ Math/PI 2))
273 {:actual 1.0, :approx 0.9968169965429206}
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
274 examples> (view-target Math/PI)
80ac2fb @ashenfad Updates the readme and examples with new charts
ashenfad authored Jan 28, 2013
275 {:actual 0.0, :approx 0.00463}
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
276 ```
320840c @ashenfad toying with the markdown README
ashenfad authored Jul 13, 2011
277
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
278 # Missing Values
320840c @ashenfad toying with the markdown README
ashenfad authored Jul 13, 2011
279
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
280 Information about missing values is captured whenever the input field
281 or the target is `nil`. The `missing-bin` fn retrieves information
282 summarizing the instances with a missing input. For a basic histogram,
283 that is simply the count:
4030d78 @ashenfad toying with the markdown README
ashenfad authored Jul 13, 2011
284
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
285 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
286 examples> (-> (create)
287 (insert! nil)
288 (insert! 7)
289 (insert! nil)
290 (missing-bin))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
291 {:count 2}
72b850d @ashenfad Added performance chart
ashenfad authored Dec 7, 2011
292 ```
293
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
294 For a histogram with a target, the `missing-bin` includes target
295 information:
296
297 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
298 examples> (-> (create)
299 (insert! nil :a)
300 (insert! 7 :b)
301 (insert! nil :c)
302 (missing-bin))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
303 {:target {:counts {:a 1.0, :c 1.0}, :missing-count 0.0}, :count 2}
304 ```
305
306 Targets can also be missing, in which case the target `missing-count`
307 is incremented:
308
309 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
310 examples> (-> (create)
311 (insert! nil :a)
312 (insert! 7 :b)
313 (insert! nil nil)
314 (missing-bin))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
315 {:target {:counts {:a 1.0}, :missing-count 1.0}, :count 2}
316 ```
317
318 # Array-backed Categorical Targets
319
320 By default a histogram with categorical targets stores the category
321 counts as Java HashMaps. Building and merging HashMaps can be
322 expensive. Alternatively the category counts can be backed by an
323 array. This can give better performance but requires the set of
324 possible categories to be declared when the histogram is created. To
325 do this, set the `:categories` parameter:
326
327 ```clojure
328 examples> (def categories (map (partial str "c") (range 50)))
329 examples> (def data (vec (repeatedly 100000
330 #(vector (rand) (str "c" (rand-int 50))))))
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
331 examples> (doseq [hist [(create) (create :categories categories)]]
332 (time (reduce (fn [h [x y]] (insert! h x y))
d9d88f0 @ashenfad Adds documentation and examples
ashenfad authored May 1, 2012
333 hist
334 data)))
335 "Elapsed time: 1295.402 msecs"
336 "Elapsed time: 516.72 msecs"
337 ```
338
339 # Group Targets
340
341 Group targets allow the histogram to track multiple targets at the
342 same time. Each bin contains a sequence of target
343 information. Optionally, the target types in the group can be declared
344 when creating the histogram. Declaring the types on creation allows
345 the targets to be missing in the first insert:
346
edbed95 @ashenfad Fewer lies in the readme
ashenfad authored Jan 14, 2012
347 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
348 examples> (-> (create :group-types [:categorical :numeric])
349 (insert! 1 [:a nil])
350 (insert! 2 [:b 8])
351 (insert! 3 [:c 7])
352 (insert! 1 [:d 6])
353 (bins))
962437b @ashenfad Adds sum-of-squares to histograms with numeric targets
ashenfad authored Oct 11, 2012
354 ({:target
355 ({:counts {:d 1.0, :a 1.0}, :missing-count 0.0}
356 {:sum 6.0, :sum-squares 36.0, :missing-count 1.0}),
357 :mean 1.0,
358 :count 2}
359 {:target
360 ({:counts {:b 1.0}, :missing-count 0.0}
361 {:sum 8.0, :sum-squares 64.0, :missing-count 0.0}),
362 :mean 2.0,
363 :count 1}
364 {:target
365 ({:counts {:c 1.0}, :missing-count 0.0}
366 {:sum 7.0, :sum-squares 49.0, :missing-count 0.0}),
367 :mean 3.0,
368 :count 1})
edbed95 @ashenfad Fewer lies in the readme
ashenfad authored Jan 14, 2012
369 ```
370
576e984 @ashenfad Adds :freeze as an optional parameter
ashenfad authored Jul 10, 2012
371 # Freezing a Histogram
372
373 While the ability to adapt to non-stationary data streams is a
374 strength of the histograms, it is also computationally expensive. If
375 your data stream is stationary, you can increase the histogram's
376 performance by setting the `:freeze` parameter. After the number of
377 inserts into the histogram have exceeded the `:freeze` parameter, the
378 histogram bins are locked into place. As the bin means no longer
379 shift, inserts become computationally cheap. However the quality of
380 the histogram can suffer if the `:freeze` parameter is too small.
381
382 ```clojure
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
383 examples> (time (reduce insert! (create) ex/normal-data))
576e984 @ashenfad Adds :freeze as an optional parameter
ashenfad authored Jul 10, 2012
384 "Elapsed time: 391.857 msecs"
26ee372 @ashenfad Readme & examples update
ashenfad authored Jul 19, 2012
385 examples> (time (reduce insert! (create :freeze 1024) ex/normal-data))
576e984 @ashenfad Adds :freeze as an optional parameter
ashenfad authored Jul 10, 2012
386 "Elapsed time: 99.92 msecs"
387 ```
388
edbed95 @ashenfad Fewer lies in the readme
ashenfad authored Jan 14, 2012
389 # Performance
3ed0f66 @ashenfad Expanded readme
ashenfad authored Dec 9, 2011
390
7b7a20e @ashenfad README is slightly more verbose
ashenfad authored Jan 16, 2012
391 Insert time scales `log(n)` with respect to the number of bins in the
392 histogram.
72b850d @ashenfad Added performance chart
ashenfad authored Dec 7, 2011
393
6aa49cd @ashenfad Prettier formatting
ashenfad authored Dec 12, 2011
394 ![timing chart]
395 (https://docs.google.com/spreadsheet/oimg?key=0Ah2oAcudnjP4dG1CLUluRS1rcHVqU05DQ2Z4UVZnbmc&oid=2&zx=mppmmoe214jm)
Something went wrong with that request. Please try again.