tangram 0.4.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -30
- data/docs/Tangram.html +5 -4
- data/docs/Tangram/BagOfWordsCosineSimilarityFeatureContribution.html +518 -0
- data/docs/Tangram/BagOfWordsFeatureContribution.html +24 -13
- data/docs/Tangram/Bigram.html +16 -9
- data/docs/Tangram/BinaryClassificationPredictOutput.html +20 -11
- data/docs/Tangram/FeatureContributions.html +20 -11
- data/docs/Tangram/IdentityFeatureContribution.html +20 -11
- data/docs/Tangram/LibTangram.html +3 -2
- data/docs/Tangram/LibTangram/TangramStringView.html +6 -6
- data/docs/Tangram/LoadModelOptions.html +12 -7
- data/docs/Tangram/Model.html +173 -133
- data/docs/Tangram/MulticlassClassificationPredictOutput.html +24 -13
- data/docs/Tangram/NormalizedFeatureContribution.html +20 -11
- data/docs/Tangram/OneHotEncodedFeatureContribution.html +24 -13
- data/docs/Tangram/PredictOptions.html +16 -9
- data/docs/Tangram/RegressionPredictOutput.html +16 -9
- data/docs/Tangram/Unigram.html +12 -7
- data/docs/Tangram/WordEmbeddingFeatureContribution.html +38 -29
- data/docs/_index.html +9 -2
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +16 -37
- data/docs/index.html +16 -37
- data/docs/method_list.html +69 -29
- data/docs/top-level-namespace.html +2 -2
- data/examples/advanced/Gemfile +2 -0
- data/examples/advanced/Gemfile.lock +15 -0
- data/examples/advanced/README.md +14 -0
- data/examples/{heart_disease.tangram → advanced/heart_disease.tangram} +0 -0
- data/examples/{advanced.rb → advanced/main.rb} +1 -1
- data/examples/basic/Gemfile +2 -0
- data/examples/basic/Gemfile.lock +15 -0
- data/examples/basic/README.md +10 -0
- data/examples/basic/heart_disease.tangram +0 -0
- data/examples/{basic.rb → basic/main.rb} +0 -0
- data/lib/tangram/libtangram/aarch64-apple-darwin/libtangram.dylib +0 -0
- data/lib/tangram/libtangram/aarch64-unknown-linux-gnu/libtangram.so +0 -0
- data/lib/tangram/libtangram/aarch64-unknown-linux-musl/libtangram.so +0 -0
- data/lib/tangram/libtangram/x86_64-apple-darwin/libtangram.dylib +0 -0
- data/lib/tangram/libtangram/x86_64-pc-windows-msvc/tangram.dll +0 -0
- data/lib/tangram/libtangram/x86_64-unknown-linux-gnu/libtangram.so +0 -0
- data/lib/tangram/libtangram/x86_64-unknown-linux-musl/libtangram.so +0 -0
- data/lib/tangram/tangram.rb +9 -9
- data/scripts/release +8 -0
- data/tangram.gemspec +4 -4
- metadata +16 -8
@@ -101,7 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
104
|
+
|
105
|
+
<p>This describes the contribution of a feature from a bag of words feature group.</p>
|
105
106
|
|
106
107
|
|
107
108
|
</div>
|
@@ -138,7 +139,8 @@
|
|
138
139
|
|
139
140
|
|
140
141
|
|
141
|
-
<span class="summary_desc"><div class='inline'
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>This is the name of the source column for the feature group.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -166,7 +168,8 @@
|
|
166
168
|
|
167
169
|
|
168
170
|
|
169
|
-
<span class="summary_desc"><div class='inline'
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>This is the amount that the feature contributed to the output.</p>
|
170
173
|
</div></span>
|
171
174
|
|
172
175
|
</li>
|
@@ -194,7 +197,8 @@
|
|
194
197
|
|
195
198
|
|
196
199
|
|
197
|
-
<span class="summary_desc"><div class='inline'
|
200
|
+
<span class="summary_desc"><div class='inline'>
|
201
|
+
<p>This is the value of the feature.</p>
|
198
202
|
</div></span>
|
199
203
|
|
200
204
|
</li>
|
@@ -222,7 +226,8 @@
|
|
222
226
|
|
223
227
|
|
224
228
|
|
225
|
-
<span class="summary_desc"><div class='inline'
|
229
|
+
<span class="summary_desc"><div class='inline'>
|
230
|
+
<p>This is the ngram for the feature.</p>
|
226
231
|
</div></span>
|
227
232
|
|
228
233
|
</li>
|
@@ -260,7 +265,8 @@
|
|
260
265
|
|
261
266
|
|
262
267
|
|
263
|
-
<span class="summary_desc"><div class='inline'
|
268
|
+
<span class="summary_desc"><div class='inline'>
|
269
|
+
<p>A new instance of BagOfWordsFeatureContribution.</p>
|
264
270
|
</div></span>
|
265
271
|
|
266
272
|
</li>
|
@@ -283,7 +289,8 @@
|
|
283
289
|
|
284
290
|
</h3><div class="docstring">
|
285
291
|
<div class="discussion">
|
286
|
-
|
292
|
+
|
293
|
+
<p>Returns a new instance of BagOfWordsFeatureContribution.</p>
|
287
294
|
|
288
295
|
|
289
296
|
</div>
|
@@ -336,7 +343,8 @@
|
|
336
343
|
|
337
344
|
</h3><div class="docstring">
|
338
345
|
<div class="discussion">
|
339
|
-
|
346
|
+
|
347
|
+
<p>This is the name of the source column for the feature group.</p>
|
340
348
|
|
341
349
|
|
342
350
|
</div>
|
@@ -378,7 +386,8 @@
|
|
378
386
|
|
379
387
|
</h3><div class="docstring">
|
380
388
|
<div class="discussion">
|
381
|
-
|
389
|
+
|
390
|
+
<p>This is the amount that the feature contributed to the output.</p>
|
382
391
|
|
383
392
|
|
384
393
|
</div>
|
@@ -420,7 +429,8 @@
|
|
420
429
|
|
421
430
|
</h3><div class="docstring">
|
422
431
|
<div class="discussion">
|
423
|
-
|
432
|
+
|
433
|
+
<p>This is the value of the feature.</p>
|
424
434
|
|
425
435
|
|
426
436
|
</div>
|
@@ -462,7 +472,8 @@
|
|
462
472
|
|
463
473
|
</h3><div class="docstring">
|
464
474
|
<div class="discussion">
|
465
|
-
|
475
|
+
|
476
|
+
<p>This is the ngram for the feature.</p>
|
466
477
|
|
467
478
|
|
468
479
|
</div>
|
@@ -497,9 +508,9 @@
|
|
497
508
|
</div>
|
498
509
|
|
499
510
|
<div id="footer">
|
500
|
-
Generated on
|
511
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
501
512
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
502
|
-
0.9.26 (ruby-2.
|
513
|
+
0.9.26 (ruby-2.7.4).
|
503
514
|
</div>
|
504
515
|
|
505
516
|
</div>
|
data/docs/Tangram/Bigram.html
CHANGED
@@ -101,7 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
104
|
+
|
105
|
+
<p>This describes a bigram ngram.</p>
|
105
106
|
|
106
107
|
|
107
108
|
</div>
|
@@ -138,7 +139,8 @@
|
|
138
139
|
|
139
140
|
|
140
141
|
|
141
|
-
<span class="summary_desc"><div class='inline'
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>This is the first token in the bigram.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -166,7 +168,8 @@
|
|
166
168
|
|
167
169
|
|
168
170
|
|
169
|
-
<span class="summary_desc"><div class='inline'
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>This is the second token in the bigram.</p>
|
170
173
|
</div></span>
|
171
174
|
|
172
175
|
</li>
|
@@ -204,7 +207,8 @@
|
|
204
207
|
|
205
208
|
|
206
209
|
|
207
|
-
<span class="summary_desc"><div class='inline'
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>A new instance of Bigram.</p>
|
208
212
|
</div></span>
|
209
213
|
|
210
214
|
</li>
|
@@ -227,7 +231,8 @@
|
|
227
231
|
|
228
232
|
</h3><div class="docstring">
|
229
233
|
<div class="discussion">
|
230
|
-
|
234
|
+
|
235
|
+
<p>Returns a new instance of Bigram.</p>
|
231
236
|
|
232
237
|
|
233
238
|
</div>
|
@@ -276,7 +281,8 @@
|
|
276
281
|
|
277
282
|
</h3><div class="docstring">
|
278
283
|
<div class="discussion">
|
279
|
-
|
284
|
+
|
285
|
+
<p>This is the first token in the bigram.</p>
|
280
286
|
|
281
287
|
|
282
288
|
</div>
|
@@ -318,7 +324,8 @@
|
|
318
324
|
|
319
325
|
</h3><div class="docstring">
|
320
326
|
<div class="discussion">
|
321
|
-
|
327
|
+
|
328
|
+
<p>This is the second token in the bigram.</p>
|
322
329
|
|
323
330
|
|
324
331
|
</div>
|
@@ -353,9 +360,9 @@
|
|
353
360
|
</div>
|
354
361
|
|
355
362
|
<div id="footer">
|
356
|
-
Generated on
|
363
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
357
364
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
358
|
-
0.9.26 (ruby-2.
|
365
|
+
0.9.26 (ruby-2.7.4).
|
359
366
|
</div>
|
360
367
|
|
361
368
|
</div>
|
@@ -101,7 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
104
|
+
|
105
|
+
<p><code>predict</code> outputs <code>BinaryClassificationPredictOutput</code> when the model's task is binary classification.</p>
|
105
106
|
|
106
107
|
|
107
108
|
</div>
|
@@ -138,7 +139,8 @@
|
|
138
139
|
|
139
140
|
|
140
141
|
|
141
|
-
<span class="summary_desc"><div class='inline'
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>This is the name of the predicted class.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -166,7 +168,8 @@
|
|
166
168
|
|
167
169
|
|
168
170
|
|
169
|
-
<span class="summary_desc"><div class='inline'
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>If computing feature contributions was enabled in the predict options, this value will explain the model's output, showing how much each feature contributed to the output.</p>
|
170
173
|
</div></span>
|
171
174
|
|
172
175
|
</li>
|
@@ -194,7 +197,8 @@
|
|
194
197
|
|
195
198
|
|
196
199
|
|
197
|
-
<span class="summary_desc"><div class='inline'
|
200
|
+
<span class="summary_desc"><div class='inline'>
|
201
|
+
<p>This is the probability the model assigned to the predicted class.</p>
|
198
202
|
</div></span>
|
199
203
|
|
200
204
|
</li>
|
@@ -232,7 +236,8 @@
|
|
232
236
|
|
233
237
|
|
234
238
|
|
235
|
-
<span class="summary_desc"><div class='inline'
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
240
|
+
<p>A new instance of BinaryClassificationPredictOutput.</p>
|
236
241
|
</div></span>
|
237
242
|
|
238
243
|
</li>
|
@@ -277,7 +282,8 @@
|
|
277
282
|
|
278
283
|
</h3><div class="docstring">
|
279
284
|
<div class="discussion">
|
280
|
-
|
285
|
+
|
286
|
+
<p>Returns a new instance of BinaryClassificationPredictOutput.</p>
|
281
287
|
|
282
288
|
|
283
289
|
</div>
|
@@ -328,7 +334,8 @@
|
|
328
334
|
|
329
335
|
</h3><div class="docstring">
|
330
336
|
<div class="discussion">
|
331
|
-
|
337
|
+
|
338
|
+
<p>This is the name of the predicted class.</p>
|
332
339
|
|
333
340
|
|
334
341
|
</div>
|
@@ -370,7 +377,8 @@
|
|
370
377
|
|
371
378
|
</h3><div class="docstring">
|
372
379
|
<div class="discussion">
|
373
|
-
|
380
|
+
|
381
|
+
<p>If computing feature contributions was enabled in the predict options, this value will explain the model's output, showing how much each feature contributed to the output.</p>
|
374
382
|
|
375
383
|
|
376
384
|
</div>
|
@@ -412,7 +420,8 @@
|
|
412
420
|
|
413
421
|
</h3><div class="docstring">
|
414
422
|
<div class="discussion">
|
415
|
-
|
423
|
+
|
424
|
+
<p>This is the probability the model assigned to the predicted class.</p>
|
416
425
|
|
417
426
|
|
418
427
|
</div>
|
@@ -483,9 +492,9 @@
|
|
483
492
|
</div>
|
484
493
|
|
485
494
|
<div id="footer">
|
486
|
-
Generated on
|
495
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
487
496
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
488
|
-
0.9.26 (ruby-2.
|
497
|
+
0.9.26 (ruby-2.7.4).
|
489
498
|
</div>
|
490
499
|
|
491
500
|
</div>
|
@@ -101,7 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
104
|
+
|
105
|
+
<p>This is a description of the feature contributions for the prediction if the task is regression or binary classification, or for a single class if the task is multiclass classification.</p>
|
105
106
|
|
106
107
|
|
107
108
|
</div>
|
@@ -138,7 +139,8 @@
|
|
138
139
|
|
139
140
|
|
140
141
|
|
141
|
-
<span class="summary_desc"><div class='inline'
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>This is the value the model would output if all features had baseline values.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -166,7 +168,8 @@
|
|
166
168
|
|
167
169
|
|
168
170
|
|
169
|
-
<span class="summary_desc"><div class='inline'
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>This list will contain one entry for each of the model's features.</p>
|
170
173
|
</div></span>
|
171
174
|
|
172
175
|
</li>
|
@@ -194,7 +197,8 @@
|
|
194
197
|
|
195
198
|
|
196
199
|
|
197
|
-
<span class="summary_desc"><div class='inline'
|
200
|
+
<span class="summary_desc"><div class='inline'>
|
201
|
+
<p>This is the value the model output.</p>
|
198
202
|
</div></span>
|
199
203
|
|
200
204
|
</li>
|
@@ -232,7 +236,8 @@
|
|
232
236
|
|
233
237
|
|
234
238
|
|
235
|
-
<span class="summary_desc"><div class='inline'
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
240
|
+
<p>A new instance of FeatureContributions.</p>
|
236
241
|
</div></span>
|
237
242
|
|
238
243
|
</li>
|
@@ -255,7 +260,8 @@
|
|
255
260
|
|
256
261
|
</h3><div class="docstring">
|
257
262
|
<div class="discussion">
|
258
|
-
|
263
|
+
|
264
|
+
<p>Returns a new instance of FeatureContributions.</p>
|
259
265
|
|
260
266
|
|
261
267
|
</div>
|
@@ -306,7 +312,8 @@
|
|
306
312
|
|
307
313
|
</h3><div class="docstring">
|
308
314
|
<div class="discussion">
|
309
|
-
|
315
|
+
|
316
|
+
<p>This is the value the model would output if all features had baseline values.</p>
|
310
317
|
|
311
318
|
|
312
319
|
</div>
|
@@ -348,7 +355,8 @@
|
|
348
355
|
|
349
356
|
</h3><div class="docstring">
|
350
357
|
<div class="discussion">
|
351
|
-
|
358
|
+
|
359
|
+
<p>This list will contain one entry for each of the model's features. Note that features are computed from columns, so there will likely be more features than columns.</p>
|
352
360
|
|
353
361
|
|
354
362
|
</div>
|
@@ -390,7 +398,8 @@
|
|
390
398
|
|
391
399
|
</h3><div class="docstring">
|
392
400
|
<div class="discussion">
|
393
|
-
|
401
|
+
|
402
|
+
<p>This is the value the model output. Any difference from the <code>baseline_value</code> is because of the deviation of the features from their baseline values.</p>
|
394
403
|
|
395
404
|
|
396
405
|
</div>
|
@@ -425,9 +434,9 @@
|
|
425
434
|
</div>
|
426
435
|
|
427
436
|
<div id="footer">
|
428
|
-
Generated on
|
437
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
429
438
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
430
|
-
0.9.26 (ruby-2.
|
439
|
+
0.9.26 (ruby-2.7.4).
|
431
440
|
</div>
|
432
441
|
|
433
442
|
</div>
|
@@ -101,7 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
104
|
+
|
105
|
+
<p>This describes the contribution of a feature from an identity feature group.</p>
|
105
106
|
|
106
107
|
|
107
108
|
</div>
|
@@ -138,7 +139,8 @@
|
|
138
139
|
|
139
140
|
|
140
141
|
|
141
|
-
<span class="summary_desc"><div class='inline'
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>This is the name of the source column for the feature group.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -166,7 +168,8 @@
|
|
166
168
|
|
167
169
|
|
168
170
|
|
169
|
-
<span class="summary_desc"><div class='inline'
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>This is the amount that the feature contributed to the output.</p>
|
170
173
|
</div></span>
|
171
174
|
|
172
175
|
</li>
|
@@ -194,7 +197,8 @@
|
|
194
197
|
|
195
198
|
|
196
199
|
|
197
|
-
<span class="summary_desc"><div class='inline'
|
200
|
+
<span class="summary_desc"><div class='inline'>
|
201
|
+
<p>This is the value of the feature.</p>
|
198
202
|
</div></span>
|
199
203
|
|
200
204
|
</li>
|
@@ -232,7 +236,8 @@
|
|
232
236
|
|
233
237
|
|
234
238
|
|
235
|
-
<span class="summary_desc"><div class='inline'
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
240
|
+
<p>A new instance of IdentityFeatureContribution.</p>
|
236
241
|
</div></span>
|
237
242
|
|
238
243
|
</li>
|
@@ -255,7 +260,8 @@
|
|
255
260
|
|
256
261
|
</h3><div class="docstring">
|
257
262
|
<div class="discussion">
|
258
|
-
|
263
|
+
|
264
|
+
<p>Returns a new instance of IdentityFeatureContribution.</p>
|
259
265
|
|
260
266
|
|
261
267
|
</div>
|
@@ -306,7 +312,8 @@
|
|
306
312
|
|
307
313
|
</h3><div class="docstring">
|
308
314
|
<div class="discussion">
|
309
|
-
|
315
|
+
|
316
|
+
<p>This is the name of the source column for the feature group.</p>
|
310
317
|
|
311
318
|
|
312
319
|
</div>
|
@@ -348,7 +355,8 @@
|
|
348
355
|
|
349
356
|
</h3><div class="docstring">
|
350
357
|
<div class="discussion">
|
351
|
-
|
358
|
+
|
359
|
+
<p>This is the amount that the feature contributed to the output.</p>
|
352
360
|
|
353
361
|
|
354
362
|
</div>
|
@@ -390,7 +398,8 @@
|
|
390
398
|
|
391
399
|
</h3><div class="docstring">
|
392
400
|
<div class="discussion">
|
393
|
-
|
401
|
+
|
402
|
+
<p>This is the value of the feature.</p>
|
394
403
|
|
395
404
|
|
396
405
|
</div>
|
@@ -425,9 +434,9 @@
|
|
425
434
|
</div>
|
426
435
|
|
427
436
|
<div id="footer">
|
428
|
-
Generated on
|
437
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
429
438
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
430
|
-
0.9.26 (ruby-2.
|
439
|
+
0.9.26 (ruby-2.7.4).
|
431
440
|
</div>
|
432
441
|
|
433
442
|
</div>
|