eps 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -9
- data/lib/eps/lightgbm.rb +1 -1
- data/lib/eps/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf9b15abb922ed62bace8127413e9353d37364f7fe63218088278420655a2561
|
4
|
+
data.tar.gz: 9ae7077f18295a24daf682777106807eec96dfa75e6e4a9f6b595cb52981aec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37cec29c949a729f9581532902b595f4fca1817054243e7e6261b5167917144ba988bbea5fe2a069ef4b988f91fa2b5fd0ea5628059c328b4575d374eb952d7
|
7
|
+
data.tar.gz: 667afb1f383c0d2a8c45c281b7a2b88cc76c3b691704853feb03a8be5a95bfa3ba155ba3e82278c5993b638185c80a82fbbe852f5704ab6bed896af667dd3b76
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Machine learning for Ruby
|
|
7
7
|
|
8
8
|
Check out [this post](https://ankane.org/rails-meet-data-science) for more info on machine learning with Rails
|
9
9
|
|
10
|
-
[![Build Status](https://
|
10
|
+
[![Build Status](https://github.com/ankane/eps/workflows/build/badge.svg?branch=master)](https://github.com/ankane/eps/actions)
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -134,7 +134,7 @@ For text features, use strings with multiple words.
|
|
134
134
|
{description: "a beautiful house on top of a hill"}
|
135
135
|
```
|
136
136
|
|
137
|
-
This creates features based on word count
|
137
|
+
This creates features based on [word count](https://en.wikipedia.org/wiki/Bag-of-words_model).
|
138
138
|
|
139
139
|
You can specify text features explicitly with:
|
140
140
|
|
@@ -147,12 +147,12 @@ You can set advanced options with:
|
|
147
147
|
```ruby
|
148
148
|
text_features: {
|
149
149
|
description: {
|
150
|
-
min_occurences: 5,
|
151
|
-
max_features: 1000,
|
152
|
-
min_length: 1,
|
153
|
-
case_sensitive: true,
|
154
|
-
tokenizer: /\s+/,
|
155
|
-
stop_words: ["and", "the"]
|
150
|
+
min_occurences: 5, # min times a word must appear to be included in the model
|
151
|
+
max_features: 1000, # max number of words to include in the model
|
152
|
+
min_length: 1, # min length of words to be included
|
153
|
+
case_sensitive: true, # how to treat words with different case
|
154
|
+
tokenizer: /\s+/, # how to tokenize the text, defaults to whitespace
|
155
|
+
stop_words: ["and", "the"] # words to exclude from the model
|
156
156
|
}
|
157
157
|
}
|
158
158
|
```
|
@@ -218,7 +218,7 @@ Build the model with:
|
|
218
218
|
PriceModel.build
|
219
219
|
```
|
220
220
|
|
221
|
-
This saves the model to `price_model.pmml`.
|
221
|
+
This saves the model to `price_model.pmml`. Check this into source control or use a tool like [Trove](https://github.com/ankane/trove) to store it.
|
222
222
|
|
223
223
|
Predict with:
|
224
224
|
|
data/lib/eps/lightgbm.rb
CHANGED
@@ -10,7 +10,7 @@ module Eps
|
|
10
10
|
str << "Model needs more data for better predictions\n"
|
11
11
|
else
|
12
12
|
str << "Most important features\n"
|
13
|
-
@importance_keys.zip(importance).sort_by { |k, v| [-v, k] }.first(10).each do |k, v|
|
13
|
+
@importance_keys.zip(importance).sort_by { |k, v| [-v, display_field(k)] }.first(10).each do |k, v|
|
14
14
|
str << "#{display_field(k)}: #{(100 * v / total).round}\n"
|
15
15
|
end
|
16
16
|
end
|
data/lib/eps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lightgbm
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description:
|
125
|
+
description:
|
126
126
|
email: andrew@chartkick.com
|
127
127
|
executables: []
|
128
128
|
extensions: []
|
@@ -156,7 +156,7 @@ homepage: https://github.com/ankane/eps
|
|
156
156
|
licenses:
|
157
157
|
- MIT
|
158
158
|
metadata: {}
|
159
|
-
post_install_message:
|
159
|
+
post_install_message:
|
160
160
|
rdoc_options: []
|
161
161
|
require_paths:
|
162
162
|
- lib
|
@@ -171,8 +171,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.1.
|
175
|
-
signing_key:
|
174
|
+
rubygems_version: 3.1.4
|
175
|
+
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Machine learning for Ruby. Supports regression (linear regression) and classification
|
178
178
|
(naive Bayes)
|