tangram 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/docs/Tangram.html +4 -3
- data/docs/Tangram/BagOfWordsCosineSimilarityFeatureContribution.html +24 -13
- 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 +2 -2
- data/docs/Tangram/LibTangram/TangramStringView.html +2 -2
- data/docs/Tangram/LoadModelOptions.html +12 -7
- data/docs/Tangram/Model.html +83 -43
- 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 +20 -11
- data/docs/_index.html +2 -2
- data/docs/file.README.html +14 -13
- data/docs/index.html +14 -13
- data/docs/top-level-namespace.html +2 -2
- data/examples/advanced/README.md +1 -1
- data/examples/advanced/main.rb +1 -1
- 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 +4 -4
- data/tangram.gemspec +4 -4
- metadata +4 -4
data/docs/Tangram/Unigram.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 unigram 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 token.</p>
|
142
144
|
</div></span>
|
143
145
|
|
144
146
|
</li>
|
@@ -176,7 +178,8 @@
|
|
176
178
|
|
177
179
|
|
178
180
|
|
179
|
-
<span class="summary_desc"><div class='inline'
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
182
|
+
<p>A new instance of Unigram.</p>
|
180
183
|
</div></span>
|
181
184
|
|
182
185
|
</li>
|
@@ -199,7 +202,8 @@
|
|
199
202
|
|
200
203
|
</h3><div class="docstring">
|
201
204
|
<div class="discussion">
|
202
|
-
|
205
|
+
|
206
|
+
<p>Returns a new instance of Unigram.</p>
|
203
207
|
|
204
208
|
|
205
209
|
</div>
|
@@ -246,7 +250,8 @@
|
|
246
250
|
|
247
251
|
</h3><div class="docstring">
|
248
252
|
<div class="discussion">
|
249
|
-
|
253
|
+
|
254
|
+
<p>This is the token.</p>
|
250
255
|
|
251
256
|
|
252
257
|
</div>
|
@@ -281,9 +286,9 @@
|
|
281
286
|
</div>
|
282
287
|
|
283
288
|
<div id="footer">
|
284
|
-
Generated on
|
289
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
285
290
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
286
|
-
0.9.26 (ruby-2.7.
|
291
|
+
0.9.26 (ruby-2.7.4).
|
287
292
|
</div>
|
288
293
|
|
289
294
|
</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 a word embedding 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 index of the feature in the word embedding.</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 WordEmbeddingFeatureContribution.</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 WordEmbeddingFeatureContribution.</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 index of the feature in the word embedding.</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.7.
|
439
|
+
0.9.26 (ruby-2.7.4).
|
431
440
|
</div>
|
432
441
|
|
433
442
|
</div>
|
data/docs/_index.html
CHANGED
@@ -307,9 +307,9 @@
|
|
307
307
|
</div>
|
308
308
|
|
309
309
|
<div id="footer">
|
310
|
-
Generated on
|
310
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
311
311
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
312
|
-
0.9.26 (ruby-2.7.
|
312
|
+
0.9.26 (ruby-2.7.4).
|
313
313
|
</div>
|
314
314
|
|
315
315
|
</div>
|
data/docs/file.README.html
CHANGED
@@ -57,16 +57,17 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'
|
61
|
-
|
62
|
-
<ul>
|
63
|
-
<
|
64
|
-
|
65
|
-
</
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Tangram+for+Ruby">Tangram for Ruby</h1>
|
62
|
+
<ul><li>
|
63
|
+
<p><a href="https://www.tangram.dev">Watch the Video</a></p>
|
64
|
+
</li><li>
|
65
|
+
<p><a href="https://www.tangram.dev/docs">Read the Docs</a></p>
|
66
|
+
</li></ul>
|
66
67
|
|
67
68
|
<p>The Tangram Ruby library makes it easy to make predictions with your Tangram machine learning model from Ruby.</p>
|
68
69
|
|
69
|
-
<h2 id="
|
70
|
+
<h2 id="label-Usage">Usage</h2>
|
70
71
|
|
71
72
|
<pre class="code ruby"><code class="ruby">$ gem install tangram
|
72
73
|
</code></pre>
|
@@ -84,21 +85,21 @@
|
|
84
85
|
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_predict'>predict</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
85
86
|
</code></pre>
|
86
87
|
|
87
|
-
<p>For more information, <a href="https://www.tangram.
|
88
|
+
<p>For more information, <a href="https://www.tangram.dev/docs">read the docs</a>.</p>
|
88
89
|
|
89
|
-
<h2 id="
|
90
|
+
<h2 id="label-Platform+Support">Platform Support</h2>
|
90
91
|
|
91
|
-
<p>Tangram for Ruby is currently supported on Linux, macOS, and Windows with ARM64 and AMD64 CPUs. Are you interested in another platform? <a href="https://github.com/
|
92
|
+
<p>Tangram for Ruby is currently supported on Linux, macOS, and Windows with ARM64 and AMD64 CPUs. Are you interested in another platform? <a href="https://github.com/tangramdotdev/tangram/issues/new">Open an issue</a> or send us an email at <a href="mailto:help@tangram.dev">help@tangram.dev</a>.</p>
|
92
93
|
|
93
|
-
<h2 id="
|
94
|
+
<h2 id="label-Examples">Examples</h2>
|
94
95
|
|
95
96
|
<p>The source for this package contains a number of examples in the <code>examples</code> directory. Each example has a <code>README.md</code> explaining how to run it.</p>
|
96
97
|
</div></div>
|
97
98
|
|
98
99
|
<div id="footer">
|
99
|
-
Generated on
|
100
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
100
101
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
101
|
-
0.9.26 (ruby-2.7.
|
102
|
+
0.9.26 (ruby-2.7.4).
|
102
103
|
</div>
|
103
104
|
|
104
105
|
</div>
|
data/docs/index.html
CHANGED
@@ -57,16 +57,17 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'
|
61
|
-
|
62
|
-
<ul>
|
63
|
-
<
|
64
|
-
|
65
|
-
</
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Tangram+for+Ruby">Tangram for Ruby</h1>
|
62
|
+
<ul><li>
|
63
|
+
<p><a href="https://www.tangram.dev">Watch the Video</a></p>
|
64
|
+
</li><li>
|
65
|
+
<p><a href="https://www.tangram.dev/docs">Read the Docs</a></p>
|
66
|
+
</li></ul>
|
66
67
|
|
67
68
|
<p>The Tangram Ruby library makes it easy to make predictions with your Tangram machine learning model from Ruby.</p>
|
68
69
|
|
69
|
-
<h2 id="
|
70
|
+
<h2 id="label-Usage">Usage</h2>
|
70
71
|
|
71
72
|
<pre class="code ruby"><code class="ruby">$ gem install tangram
|
72
73
|
</code></pre>
|
@@ -84,21 +85,21 @@
|
|
84
85
|
<span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='id identifier rubyid_model'>model</span><span class='period'>.</span><span class='id identifier rubyid_predict'>predict</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
|
85
86
|
</code></pre>
|
86
87
|
|
87
|
-
<p>For more information, <a href="https://www.tangram.
|
88
|
+
<p>For more information, <a href="https://www.tangram.dev/docs">read the docs</a>.</p>
|
88
89
|
|
89
|
-
<h2 id="
|
90
|
+
<h2 id="label-Platform+Support">Platform Support</h2>
|
90
91
|
|
91
|
-
<p>Tangram for Ruby is currently supported on Linux, macOS, and Windows with ARM64 and AMD64 CPUs. Are you interested in another platform? <a href="https://github.com/
|
92
|
+
<p>Tangram for Ruby is currently supported on Linux, macOS, and Windows with ARM64 and AMD64 CPUs. Are you interested in another platform? <a href="https://github.com/tangramdotdev/tangram/issues/new">Open an issue</a> or send us an email at <a href="mailto:help@tangram.dev">help@tangram.dev</a>.</p>
|
92
93
|
|
93
|
-
<h2 id="
|
94
|
+
<h2 id="label-Examples">Examples</h2>
|
94
95
|
|
95
96
|
<p>The source for this package contains a number of examples in the <code>examples</code> directory. Each example has a <code>README.md</code> explaining how to run it.</p>
|
96
97
|
</div></div>
|
97
98
|
|
98
99
|
<div id="footer">
|
99
|
-
Generated on
|
100
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
100
101
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
101
|
-
0.9.26 (ruby-2.7.
|
102
|
+
0.9.26 (ruby-2.7.4).
|
102
103
|
</div>
|
103
104
|
|
104
105
|
</div>
|
@@ -100,9 +100,9 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on
|
103
|
+
Generated on Mon Jul 26 14:54:00 2021 by
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
|
-
0.9.26 (ruby-2.7.
|
105
|
+
0.9.26 (ruby-2.7.4).
|
106
106
|
</div>
|
107
107
|
|
108
108
|
</div>
|
data/examples/advanced/README.md
CHANGED
@@ -11,4 +11,4 @@ $ TANGRAM_URL=http://localhost:8080 ruby main.rb
|
|
11
11
|
|
12
12
|
Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values.
|
13
13
|
|
14
|
-
For more information, [read the docs](https://www.tangram.
|
14
|
+
For more information, [read the docs](https://www.tangram.dev/docs).
|
data/examples/advanced/main.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'tangram'
|
2
2
|
|
3
3
|
# If you are running the Tangram app on your own server you can pass the URL to it with the TANGRAM_URL environment variable.
|
4
|
-
tangram_url = ENV['TANGRAM_URL'] || 'https://app.tangram.
|
4
|
+
tangram_url = ENV['TANGRAM_URL'] || 'https://app.tangram.dev'
|
5
5
|
|
6
6
|
# Get the path to the `.tangram` file.
|
7
7
|
model_path = File.join(File.dirname(__FILE__), 'heart_disease.tangram')
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/tangram/tangram.rb
CHANGED
@@ -9,7 +9,7 @@ module Tangram
|
|
9
9
|
|
10
10
|
# These are the options passed when loading a model.
|
11
11
|
class LoadModelOptions
|
12
|
-
# If you are running the app locally or on your own server, use this field to provide the url to it. If not specified, the default value is https://app.tangram.
|
12
|
+
# If you are running the app locally or on your own server, use this field to provide the url to it. If not specified, the default value is https://app.tangram.dev.
|
13
13
|
attr_reader :tangram_url
|
14
14
|
def initialize(tangram_url:)
|
15
15
|
@tangram_url = tangram_url
|
@@ -255,7 +255,7 @@ module Tangram
|
|
255
255
|
end
|
256
256
|
|
257
257
|
def initialize(c_model, options: nil)
|
258
|
-
@tangram_url = options&.tangram_url.nil? ? 'https://app.tangram.
|
258
|
+
@tangram_url = options&.tangram_url.nil? ? 'https://app.tangram.dev' : options&.tangram_url
|
259
259
|
@log_queue = []
|
260
260
|
@model = FFI::AutoPointer.new(c_model.read_pointer, LibTangram.method(:tangram_model_delete))
|
261
261
|
end
|
@@ -421,7 +421,7 @@ module Tangram
|
|
421
421
|
elsif is_string
|
422
422
|
LibTangram.tangram_predict_input_set_value_string(c_input, key.to_s, value)
|
423
423
|
else
|
424
|
-
raise '
|
424
|
+
raise 'value for key %s is not a float or a string' % key
|
425
425
|
end
|
426
426
|
end
|
427
427
|
c_input
|
@@ -779,7 +779,7 @@ module Tangram
|
|
779
779
|
elsif cpu == 'x86_64' && os =~ /mingw/
|
780
780
|
library_path = 'libtangram/x86_64-pc-windows-msvc/tangram.dll'
|
781
781
|
else
|
782
|
-
raise 'Tangram for Ruby does not yet support your combination of CPU architecture and operating system. Open an issue at https://github.com/
|
782
|
+
raise 'Tangram for Ruby does not yet support your combination of CPU architecture and operating system. Open an issue at https://github.com/tangramdotdev/tangram/issues/new or email us at help@tangram.dev to complain.'
|
783
783
|
end
|
784
784
|
extend FFI::Library
|
785
785
|
ffi_lib File.expand_path(library_path.to_s, __dir__)
|
data/tangram.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "tangram"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.7.0"
|
4
4
|
s.summary = "Tangram for Ruby"
|
5
|
-
s.description = "Make predictions with a Tangram model from your Ruby app. Learn more at https://www.tangram.
|
5
|
+
s.description = "Make predictions with a Tangram model from your Ruby app. Learn more at https://www.tangram.dev/."
|
6
6
|
s.authors = ["Tangram"]
|
7
|
-
s.email = "help@tangram.
|
7
|
+
s.email = "help@tangram.dev"
|
8
8
|
s.files = Dir["**/**"].grep_v(/.gem$/)
|
9
|
-
s.homepage = "
|
9
|
+
s.homepage = "https://rubygems.org/gems/tangram"
|
10
10
|
s.license = "MIT"
|
11
11
|
s.add_dependency "ffi", "~> 1"
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tangram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tangram
|
@@ -25,8 +25,8 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1'
|
27
27
|
description: Make predictions with a Tangram model from your Ruby app. Learn more
|
28
|
-
at https://www.tangram.
|
29
|
-
email: help@tangram.
|
28
|
+
at https://www.tangram.dev/.
|
29
|
+
email: help@tangram.dev
|
30
30
|
executables: []
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
@@ -91,7 +91,7 @@ files:
|
|
91
91
|
- scripts/fmt
|
92
92
|
- scripts/release
|
93
93
|
- tangram.gemspec
|
94
|
-
homepage:
|
94
|
+
homepage: https://rubygems.org/gems/tangram
|
95
95
|
licenses:
|
96
96
|
- MIT
|
97
97
|
metadata: {}
|