tangram 0.1.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +15 -0
  4. data/LICENSE +1 -1
  5. data/README.md +8 -28
  6. data/docs/Tangram.html +127 -0
  7. data/docs/Tangram/BagOfWordsCosineSimilarityFeatureContribution.html +507 -0
  8. data/docs/Tangram/BagOfWordsFeatureContribution.html +507 -0
  9. data/docs/Tangram/Bigram.html +363 -0
  10. data/docs/Tangram/BinaryClassificationPredictOutput.html +493 -0
  11. data/docs/Tangram/FeatureContributions.html +435 -0
  12. data/docs/Tangram/IdentityFeatureContribution.html +435 -0
  13. data/docs/Tangram/LibTangram.html +161 -0
  14. data/docs/Tangram/LibTangram/TangramStringView.html +193 -0
  15. data/docs/Tangram/LoadModelOptions.html +291 -0
  16. data/docs/Tangram/Model.html +1250 -0
  17. data/docs/Tangram/MulticlassClassificationPredictOutput.html +565 -0
  18. data/docs/Tangram/NormalizedFeatureContribution.html +435 -0
  19. data/docs/Tangram/OneHotEncodedFeatureContribution.html +507 -0
  20. data/docs/Tangram/PredictOptions.html +421 -0
  21. data/docs/Tangram/RegressionPredictOutput.html +421 -0
  22. data/docs/Tangram/Unigram.html +291 -0
  23. data/docs/Tangram/WordEmbeddingFeatureContribution.html +435 -0
  24. data/docs/_index.html +317 -0
  25. data/docs/class_list.html +51 -0
  26. data/docs/css/common.css +1 -0
  27. data/docs/css/full_list.css +58 -0
  28. data/docs/css/style.css +497 -0
  29. data/docs/file.README.html +106 -0
  30. data/docs/file_list.html +56 -0
  31. data/docs/frames.html +17 -0
  32. data/docs/index.html +106 -0
  33. data/docs/js/app.js +314 -0
  34. data/docs/js/full_list.js +216 -0
  35. data/docs/js/jquery.js +4 -0
  36. data/docs/method_list.html +595 -0
  37. data/docs/top-level-namespace.html +110 -0
  38. data/examples/advanced/Gemfile +2 -0
  39. data/examples/advanced/Gemfile.lock +15 -0
  40. data/examples/advanced/README.md +14 -0
  41. data/examples/advanced/heart_disease.tangram +0 -0
  42. data/examples/advanced/main.rb +49 -0
  43. data/examples/basic/Gemfile +2 -0
  44. data/examples/basic/Gemfile.lock +15 -0
  45. data/examples/basic/README.md +10 -0
  46. data/examples/basic/heart_disease.tangram +0 -0
  47. data/examples/basic/main.rb +29 -0
  48. data/lib/tangram.rb +1 -1
  49. data/lib/tangram/libtangram/aarch64-apple-darwin/libtangram.dylib +0 -0
  50. data/lib/tangram/libtangram/aarch64-unknown-linux-gnu/libtangram.so +0 -0
  51. data/lib/tangram/libtangram/aarch64-unknown-linux-musl/libtangram.so +0 -0
  52. data/lib/tangram/libtangram/x86_64-apple-darwin/libtangram.dylib +0 -0
  53. data/lib/tangram/libtangram/x86_64-pc-windows-msvc/tangram.dll +0 -0
  54. data/lib/tangram/libtangram/x86_64-unknown-linux-gnu/libtangram.so +0 -0
  55. data/lib/tangram/libtangram/x86_64-unknown-linux-musl/libtangram.so +0 -0
  56. data/lib/tangram/tangram.rb +895 -0
  57. data/scripts/dev +5 -0
  58. data/scripts/docs +2 -0
  59. data/scripts/fmt +0 -0
  60. data/scripts/release +13 -0
  61. data/tangram.gemspec +10 -10
  62. metadata +64 -18
  63. data/examples/monitor/heart-disease.tangram +0 -0
  64. data/examples/monitor/main.rb +0 -52
  65. data/examples/predict/heart-disease.tangram +0 -0
  66. data/examples/predict/main.rb +0 -30
  67. data/lib/tangram/libtangram-0.1.3-linux-x86_64.so +0 -0
  68. data/lib/tangram/libtangram-0.1.3-macos-x86_64.dylib +0 -0
  69. data/lib/tangram/libtangram.rb +0 -24
  70. data/lib/tangram/model.rb +0 -133
  71. data/lib/tangram/tangram-0.1.3-windows-x86_64.dll +0 -0
  72. data/scripts/build +0 -5
