eps 0.5.0 → 0.6.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/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/README.md +4 -58
- data/lib/eps/base_estimator.rb +1 -1
- data/lib/eps/evaluators/linear_regression.rb +1 -1
- data/lib/eps/evaluators/naive_bayes.rb +1 -1
- data/lib/eps/version.rb +1 -1
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 701cde7907172e33d54d05ee0f2236dbfa84486744e7a510190618848c878418
|
4
|
+
data.tar.gz: a6be730db321a5143e34727497c6ed675f8d734b6195cd4fdc5f8e6bc4e98ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c76ec99a116a91cb9550b9a007b3150689b76649b14aa0c85582176fb44a08957b37c40e54ed1adb6447d8c5ec06757a611fad51a582581031f5724317ee888
|
7
|
+
data.tar.gz: 2176bf4351c26df4562a2879ecb2f0637d2d23bb624dc683790befa2029c2a3d89388b7d5b3183d4d48789801068d7442807c28c2a53439089e2ba0943e0bc9b
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
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
|
-
[](https://github.com/ankane/eps/actions)
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -414,7 +414,7 @@ Eps::Model.new(data, validation_set: validation_set)
|
|
414
414
|
Split on a specific value
|
415
415
|
|
416
416
|
```ruby
|
417
|
-
Eps::Model.new(data, split: {column: :listed_at, value: Date.parse("
|
417
|
+
Eps::Model.new(data, split: {column: :listed_at, value: Date.parse("2025-01-01")})
|
418
418
|
```
|
419
419
|
|
420
420
|
Specify the validation set size (the default is `0.25`, which is 25%)
|
@@ -435,7 +435,7 @@ The database is another place you can store models. It’s good if you retrain m
|
|
435
435
|
|
436
436
|
> We recommend adding monitoring and guardrails as well if you retrain automatically
|
437
437
|
|
438
|
-
Create an
|
438
|
+
Create an Active Record model to store the predictive model.
|
439
439
|
|
440
440
|
```sh
|
441
441
|
rails generate model Model key:string:uniq data:text
|
@@ -479,61 +479,7 @@ Weights are supported for metrics as well
|
|
479
479
|
Eps.metrics(actual, predicted, weight: weight)
|
480
480
|
```
|
481
481
|
|
482
|
-
Reweighing is one method to [mitigate bias](
|
483
|
-
|
484
|
-
## Upgrading
|
485
|
-
|
486
|
-
## 0.3.0
|
487
|
-
|
488
|
-
Eps 0.3.0 brings a number of improvements, including support for LightGBM and cross-validation. There are a number of breaking changes to be aware of:
|
489
|
-
|
490
|
-
- LightGBM is now the default for new models. On Mac, run:
|
491
|
-
|
492
|
-
```sh
|
493
|
-
brew install libomp
|
494
|
-
```
|
495
|
-
|
496
|
-
Pass the `algorithm` option to use linear regression or naive Bayes.
|
497
|
-
|
498
|
-
```ruby
|
499
|
-
Eps::Model.new(data, algorithm: :linear_regression) # or :naive_bayes
|
500
|
-
```
|
501
|
-
|
502
|
-
- Cross-validation happens automatically by default. You no longer need to create training and test sets manually. If you were splitting on a time, use:
|
503
|
-
|
504
|
-
```ruby
|
505
|
-
Eps::Model.new(data, split: {column: :listed_at, value: Date.parse("2019-01-01")})
|
506
|
-
```
|
507
|
-
|
508
|
-
Or randomly, use:
|
509
|
-
|
510
|
-
```ruby
|
511
|
-
Eps::Model.new(data, split: {validation_size: 0.3})
|
512
|
-
```
|
513
|
-
|
514
|
-
To continue splitting manually, use:
|
515
|
-
|
516
|
-
```ruby
|
517
|
-
Eps::Model.new(data, validation_set: test_set)
|
518
|
-
```
|
519
|
-
|
520
|
-
- It’s no longer possible to load models in JSON or PFA formats. Retrain models and save them as PMML.
|
521
|
-
|
522
|
-
## 0.2.0
|
523
|
-
|
524
|
-
Eps 0.2.0 brings a number of improvements, including support for classification.
|
525
|
-
|
526
|
-
We recommend:
|
527
|
-
|
528
|
-
1. Changing `Eps::Regressor` to `Eps::Model`
|
529
|
-
2. Converting models from JSON to PMML
|
530
|
-
|
531
|
-
```ruby
|
532
|
-
model = Eps::Model.load_json("model.json")
|
533
|
-
File.write("model.pmml", model.to_pmml)
|
534
|
-
```
|
535
|
-
|
536
|
-
3. Renaming `app/stats_models` to `app/ml_models`
|
482
|
+
Reweighing is one method to [mitigate bias](https://fairlearn.org/) in training data
|
537
483
|
|
538
484
|
## History
|
539
485
|
|
data/lib/eps/base_estimator.rb
CHANGED
@@ -13,7 +13,7 @@ module Eps
|
|
13
13
|
raise "Probabilities not supported" if probabilities
|
14
14
|
|
15
15
|
intercept = @coefficients["_intercept"] || 0.0
|
16
|
-
scores =
|
16
|
+
scores = Array.new(x.size, intercept)
|
17
17
|
|
18
18
|
@features.each do |k, type|
|
19
19
|
raise "Missing data in #{k}" if !x.columns[k] || x.columns[k].any?(&:nil?)
|
data/lib/eps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-01 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: lightgbm
|
@@ -52,7 +51,6 @@ dependencies:
|
|
52
51
|
- - ">="
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
version: '0'
|
55
|
-
description:
|
56
54
|
email: andrew@ankane.org
|
57
55
|
executables: []
|
58
56
|
extensions: []
|
@@ -86,7 +84,6 @@ homepage: https://github.com/ankane/eps
|
|
86
84
|
licenses:
|
87
85
|
- MIT
|
88
86
|
metadata: {}
|
89
|
-
post_install_message:
|
90
87
|
rdoc_options: []
|
91
88
|
require_paths:
|
92
89
|
- lib
|
@@ -94,15 +91,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
91
|
requirements:
|
95
92
|
- - ">="
|
96
93
|
- !ruby/object:Gem::Version
|
97
|
-
version: '3'
|
94
|
+
version: '3.1'
|
98
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
96
|
requirements:
|
100
97
|
- - ">="
|
101
98
|
- !ruby/object:Gem::Version
|
102
99
|
version: '0'
|
103
100
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
105
|
-
signing_key:
|
101
|
+
rubygems_version: 3.6.2
|
106
102
|
specification_version: 4
|
107
103
|
summary: Machine learning for Ruby. Supports regression (linear regression) and classification
|
108
104
|
(naive Bayes)
|