bigbench 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. data/.DS_Store +0 -0
  2. data/README.textile +254 -4
  3. data/Rakefile +43 -9
  4. data/doc/Array.html +288 -0
  5. data/doc/BigBench.html +32 -6
  6. data/doc/BigBench/Benchmark.html +24 -0
  7. data/doc/BigBench/Benchmark/Benchmark.html +24 -0
  8. data/doc/BigBench/Benchmark/Looper.html +24 -0
  9. data/doc/BigBench/Bot.html +24 -0
  10. data/doc/BigBench/Configuration.html +24 -0
  11. data/doc/BigBench/Configuration/Config.html +24 -0
  12. data/doc/BigBench/Configuration/InvalidOptions.html +24 -0
  13. data/doc/BigBench/Executor.html +33 -3
  14. data/doc/BigBench/Executor/InvalidCommand.html +25 -1
  15. data/doc/BigBench/Fragment.html +24 -0
  16. data/doc/BigBench/Fragment/Fragment.html +24 -0
  17. data/doc/BigBench/Output.html +24 -0
  18. data/doc/BigBench/PostProcessor.html +33 -6
  19. data/doc/BigBench/PostProcessor/Environment.html +489 -2
  20. data/doc/BigBench/PostProcessor/Environment/Appearings.html +327 -0
  21. data/doc/BigBench/PostProcessor/Environment/AttributeCluster.html +275 -0
  22. data/doc/BigBench/PostProcessor/Environment/BenchmarkNotFound.html +293 -0
  23. data/doc/BigBench/PostProcessor/Environment/Cluster.html +387 -0
  24. data/doc/BigBench/PostProcessor/Environment/NormalDistribution.html +383 -0
  25. data/doc/BigBench/PostProcessor/Environment/PolynomialRegression.html +438 -0
  26. data/doc/BigBench/PostProcessor/Environment/Statistics.html +568 -0
  27. data/doc/BigBench/PostProcessor/Graphs.html +270 -0
  28. data/doc/BigBench/PostProcessor/Graphs/LineGraph.html +403 -0
  29. data/doc/BigBench/PostProcessor/Graphs/PieGraph.html +396 -0
  30. data/doc/BigBench/PostProcessor/InvalidProcessor.html +25 -1
  31. data/doc/BigBench/PostProcessor/Processor.html +59 -7
  32. data/doc/BigBench/PostProcessor/Statistics.html +26 -2
  33. data/doc/BigBench/PostProcessor/Test.html +26 -2
  34. data/doc/BigBench/Runner.html +24 -0
  35. data/doc/BigBench/Runner/NoBenchmarksDefined.html +24 -0
  36. data/doc/BigBench/Store.html +24 -0
  37. data/doc/BigBench/Tracker.html +24 -0
  38. data/doc/BigBench/Tracker/Tracker.html +24 -0
  39. data/doc/EventMachineLoop.html +24 -0
  40. data/doc/Float.html +24 -0
  41. data/doc/Gemfile.html +24 -0
  42. data/doc/Helpers.html +78 -0
  43. data/doc/Object.html +29 -0
  44. data/doc/README_rdoc.html +803 -0
  45. data/doc/Rakefile.html +66 -10
  46. data/doc/created.rid +46 -40
  47. data/doc/index.html +667 -1
  48. data/doc/js/search_index.js +1 -1
  49. data/doc/lib/bigbench/help/executor_txt.html +32 -2
  50. data/doc/rdoc.css +4 -0
  51. data/doc/table_of_contents.html +179 -23
  52. data/doc/test_rdoc.html +159 -0
  53. data/lib/bigbench.rb +2 -0
  54. data/lib/bigbench/executor.rb +17 -1
  55. data/lib/bigbench/help/executor.txt +5 -0
  56. data/lib/bigbench/post_processor.rb +16 -32
  57. data/lib/bigbench/post_processor/environment.rb +525 -0
  58. data/lib/bigbench/post_processor/graphs.rb +209 -0
  59. data/lib/bigbench/post_processor/statistics.rb +29 -49
  60. data/lib/bigbench/version.rb +1 -1
  61. data/spec/executor_spec.rb +35 -0
  62. data/spec/helpers.rb +15 -1
  63. data/spec/post_processor_spec.rb +19 -4
  64. data/spec/post_processors/environment_spec.rb +412 -0
  65. data/spec/post_processors/graphs_spec.rb +23 -0
  66. data/spec/post_processors/statistics_spec.rb +3 -2
  67. data/spec/tests/local.rb +1 -1
  68. data/spec/tests/sample_results_big.ljson +51925 -0
  69. data/spec/tests/sample_results_small.ljson +3875 -0
  70. data/spec/tests/with_post_processor.ljson +43 -0
  71. data/spec/tests/with_post_processor.rb +12 -0
  72. data/spec/tmp/.DS_Store +0 -0
  73. data/spec/tracker_spec.rb +8 -8
  74. metadata +61 -101