@@ -0,0 +1,565 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Tangram::MulticlassClassificationPredictOutput
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Tangram::MulticlassClassificationPredictOutput";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (M)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Tangram.html" title="Tangram (module)">Tangram</a></span></span>
41
+ &raquo;
42
+ <span class="title">MulticlassClassificationPredictOutput</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Tangram::MulticlassClassificationPredictOutput
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Tangram::MulticlassClassificationPredictOutput</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/tangram/tangram.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p><code>predict</code> outputs <code>MulticlassClassificationPredictOutput</code> when the model&#39;s task is multiclass classification.</p>
105
+
106
+
107
+ </div>
108
+ </div>
109
+ <div class="tags">
110
+
111
+
112
+ </div>
113
+
114
+
115
+
116
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
117
+ <ul class="summary">
118
+
119
+ <li class="public ">
120
+ <span class="summary_signature">
121
+
122
+ <a href="#class_name-instance_method" title="#class_name (instance method)">#<strong>class_name</strong> &#x21d2; Object </a>
123
+
124
+
125
+
126
+ </span>
127
+
128
+
129
+
130
+
131
+ <span class="note title readonly">readonly</span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'><p>This is the name of the predicted class.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ <li class="public ">
148
+ <span class="summary_signature">
149
+
150
+ <a href="#feature_contributions-instance_method" title="#feature_contributions (instance method)">#<strong>feature_contributions</strong> &#x21d2; Object </a>
151
+
152
+
153
+
154
+ </span>
155
+
156
+
157
+
158
+
159
+ <span class="note title readonly">readonly</span>
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <span class="summary_desc"><div class='inline'><p>If computing feature contributions was enabled in the predict options, this value will explain the model&#39;s output, showing how much each feature contributed to the output.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ <li class="public ">
176
+ <span class="summary_signature">
177
+
178
+ <a href="#probabilities-instance_method" title="#probabilities (instance method)">#<strong>probabilities</strong> &#x21d2; Object </a>
179
+
180
+
181
+
182
+ </span>
183
+
184
+
185
+
186
+
187
+ <span class="note title readonly">readonly</span>
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <span class="summary_desc"><div class='inline'><p>This value maps from class names to the probability the model assigned to each class.</p>
198
+ </div></span>
199
+
200
+ </li>
201
+
202
+
203
+ <li class="public ">
204
+ <span class="summary_signature">
205
+
206
+ <a href="#probability-instance_method" title="#probability (instance method)">#<strong>probability</strong> &#x21d2; Object </a>
207
+
208
+
209
+
210
+ </span>
211
+
212
+
213
+
214
+
215
+ <span class="note title readonly">readonly</span>
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+ <span class="summary_desc"><div class='inline'><p>This is the probability the model assigned to the predicted class.</p>
226
+ </div></span>
227
+
228
+ </li>
229
+
230
+
231
+ </ul>
232
+
233
+
234
+
235
+
236
+
237
+ <h2>
238
+ Instance Method Summary
239
+ <small><a href="#" class="summary_toggle">collapse</a></small>
240
+ </h2>
241
+
242
+ <ul class="summary">
243
+
244
+ <li class="public ">
245
+ <span class="summary_signature">
246
+
247
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(class_name:, probability:, probabilities:, feature_contributions:) &#x21d2; MulticlassClassificationPredictOutput </a>
248
+
249
+
250
+
251
+ </span>
252
+
253
+
254
+ <span class="note title constructor">constructor</span>
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <span class="summary_desc"><div class='inline'><p>A new instance of MulticlassClassificationPredictOutput.</p>
264
+ </div></span>
265
+
266
+ </li>
267
+
268
+
269
+ <li class="public ">
270
+ <span class="summary_signature">
271
+
272
+ <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong>(*args) &#x21d2; Object </a>
273
+
274
+
275
+
276
+ </span>
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+ <span class="summary_desc"><div class='inline'></div></span>
287
+
288
+ </li>
289
+
290
+
291
+ </ul>
292
+
293
+
294
+ <div id="constructor_details" class="method_details_list">
295
+ <h2>Constructor Details</h2>
296
+
297
+ <div class="method_details first">
298
+ <h3 class="signature first" id="initialize-instance_method">
299
+
300
+ #<strong>initialize</strong>(class_name:, probability:, probabilities:, feature_contributions:) &#x21d2; <tt><span class='object_link'><a href="" title="Tangram::MulticlassClassificationPredictOutput (class)">MulticlassClassificationPredictOutput</a></span></tt>
301
+
302
+
303
+
304
+
305
+
306
+ </h3><div class="docstring">
307
+ <div class="discussion">
308
+ <p>Returns a new instance of MulticlassClassificationPredictOutput.</p>
309
+
310
+
311
+ </div>
312
+ </div>
313
+ <div class="tags">
314
+
315
+
316
+ </div><table class="source_code">
317
+ <tr>
318
+ <td>
319
+ <pre class="lines">
320
+
321
+
322
+ 77
323
+ 78
324
+ 79
325
+ 80
326
+ 81
327
+ 82</pre>
328
+ </td>
329
+ <td>
330
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 77</span>
331
+
332
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>class_name:</span><span class='comma'>,</span> <span class='label'>probability:</span><span class='comma'>,</span> <span class='label'>probabilities:</span><span class='comma'>,</span> <span class='label'>feature_contributions:</span><span class='rparen'>)</span>
333
+ <span class='ivar'>@class_name</span> <span class='op'>=</span> <span class='id identifier rubyid_class_name'>class_name</span>
334
+ <span class='ivar'>@probability</span> <span class='op'>=</span> <span class='id identifier rubyid_probability'>probability</span>
335
+ <span class='ivar'>@probabilities</span> <span class='op'>=</span> <span class='id identifier rubyid_probabilities'>probabilities</span>
336
+ <span class='ivar'>@feature_contributions</span> <span class='op'>=</span> <span class='id identifier rubyid_feature_contributions'>feature_contributions</span>
337
+ <span class='kw'>end</span></pre>
338
+ </td>
339
+ </tr>
340
+ </table>
341
+ </div>
342
+
343
+ </div>
344
+
345
+ <div id="instance_attr_details" class="attr_details">
346
+ <h2>Instance Attribute Details</h2>
347
+
348
+
349
+ <span id=""></span>
350
+ <div class="method_details first">
351
+ <h3 class="signature first" id="class_name-instance_method">
352
+
353
+ #<strong>class_name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
354
+
355
+
356
+
357
+
358
+
359
+ </h3><div class="docstring">
360
+ <div class="discussion">
361
+ <p>This is the name of the predicted class.</p>
362
+
363
+
364
+ </div>
365
+ </div>
366
+ <div class="tags">
367
+
368
+
369
+ </div><table class="source_code">
370
+ <tr>
371
+ <td>
372
+ <pre class="lines">
373
+
374
+
375
+ 70
376
+ 71
377
+ 72</pre>
378
+ </td>
379
+ <td>
380
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 70</span>
381
+
382
+ <span class='kw'>def</span> <span class='id identifier rubyid_class_name'>class_name</span>
383
+ <span class='ivar'>@class_name</span>
384
+ <span class='kw'>end</span></pre>
385
+ </td>
386
+ </tr>
387
+ </table>
388
+ </div>
389
+
390
+
391
+ <span id=""></span>
392
+ <div class="method_details ">
393
+ <h3 class="signature " id="feature_contributions-instance_method">
394
+
395
+ #<strong>feature_contributions</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
396
+
397
+
398
+
399
+
400
+
401
+ </h3><div class="docstring">
402
+ <div class="discussion">
403
+ <p>If computing feature contributions was enabled in the predict options, this value will explain the model&#39;s output, showing how much each feature contributed to the output. This value maps from class names to <code>FeatureContributions</code> values for each class. The class with the <code>FeatureContributions</code> value with the highest <code>output_value</code> is the predicted class.</p>
404
+
405
+
406
+ </div>
407
+ </div>
408
+ <div class="tags">
409
+
410
+
411
+ </div><table class="source_code">
412
+ <tr>
413
+ <td>
414
+ <pre class="lines">
415
+
416
+
417
+ 76
418
+ 77
419
+ 78</pre>
420
+ </td>
421
+ <td>
422
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 76</span>
423
+
424
+ <span class='kw'>def</span> <span class='id identifier rubyid_feature_contributions'>feature_contributions</span>
425
+ <span class='ivar'>@feature_contributions</span>
426
+ <span class='kw'>end</span></pre>
427
+ </td>
428
+ </tr>
429
+ </table>
430
+ </div>
431
+
432
+
433
+ <span id=""></span>
434
+ <div class="method_details ">
435
+ <h3 class="signature " id="probabilities-instance_method">
436
+
437
+ #<strong>probabilities</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
438
+
439
+
440
+
441
+
442
+
443
+ </h3><div class="docstring">
444
+ <div class="discussion">
445
+ <p>This value maps from class names to the probability the model assigned to each class.</p>
446
+
447
+
448
+ </div>
449
+ </div>
450
+ <div class="tags">
451
+
452
+
453
+ </div><table class="source_code">
454
+ <tr>
455
+ <td>
456
+ <pre class="lines">
457
+
458
+
459
+ 74
460
+ 75
461
+ 76</pre>
462
+ </td>
463
+ <td>
464
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 74</span>
465
+
466
+ <span class='kw'>def</span> <span class='id identifier rubyid_probabilities'>probabilities</span>
467
+ <span class='ivar'>@probabilities</span>
468
+ <span class='kw'>end</span></pre>
469
+ </td>
470
+ </tr>
471
+ </table>
472
+ </div>
473
+
474
+
475
+ <span id=""></span>
476
+ <div class="method_details ">
477
+ <h3 class="signature " id="probability-instance_method">
478
+
479
+ #<strong>probability</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
480
+
481
+
482
+
483
+
484
+
485
+ </h3><div class="docstring">
486
+ <div class="discussion">
487
+ <p>This is the probability the model assigned to the predicted class.</p>
488
+
489
+
490
+ </div>
491
+ </div>
492
+ <div class="tags">
493
+
494
+
495
+ </div><table class="source_code">
496
+ <tr>
497
+ <td>
498
+ <pre class="lines">
499
+
500
+
501
+ 72
502
+ 73
503
+ 74</pre>
504
+ </td>
505
+ <td>
506
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 72</span>
507
+
508
+ <span class='kw'>def</span> <span class='id identifier rubyid_probability'>probability</span>
509
+ <span class='ivar'>@probability</span>
510
+ <span class='kw'>end</span></pre>
511
+ </td>
512
+ </tr>
513
+ </table>
514
+ </div>
515
+
516
+ </div>
517
+
518
+
519
+ <div id="instance_method_details" class="method_details_list">
520
+ <h2>Instance Method Details</h2>
521
+
522
+
523
+ <div class="method_details first">
524
+ <h3 class="signature first" id="to_json-instance_method">
525
+
526
+ #<strong>to_json</strong>(*args) &#x21d2; <tt>Object</tt>
527
+
528
+
529
+
530
+
531
+
532
+ </h3><table class="source_code">
533
+ <tr>
534
+ <td>
535
+ <pre class="lines">
536
+
537
+
538
+ 83
539
+ 84
540
+ 85</pre>
541
+ </td>
542
+ <td>
543
+ <pre class="code"><span class="info file"># File 'lib/tangram/tangram.rb', line 83</span>
544
+
545
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
546
+ <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>class_name</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='ivar'>@class_name</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>probability</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='ivar'>@probability</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>probabilities</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='ivar'>@probabilities</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
547
+ <span class='kw'>end</span></pre>
548
+ </td>
549
+ </tr>
550
+ </table>
551
+ </div>
552
+
553
+ </div>
554
+
555
+ </div>
556
+
557
+ <div id="footer">
558
+ Generated on Thu Jul 15 14:34:34 2021 by
559
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
560
+ 0.9.26 (ruby-2.7.3).
561
+ </div>
562
+
563
+ </div>
564
+ </body>
565
+ </html>