Class: EvocCLI::Info

Inherits:
Thor
  • Object
show all
Defined in:
lib/evoc_cli/info.rb

Instance Method Summary collapse

Instance Method Details

#dictObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/evoc_cli/info.rb', line 23

def dict
  $stdout.puts "
  keyword                  description
  -------                  -----------

  case_id:                 user provided tag for the history used
  granularity:             granularity of the history used
  scenario_id:             a unique indentifier for this scenario
  tx_id:                   the sha of the commit that the query was sampled from
  tx_index:                the index of this transaction in the used history (0 is oldest)
  tx_size:                 the number of items in the transaction
  query_size:              the number of items in the query
  query_percentage:        query_size/tx_size
  expected_outcome_size:   |tx - query|
  model_size:              number of previous transactions relative to this one
  model_hours:             time span from the first transaction to this one
  model_age:               number of transactions between end of model and this transaction
  max_size:                transactions larger than this are filtered out before generating rules
  filtered_model_size:     model size after the max_size filtering
  algorithm:               the mining algorithm used to generate the recommendation
  aggregator:              the aggregation function used to aggregate the rules of the recommendation
  measures:                the interestingnessmeasures used to rank each rule
  recommendation_tag:      a unique identifiter of the rules used as a basis for the recommendation
  time_rulegeneration:     how long it took to generate the rules
  time_measurecalculation: how long it took to calculate the measures for each rule
  time_aggregation:        how long it took to aggregate the rules
  number_of_baserules:     number of rules before aggregation
  number_of_rules:         number of rules after aggregation (equal to number_of_baserules when not aggregating)
  number_of_hyperrules:    number of hyper rules after aggregating
  mean_hyper_coefficient:  average number of rules aggregated in each hyper rule
  largest_antecedent:      number of items in the largest antecedent (lhs of rule)
  t_ap:                    average precision where ties are accounted for
  ap:                      the average precision
  precision:               ratio of correct to incorrect items
  precision10:             ratio of correct to incorrect items in the top 10
  recall:                  ratio of correct items in recommendation to full set of expected items 
  recall19:                ratio of correct items in recommendation to full set of expected items in the top 10
  mean_confidence:         the average confidence of the rules in this recommendation
  discernibility:          the number of uniquely weighted rules to the number of rules
  applicable:              1 if rules were generated, 0 otherwise
  f1:                      the f1 measure
  first_relevant:          the rank of the first correct item
  last_relevant:           the rank of the last correct item
  "
end

#measure_rangeObject



12
13
14
15
16
17
18
19
20
# File 'lib/evoc_cli/info.rb', line 12

def measure_range
  $stdout.puts "measures,range"
  Evoc::InterestingnessMeasures.measures.sort.each do |m|
    min      = Evoc::InterestingnessMeasures.get_min(m)
    max      = Evoc::InterestingnessMeasures.get_max(m)
    range = "[#{min},#{max}]"
    $stdout.puts "#{m},\"#{range}\""
  end
end

#measuresObject



7
8
9
# File 'lib/evoc_cli/info.rb', line 7

def measures
  STDOUT.puts Evoc::InterestingnessMeasures.measures.map {|m| m.to_s.sub("m_","")}.join(" ") 
end