evoc 3.9.0 → 3.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evoc/experiment.rb +8 -2
- data/lib/evoc/scenario.rb +1 -1
- data/lib/evoc/version.rb +1 -1
- data/lib/evoc_cli/experiment.rb +4 -3
- 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: d556543c7f271c2c9c6a18ffb508b5f167b64629
|
4
|
+
data.tar.gz: 62a6606b2096cf0d25a522cc27766f9bac752bcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b73b5929392077c66b2b6a21e50abcb76715a8173cee0958a8238e93d8d3c86deb92bded7162158015b0cb1b38485d17194d629d3afa315af99800eff16ae55c
|
7
|
+
data.tar.gz: 8882a45dab133b128ca7901d3924a46b716205af42fd6997bd8482bcc735bd63a869d4a55509f559ff53b69c62acb93ec8a62cebd09350696ce0e6f7aee20c38
|
data/lib/evoc/experiment.rb
CHANGED
@@ -45,7 +45,13 @@ module Evoc
|
|
45
45
|
sampling_history = sampling_history.select {|tx| tx.index >= self.opts[:minimum_history]}
|
46
46
|
STDERR.puts " Filtering to txes with at least #{self.opts[:minimum_history]} previous txes (new pool size: #{sampling_history.size})"
|
47
47
|
end
|
48
|
-
|
48
|
+
if !self.opts[:recent_viable].nil?
|
49
|
+
size = sampling_history.size
|
50
|
+
sampling_history = sampling_history[[0,size-self.opts[:recent_viable]].max..-1]
|
51
|
+
STDERR.puts " Filtering to the #{self.opts[:recent_viable]} most recent viable transactions (new pool size: #{sampling_history.size})"
|
52
|
+
end
|
53
|
+
|
54
|
+
filtering_switches = [:recent,:recent_viable,:minimum_commit_size,:maximum_commit_size,:minimum_history]
|
49
55
|
if filtering_switches.any? {|s| !self.opts[s].nil?}
|
50
56
|
if sampling_history.size == 0
|
51
57
|
STDERR.puts "WARNING: All transactions were filtered out, unable to sample"
|
@@ -302,7 +308,7 @@ module Evoc
|
|
302
308
|
Evoc::RecommendationCache.evaluate_last(evaluators: self.opts[:evaluators], topk: self.opts[:topk], unique_consequents: self.opts[:unique_consequents], expected_outcome: s.expected_outcome,measure_combination: s.measures)
|
303
309
|
result = Evoc::RecommendationCache.to_h(measures: s.measures)
|
304
310
|
# merge scenario params with result hash and dump as json
|
305
|
-
$stdout.puts s.to_h.merge(
|
311
|
+
$stdout.puts s.to_h.merge({topk: self.opts[:topk],date: tx.date}).merge(result).to_json
|
306
312
|
rescue ArgumentError => e
|
307
313
|
invalid_configuration += 1
|
308
314
|
last_error = e.message
|
data/lib/evoc/scenario.rb
CHANGED
@@ -123,7 +123,7 @@ module Evoc
|
|
123
123
|
def model_start
|
124
124
|
value = self.tx_index - self.model_size.to_i - self.model_age.to_i
|
125
125
|
if value < 0
|
126
|
-
raise ArgumentError, "
|
126
|
+
raise ArgumentError, "Model out of bound"
|
127
127
|
end
|
128
128
|
return value
|
129
129
|
end
|
data/lib/evoc/version.rb
CHANGED
data/lib/evoc_cli/experiment.rb
CHANGED
@@ -21,10 +21,11 @@ module EvocCLI
|
|
21
21
|
# sample_transactions
|
22
22
|
method_option :sample_groups, aliases: "-g", type: :array, required: true, desc: "What tx size groups to sample from"
|
23
23
|
method_option :sample_size, aliases: "-s", type: :numeric, required: true, desc: "Number of transactions to sample from each group"
|
24
|
+
method_option :recent, type: :numeric, desc: "Filter to the X most recent transactions"
|
25
|
+
method_option :maximum_commit_size, type: :numeric, desc: "Filter out transactions which are larger or equal than this before sampling"
|
26
|
+
method_option :minimum_commit_size, type: :numeric, default: 2, desc: "Filter out transactions which are smaller or equal than this before sampling"
|
24
27
|
method_option :minimum_history, :aliases => '-m', type: :numeric, desc: "Filter out transactions which has less previous history than this"
|
25
|
-
method_option :
|
26
|
-
method_option :minimum_commit_size, type: :numeric, default: 2, desc: "Filter out transactions which are smaller than this before sampling"
|
27
|
-
method_option :recent, type: :numeric, desc: "Sample in the X most recent transactions"
|
28
|
+
method_option :recent_viable, type: :numeric, desc: "Filter to the X most recent viable transactions"
|
28
29
|
method_option :after, :aliases => '-a', :desc => "Only include commits after this date"
|
29
30
|
method_option :before, :aliases => '-b', :desc => "Only include commits before this date"
|
30
31
|
desc "sample_transactions [OPTIONS]","Make a sample of transactions (from JSON format)"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Rolfsnes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|