@@ -0,0 +1,383 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class BigBench::PostProcessor::Environment::NormalDistribution - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../../index.html">Home</a>
28
+ <a href="../../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/bigbench/post_processor/environment.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="../../../Object.html">Object</a>
63
+
64
+ </nav>
65
+
66
+ <!-- Included Modules -->
67
+ <nav id="includes-section" class="section">
68
+ <h3 class="section-header">Included Modules</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+
73
+ <li><a class="include" href="../Environment.html">BigBench::PostProcessor::Environment</a>
74
+
75
+
76
+ </ul>
77
+ </nav>
78
+
79
+ <!-- Method Quickref -->
80
+ <nav id="method-list-section" class="section">
81
+ <h3 class="section-header">Methods</h3>
82
+
83
+ <ul class="link-list">
84
+
85
+ <li><a href="#method-c-new">::new</a>
86
+
87
+ <li><a href="#method-i-y">#y</a>
88
+
89
+ </ul>
90
+ </nav>
91
+
92
+ </div>
93
+
94
+ <div id="project-metadata">
95
+ <nav id="fileindex-section" class="section project-section">
96
+ <h3 class="section-header">Pages</h3>
97
+
98
+ <ul>
99
+
100
+ <li class="file"><a href="../../../Gemfile.html">Gemfile</a>
101
+
102
+ <li class="file"><a href="../../../README_rdoc.html">README</a>
103
+
104
+ <li class="file"><a href="../../../Rakefile.html">Rakefile</a>
105
+
106
+ <li class="file"><a href="../../../lib/bigbench/help/executor_txt.html">executor</a>
107
+
108
+ </ul>
109
+ </nav>
110
+
111
+ <nav id="classindex-section" class="section project-section">
112
+ <h3 class="section-header">Class and Module Index</h3>
113
+
114
+ <ul class="link-list">
115
+
116
+ <li><a href="../../../BigBench.html">BigBench</a>
117
+
118
+ <li><a href="../../../BigBench/Benchmark.html">BigBench::Benchmark</a>
119
+
120
+ <li><a href="../../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
121
+
122
+ <li><a href="../../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
123
+
124
+ <li><a href="../../../BigBench/Bot.html">BigBench::Bot</a>
125
+
126
+ <li><a href="../../../BigBench/Configuration.html">BigBench::Configuration</a>
127
+
128
+ <li><a href="../../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
129
+
130
+ <li><a href="../../../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
131
+
132
+ <li><a href="../../../BigBench/Executor.html">BigBench::Executor</a>
133
+
134
+ <li><a href="../../../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
135
+
136
+ <li><a href="../../../BigBench/Fragment.html">BigBench::Fragment</a>
137
+
138
+ <li><a href="../../../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
139
+
140
+ <li><a href="../../../BigBench/Output.html">BigBench::Output</a>
141
+
142
+ <li><a href="../../../BigBench/PostProcessor.html">BigBench::PostProcessor</a>
143
+
144
+ <li><a href="../../../BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
145
+
146
+ <li><a href="../../../BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
147
+
148
+ <li><a href="../../../BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
149
+
150
+ <li><a href="../../../BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
151
+
152
+ <li><a href="../../../BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
153
+
154
+ <li><a href="../../../BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
155
+
156
+ <li><a href="../../../BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
157
+
158
+ <li><a href="../../../BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
159
+
160
+ <li><a href="../../../BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
161
+
162
+ <li><a href="../../../BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
163
+
164
+ <li><a href="../../../BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
165
+
166
+ <li><a href="../../../BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
167
+
168
+ <li><a href="../../../BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
169
+
170
+ <li><a href="../../../BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
171
+
172
+ <li><a href="../../../BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
173
+
174
+ <li><a href="../../../BigBench/Runner.html">BigBench::Runner</a>
175
+
176
+ <li><a href="../../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
177
+
178
+ <li><a href="../../../BigBench/Store.html">BigBench::Store</a>
179
+
180
+ <li><a href="../../../BigBench/Tracker.html">BigBench::Tracker</a>
181
+
182
+ <li><a href="../../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
183
+
184
+ <li><a href="../../../Array.html">Array</a>
185
+
186
+ <li><a href="../../../EventMachineLoop.html">EventMachineLoop</a>
187
+
188
+ <li><a href="../../../Float.html">Float</a>
189
+
190
+ <li><a href="../../../Helpers.html">Helpers</a>
191
+
192
+ <li><a href="../../../Object.html">Object</a>
193
+
194
+ </ul>
195
+ </nav>
196
+
197
+ </div>
198
+ </nav>
199
+
200
+ <div id="documentation">
201
+ <h1 class="class">class BigBench::PostProcessor::Environment::NormalDistribution</h1>
202
+
203
+ <div id="description" class="description">
204
+
205
+ <p>Calculates a gaussion normal distribution with the mean a variance of the
206
+ supplied y values</p>
207
+
208
+ </div><!-- description -->
209
+
210
+
211
+
212
+
213
+ <section id="5Buntitled-5D" class="documentation-section">
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <!-- Attributes -->
222
+ <section id="attribute-method-details" class="method-section section">
223
+ <h3 class="section-header">Attributes</h3>
224
+
225
+
226
+ <div id="attribute-i-formula" class="method-detail">
227
+ <div class="method-heading attribute-method-heading">
228
+ <span class="method-name">formula</span><span
229
+ class="attribute-access-type">[R]</span>
230
+ </div>
231
+
232
+ <div class="method-description">
233
+
234
+
235
+
236
+ </div>
237
+ </div>
238
+
239
+ <div id="attribute-i-mean" class="method-detail">
240
+ <div class="method-heading attribute-method-heading">
241
+ <span class="method-name">mean</span><span
242
+ class="attribute-access-type">[R]</span>
243
+ </div>
244
+
245
+ <div class="method-description">
246
+
247
+
248
+
249
+ </div>
250
+ </div>
251
+
252
+ <div id="attribute-i-sd" class="method-detail">
253
+ <div class="method-heading attribute-method-heading">
254
+ <span class="method-name">sd</span><span
255
+ class="attribute-access-type">[R]</span>
256
+ </div>
257
+
258
+ <div class="method-description">
259
+
260
+
261
+
262
+ </div>
263
+ </div>
264
+
265
+ <div id="attribute-i-x" class="method-detail">
266
+ <div class="method-heading attribute-method-heading">
267
+ <span class="method-name">x</span><span
268
+ class="attribute-access-type">[R]</span>
269
+ </div>
270
+
271
+ <div class="method-description">
272
+
273
+
274
+
275
+ </div>
276
+ </div>
277
+
278
+ </section><!-- attribute-method-details -->
279
+
280
+
281
+ <!-- Methods -->
282
+
283
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
284
+ <h3 class="section-header">Public Class Methods</h3>
285
+
286
+
287
+ <div id="method-c-new" class="method-detail ">
288
+
289
+ <div class="method-heading">
290
+ <span class="method-name">new</span><span
291
+ class="method-args">(x, y, degree)</span>
292
+ <span class="method-click-advice">click to toggle source</span>
293
+ </div>
294
+
295
+
296
+ <div class="method-description">
297
+
298
+
299
+
300
+
301
+
302
+ <div class="method-source-code" id="new-source">
303
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 289</span>
304
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">degree</span>
305
+ <span class="ruby-ivar">@mean</span>, <span class="ruby-ivar">@x</span> = <span class="ruby-identifier">y</span>.<span class="ruby-identifier">average</span>, <span class="ruby-identifier">x</span>
306
+ <span class="ruby-ivar">@sd</span> = <span class="ruby-identifier">y</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">element</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">element</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@mean</span>).<span class="ruby-identifier">abs</span> }.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">y</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_f</span>
307
+
308
+ <span class="ruby-comment"># Setup functions that map the guassian normal distribution</span>
309
+ <span class="ruby-ivar">@distribution</span> = <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-value">1</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-value">2</span> * <span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">PI</span> * <span class="ruby-ivar">@sd</span>) * <span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">E</span><span class="ruby-operator">**</span>( <span class="ruby-value">-0.5</span> * (<span class="ruby-identifier">x</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@mean</span>)<span class="ruby-operator">**</span><span class="ruby-value">2</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@sd</span>) }
310
+
311
+ <span class="ruby-comment"># Setup x to match the center mean</span>
312
+ <span class="ruby-ivar">@x</span> = []
313
+ <span class="ruby-identifier">upper_limit</span> = <span class="ruby-ivar">@mean</span> <span class="ruby-operator">+</span> (<span class="ruby-value">6</span> * <span class="ruby-ivar">@sd</span>)
314
+ <span class="ruby-identifier">lower_limit</span> = <span class="ruby-ivar">@mean</span> <span class="ruby-operator">-</span> (<span class="ruby-value">6</span> * <span class="ruby-ivar">@sd</span>)
315
+ <span class="ruby-identifier">delta_limit</span> = <span class="ruby-identifier">upper_limit</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lower_limit</span>
316
+ <span class="ruby-identifier">steps</span> = <span class="ruby-value">120</span>
317
+ <span class="ruby-identifier">step_size</span> = <span class="ruby-identifier">delta_limit</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">steps</span>
318
+ <span class="ruby-identifier">steps</span>.<span class="ruby-identifier">times</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">step</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@x</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">step</span> * <span class="ruby-identifier">step_size</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">lower_limit</span> }
319
+
320
+ <span class="ruby-comment"># Store formula for printing</span>
321
+ <span class="ruby-ivar">@formula</span> = <span class="ruby-node">&quot;1 / sqrt(2 * pi * #{@sd}) * e**( -0.5 * (x - #{@mean})**2 / #{@sd})&quot;</span>
322
+ <span class="ruby-keyword">end</span></pre>
323
+ </div><!-- new-source -->
324
+
325
+ </div>
326
+
327
+
328
+
329
+
330
+ </div><!-- new-method -->
331
+
332
+
333
+ </section><!-- public-class-method-details -->
334
+
335
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
336
+ <h3 class="section-header">Public Instance Methods</h3>
337
+
338
+
339
+ <div id="method-i-y" class="method-detail ">
340
+
341
+ <div class="method-heading">
342
+ <span class="method-name">y</span><span
343
+ class="method-args">()</span>
344
+ <span class="method-click-advice">click to toggle source</span>
345
+ </div>
346
+
347
+
348
+ <div class="method-description">
349
+
350
+ <p>Returns an array with the distribution values like this:</p>
351
+
352
+ <pre>[0.0, 0.1, 1.2, 4.5, 10.8, 4.5, 1.2, 0.1, 0.0]</pre>
353
+
354
+
355
+
356
+ <div class="method-source-code" id="y-source">
357
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 313</span>
358
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">y</span>
359
+ <span class="ruby-ivar">@x</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@distribution</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">x</span>).<span class="ruby-identifier">round</span>(<span class="ruby-value">3</span>) }
360
+ <span class="ruby-keyword">end</span></pre>
361
+ </div><!-- y-source -->
362
+
363
+ </div>
364
+
365
+
366
+
367
+
368
+ </div><!-- y-method -->
369
+
370
+
371
+ </section><!-- public-instance-method-details -->
372
+
373
+ </section><!-- 5Buntitled-5D -->
374
+
375
+ </div><!-- documentation -->
376
+
377
+
378
+ <footer id="validator-badges">
379
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
380
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
381
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
382
+ </footer>
383
+
@@ -0,0 +1,438 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class BigBench::PostProcessor::Environment::PolynomialRegression - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../../";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="../../../js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="../../../js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="../../../js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="../../../js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="../../../js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../../index.html">Home</a>
28
+ <a href="../../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/bigbench/post_processor/environment.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link"><a href="../../../Object.html">Object</a>
63
+
64
+ </nav>
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <nav id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+
71
+ <ul class="link-list">
72
+
73
+ <li><a href="#method-c-new">::new</a>
74
+
75
+ <li><a href="#method-i-derivation">#derivation</a>
76
+
77
+ <li><a href="#method-i-formula">#formula</a>
78
+
79
+ <li><a href="#method-i-y">#y</a>
80
+
81
+ </ul>
82
+ </nav>
83
+
84
+ </div>
85
+
86
+ <div id="project-metadata">
87
+ <nav id="fileindex-section" class="section project-section">
88
+ <h3 class="section-header">Pages</h3>
89
+
90
+ <ul>
91
+
92
+ <li class="file"><a href="../../../Gemfile.html">Gemfile</a>
93
+
94
+ <li class="file"><a href="../../../README_rdoc.html">README</a>
95
+
96
+ <li class="file"><a href="../../../Rakefile.html">Rakefile</a>
97
+
98
+ <li class="file"><a href="../../../lib/bigbench/help/executor_txt.html">executor</a>
99
+
100
+ </ul>
101
+ </nav>
102
+
103
+ <nav id="classindex-section" class="section project-section">
104
+ <h3 class="section-header">Class and Module Index</h3>
105
+
106
+ <ul class="link-list">
107
+
108
+ <li><a href="../../../BigBench.html">BigBench</a>
109
+
110
+ <li><a href="../../../BigBench/Benchmark.html">BigBench::Benchmark</a>
111
+
112
+ <li><a href="../../../BigBench/Benchmark/Benchmark.html">BigBench::Benchmark::Benchmark</a>
113
+
114
+ <li><a href="../../../BigBench/Benchmark/Looper.html">BigBench::Benchmark::Looper</a>
115
+
116
+ <li><a href="../../../BigBench/Bot.html">BigBench::Bot</a>
117
+
118
+ <li><a href="../../../BigBench/Configuration.html">BigBench::Configuration</a>
119
+
120
+ <li><a href="../../../BigBench/Configuration/Config.html">BigBench::Configuration::Config</a>
121
+
122
+ <li><a href="../../../BigBench/Configuration/InvalidOptions.html">BigBench::Configuration::InvalidOptions</a>
123
+
124
+ <li><a href="../../../BigBench/Executor.html">BigBench::Executor</a>
125
+
126
+ <li><a href="../../../BigBench/Executor/InvalidCommand.html">BigBench::Executor::InvalidCommand</a>
127
+
128
+ <li><a href="../../../BigBench/Fragment.html">BigBench::Fragment</a>
129
+
130
+ <li><a href="../../../BigBench/Fragment/Fragment.html">BigBench::Fragment::Fragment</a>
131
+
132
+ <li><a href="../../../BigBench/Output.html">BigBench::Output</a>
133
+
134
+ <li><a href="../../../BigBench/PostProcessor.html">BigBench::PostProcessor</a>
135
+
136
+ <li><a href="../../../BigBench/PostProcessor/Environment.html">BigBench::PostProcessor::Environment</a>
137
+
138
+ <li><a href="../../../BigBench/PostProcessor/Environment/Appearings.html">BigBench::PostProcessor::Environment::Appearings</a>
139
+
140
+ <li><a href="../../../BigBench/PostProcessor/Environment/AttributeCluster.html">BigBench::PostProcessor::Environment::AttributeCluster</a>
141
+
142
+ <li><a href="../../../BigBench/PostProcessor/Environment/BenchmarkNotFound.html">BigBench::PostProcessor::Environment::BenchmarkNotFound</a>
143
+
144
+ <li><a href="../../../BigBench/PostProcessor/Environment/Cluster.html">BigBench::PostProcessor::Environment::Cluster</a>
145
+
146
+ <li><a href="../../../BigBench/PostProcessor/Environment/NormalDistribution.html">BigBench::PostProcessor::Environment::NormalDistribution</a>
147
+
148
+ <li><a href="../../../BigBench/PostProcessor/Environment/PolynomialRegression.html">BigBench::PostProcessor::Environment::PolynomialRegression</a>
149
+
150
+ <li><a href="../../../BigBench/PostProcessor/Environment/Statistics.html">BigBench::PostProcessor::Environment::Statistics</a>
151
+
152
+ <li><a href="../../../BigBench/PostProcessor/Graphs.html">BigBench::PostProcessor::Graphs</a>
153
+
154
+ <li><a href="../../../BigBench/PostProcessor/Graphs/LineGraph.html">BigBench::PostProcessor::Graphs::LineGraph</a>
155
+
156
+ <li><a href="../../../BigBench/PostProcessor/Graphs/PieGraph.html">BigBench::PostProcessor::Graphs::PieGraph</a>
157
+
158
+ <li><a href="../../../BigBench/PostProcessor/InvalidProcessor.html">BigBench::PostProcessor::InvalidProcessor</a>
159
+
160
+ <li><a href="../../../BigBench/PostProcessor/Processor.html">BigBench::PostProcessor::Processor</a>
161
+
162
+ <li><a href="../../../BigBench/PostProcessor/Statistics.html">BigBench::PostProcessor::Statistics</a>
163
+
164
+ <li><a href="../../../BigBench/PostProcessor/Test.html">BigBench::PostProcessor::Test</a>
165
+
166
+ <li><a href="../../../BigBench/Runner.html">BigBench::Runner</a>
167
+
168
+ <li><a href="../../../BigBench/Runner/NoBenchmarksDefined.html">BigBench::Runner::NoBenchmarksDefined</a>
169
+
170
+ <li><a href="../../../BigBench/Store.html">BigBench::Store</a>
171
+
172
+ <li><a href="../../../BigBench/Tracker.html">BigBench::Tracker</a>
173
+
174
+ <li><a href="../../../BigBench/Tracker/Tracker.html">BigBench::Tracker::Tracker</a>
175
+
176
+ <li><a href="../../../Array.html">Array</a>
177
+
178
+ <li><a href="../../../EventMachineLoop.html">EventMachineLoop</a>
179
+
180
+ <li><a href="../../../Float.html">Float</a>
181
+
182
+ <li><a href="../../../Helpers.html">Helpers</a>
183
+
184
+ <li><a href="../../../Object.html">Object</a>
185
+
186
+ </ul>
187
+ </nav>
188
+
189
+ </div>
190
+ </nav>
191
+
192
+ <div id="documentation">
193
+ <h1 class="class">class BigBench::PostProcessor::Environment::PolynomialRegression</h1>
194
+
195
+ <div id="description" class="description">
196
+
197
+ <p>This class performs the actual regression for a specfied degree and
198
+ timebase. As x it returns the timebase values for the corresponding
199
+ timebase - e.g. the seconds - and as y it returns the corresponding
200
+ regression values. Additionally it offers the derivations for the
201
+ regressions with the <code>deviation</code> method.</p>
202
+
203
+ </div><!-- description -->
204
+
205
+
206
+
207
+
208
+ <section id="5Buntitled-5D" class="documentation-section">
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+ <!-- Attributes -->
217
+ <section id="attribute-method-details" class="method-section section">
218
+ <h3 class="section-header">Attributes</h3>
219
+
220
+
221
+ <div id="attribute-i-coefficients" class="method-detail">
222
+ <div class="method-heading attribute-method-heading">
223
+ <span class="method-name">coefficients</span><span
224
+ class="attribute-access-type">[R]</span>
225
+ </div>
226
+
227
+ <div class="method-description">
228
+
229
+ <p>Returns the coefficients calculated for the regression and the degree like</p>
230
+
231
+ <pre>[3.428734, 1.176235]</pre>
232
+
233
+ </div>
234
+ </div>
235
+
236
+ <div id="attribute-i-degree" class="method-detail">
237
+ <div class="method-heading attribute-method-heading">
238
+ <span class="method-name">degree</span><span
239
+ class="attribute-access-type">[R]</span>
240
+ </div>
241
+
242
+ <div class="method-description">
243
+
244
+
245
+
246
+ </div>
247
+ </div>
248
+
249
+ <div id="attribute-i-x" class="method-detail">
250
+ <div class="method-heading attribute-method-heading">
251
+ <span class="method-name">x</span><span
252
+ class="attribute-access-type">[R]</span>
253
+ </div>
254
+
255
+ <div class="method-description">
256
+
257
+ <p>An array with the seconds in the timebase</p>
258
+
259
+ <pre>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]</pre>
260
+
261
+ </div>
262
+ </div>
263
+
264
+ </section><!-- attribute-method-details -->
265
+
266
+
267
+ <!-- Methods -->
268
+
269
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
270
+ <h3 class="section-header">Public Class Methods</h3>
271
+
272
+
273
+ <div id="method-c-new" class="method-detail ">
274
+
275
+ <div class="method-heading">
276
+ <span class="method-name">new</span><span
277
+ class="method-args">(x, y, degree)</span>
278
+ <span class="method-click-advice">click to toggle source</span>
279
+ </div>
280
+
281
+
282
+ <div class="method-description">
283
+
284
+
285
+
286
+
287
+
288
+ <div class="method-source-code" id="new-source">
289
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 429</span>
290
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">degree</span>
291
+ <span class="ruby-ivar">@x</span>, <span class="ruby-ivar">@degree</span>, <span class="ruby-ivar">@derivations</span>, <span class="ruby-ivar">@formulas</span> = <span class="ruby-identifier">x</span>, <span class="ruby-identifier">degree</span>, [], []
292
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Regression is not possible for a single time value, choose a smaller timebase&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@x</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>
293
+
294
+ <span class="ruby-comment"># Perform regression</span>
295
+ <span class="ruby-identifier">x_data</span> = <span class="ruby-identifier">x</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">xi</span><span class="ruby-operator">|</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">degree</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">pow</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">xi</span><span class="ruby-operator">**</span><span class="ruby-identifier">pow</span>).<span class="ruby-identifier">to_f</span> } }
296
+ <span class="ruby-identifier">mx</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Matrix</span>[*<span class="ruby-identifier">x_data</span>]
297
+ <span class="ruby-identifier">my</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">column_vector</span>(<span class="ruby-identifier">y</span>)
298
+
299
+
300
+ <span class="ruby-comment"># Calculate coefficients</span>
301
+ <span class="ruby-ivar">@coefficients</span> = ((<span class="ruby-identifier">mx</span>.<span class="ruby-identifier">t</span> * <span class="ruby-identifier">mx</span>).<span class="ruby-identifier">inv</span> * <span class="ruby-identifier">mx</span>.<span class="ruby-identifier">t</span> * <span class="ruby-identifier">my</span>).<span class="ruby-identifier">transpose</span>.<span class="ruby-identifier">to_a</span>[<span class="ruby-value">0</span>]
302
+
303
+ <span class="ruby-comment"># Setup functions that map the actual polynom</span>
304
+ <span class="ruby-ivar">@derivations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-ivar">@degree</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> (<span class="ruby-ivar">@coefficients</span>[<span class="ruby-identifier">d</span>] * <span class="ruby-identifier">x</span><span class="ruby-operator">**</span><span class="ruby-identifier">d</span>) }}
305
+ <span class="ruby-ivar">@derivations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-ivar">@degree</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">d</span> * (<span class="ruby-ivar">@coefficients</span>[<span class="ruby-identifier">d</span>] * <span class="ruby-identifier">x</span><span class="ruby-operator">**</span>(<span class="ruby-identifier">d</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>))) }}
306
+
307
+ <span class="ruby-comment"># Store formulas for printing</span>
308
+ <span class="ruby-ivar">@formulas</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-ivar">@degree</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@coefficients</span>[<span class="ruby-identifier">d</span>] <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{@coefficients[d]}x^#{d}&quot;</span> }
309
+ <span class="ruby-ivar">@formulas</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-ivar">@degree</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@coefficients</span>[<span class="ruby-identifier">d</span>] <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{d}*#{@coefficients[d]}x^#{d-1}&quot;</span> }
310
+ <span class="ruby-keyword">end</span></pre>
311
+ </div><!-- new-source -->
312
+
313
+ </div>
314
+
315
+
316
+
317
+
318
+ </div><!-- new-method -->
319
+
320
+
321
+ </section><!-- public-class-method-details -->
322
+
323
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
324
+ <h3 class="section-header">Public Instance Methods</h3>
325
+
326
+
327
+ <div id="method-i-derivation" class="method-detail ">
328
+
329
+ <div class="method-heading">
330
+ <span class="method-name">derivation</span><span
331
+ class="method-args">(derivation = 0)</span>
332
+ <span class="method-click-advice">click to toggle source</span>
333
+ </div>
334
+
335
+
336
+ <div class="method-description">
337
+
338
+ <p>Returns an array with the computed y-values for the corresponding
339
+ derivation. The default derivation is the</p>
340
+ <ol><li>
341
+ <p>derivation which is the original regression that is equal to the
342
+ <code>y</code> method. The result looks like this:</p>
343
+ </li></ol>
344
+
345
+ <pre>[2.5, 2.6, 2.7, 2.8, 3.0, 3.2, 3.4, 3.8, 4.0, 4.9]</pre>
346
+
347
+
348
+
349
+ <div class="method-source-code" id="derivation-source">
350
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 456</span>
351
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">derivation</span>(<span class="ruby-identifier">derivation</span> = <span class="ruby-value">0</span>)
352
+ <span class="ruby-ivar">@x</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@derivations</span>[<span class="ruby-identifier">derivation</span>].<span class="ruby-identifier">call</span>(<span class="ruby-identifier">x</span>) }
353
+ <span class="ruby-keyword">end</span></pre>
354
+ </div><!-- derivation-source -->
355
+
356
+ </div>
357
+
358
+
359
+
360
+
361
+ </div><!-- derivation-method -->
362
+
363
+
364
+ <div id="method-i-formula" class="method-detail ">
365
+
366
+ <div class="method-heading">
367
+ <span class="method-name">formula</span><span
368
+ class="method-args">(derivation = 0)</span>
369
+ <span class="method-click-advice">click to toggle source</span>
370
+ </div>
371
+
372
+
373
+ <div class="method-description">
374
+
375
+ <p>Returns the printed formula of this polynom</p>
376
+
377
+
378
+
379
+ <div class="method-source-code" id="formula-source">
380
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 469</span>
381
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">formula</span>(<span class="ruby-identifier">derivation</span> = <span class="ruby-value">0</span>)
382
+ <span class="ruby-ivar">@formulas</span>[<span class="ruby-identifier">derivation</span>].<span class="ruby-identifier">join</span> <span class="ruby-string">&quot; + &quot;</span>
383
+ <span class="ruby-keyword">end</span></pre>
384
+ </div><!-- formula-source -->
385
+
386
+ </div>
387
+
388
+
389
+
390
+
391
+ </div><!-- formula-method -->
392
+
393
+
394
+ <div id="method-i-y" class="method-detail ">
395
+
396
+ <div class="method-heading">
397
+ <span class="method-name">y</span><span
398
+ class="method-args">()</span>
399
+ <span class="method-click-advice">click to toggle source</span>
400
+ </div>
401
+
402
+
403
+ <div class="method-description">
404
+
405
+ <p>Returns an array with the regression values like this:</p>
406
+
407
+ <pre>[2.5, 2.6, 2.7, 2.8, 3.0, 3.2, 3.4, 3.8, 4.0, 4.9]</pre>
408
+
409
+
410
+
411
+ <div class="method-source-code" id="y-source">
412
+ <pre><span class="ruby-comment"># File lib/bigbench/post_processor/environment.rb, line 464</span>
413
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">y</span>
414
+ <span class="ruby-identifier">derivation</span>(<span class="ruby-value">0</span>)
415
+ <span class="ruby-keyword">end</span></pre>
416
+ </div><!-- y-source -->
417
+
418
+ </div>
419
+
420
+
421
+
422
+
423
+ </div><!-- y-method -->
424
+
425
+
426
+ </section><!-- public-instance-method-details -->
427
+
428
+ </section><!-- 5Buntitled-5D -->
429
+
430
+ </div><!-- documentation -->
431
+
432
+
433
+ <footer id="validator-badges">
434
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
435
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
436
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
437
+ </footer>
438
+