scoruby 0.2.3 → 0.2.4
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/.gitignore +8 -4
- data/Gemfile.lock +1 -1
- data/lib/scoruby/models/decision_tree.rb +4 -10
- data/lib/scoruby/models/gbm.rb +2 -2
- data/lib/scoruby/models_factory.rb +3 -3
- data/lib/scoruby/node.rb +10 -12
- data/lib/scoruby/predicate_factory.rb +5 -5
- data/lib/scoruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ab6779638032408bc0a38812ded29891831aebd
|
4
|
+
data.tar.gz: d26d4338fdbb2f00a7d6fed974a6e2d577c1d847
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 080081fe11bdba935bdd99b178ce74a04d1d05dadc080283f9e474a4d84e8415d2a39cf6a9916c4ee46c78fb46965aa934a0850491de04f6fd1d5806aaa32463
|
7
|
+
data.tar.gz: 38a7ac8547797f2367fcd66036ea87971c531106c0dd0b4c56abf684f48a72db14a9139fa5ff29b0e809aadb5ffb0908a265a603aa6d3ddf5725dc4858cdab0a
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'node'
|
1
|
+
require 'scoruby/node'
|
2
2
|
|
3
3
|
module Scoruby
|
4
4
|
module Models
|
@@ -25,15 +25,9 @@ module Scoruby
|
|
25
25
|
private
|
26
26
|
|
27
27
|
def step(curr, features)
|
28
|
-
curr
|
29
|
-
|
30
|
-
|
31
|
-
curr
|
32
|
-
end
|
33
|
-
|
34
|
-
def step_on_true(curr, features, num)
|
35
|
-
return curr.children[num] if curr.children && curr.children[num] && curr.children[num].true?(features)
|
36
|
-
curr
|
28
|
+
return curr unless curr.children
|
29
|
+
next_step = curr.children.find { |c| c && c.true?(features) }
|
30
|
+
next_step || curr
|
37
31
|
end
|
38
32
|
|
39
33
|
def didnt_step?(curr, prev)
|
data/lib/scoruby/models/gbm.rb
CHANGED
data/lib/scoruby/node.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'predicate_factory'
|
2
|
-
require 'decision'
|
1
|
+
require 'scoruby/predicate_factory'
|
2
|
+
require 'scoruby/decision'
|
3
3
|
|
4
4
|
module Scoruby
|
5
5
|
class Node
|
@@ -13,16 +13,9 @@ module Scoruby
|
|
13
13
|
children.select {|c| c.name == 'ScoreDistribution'})
|
14
14
|
|
15
15
|
children = remove_nodes(children)
|
16
|
-
|
17
|
-
|
18
|
-
@
|
19
|
-
@children = []
|
20
|
-
|
21
|
-
return if children.count == 1
|
22
|
-
|
23
|
-
@children << Node.new(children[1]) if children[1]
|
24
|
-
@children << Node.new(children[2]) if children[2]
|
25
|
-
@children << Node.new(children[3]) if children[3]
|
16
|
+
|
17
|
+
@pred = PredicateFactory.for(children[0])
|
18
|
+
@children = children_nodes(children)
|
26
19
|
end
|
27
20
|
|
28
21
|
def true?(features)
|
@@ -31,6 +24,11 @@ module Scoruby
|
|
31
24
|
|
32
25
|
private
|
33
26
|
|
27
|
+
def children_nodes(children)
|
28
|
+
children.select { |c| c.name == 'Node' }
|
29
|
+
.map { |child| Node.new(child) }
|
30
|
+
end
|
31
|
+
|
34
32
|
def remove_nodes(children)
|
35
33
|
children.reject {|c| %w(Extension ScoreDistribution).include? c.name}
|
36
34
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'predicates/compound_predicate'
|
2
|
-
require 'predicates/simple_predicate'
|
3
|
-
require 'predicates/simple_set_predicate'
|
4
|
-
require 'predicates/true_predicate'
|
5
|
-
require 'predicates/false_predicate'
|
1
|
+
require 'scoruby/predicates/compound_predicate'
|
2
|
+
require 'scoruby/predicates/simple_predicate'
|
3
|
+
require 'scoruby/predicates/simple_set_predicate'
|
4
|
+
require 'scoruby/predicates/true_predicate'
|
5
|
+
require 'scoruby/predicates/false_predicate'
|
6
6
|
|
7
7
|
module Scoruby
|
8
8
|
class PredicateFactory
|
data/lib/scoruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asaf Schers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|