Module: Predictor::Base::ClassMethods

Defined in:
lib/predictor/base.rb

Instance Method Summary collapse

Instance Method Details

#get_processing_techniqueObject


54
55
56
# File 'lib/predictor/base.rb', line 54

def get_processing_technique
  @technique || Predictor.get_processing_technique
end

#get_redis_prefixObject


38
39
40
41
42
43
44
45
46
47
48
# File 'lib/predictor/base.rb', line 38

def get_redis_prefix
  if @redis_prefix
    if @redis_prefix.respond_to?(:call)
      @redis_prefix.call
    else
      @redis_prefix
    end
  else
    to_s
  end
end

#input_matricesObject


30
31
32
# File 'lib/predictor/base.rb', line 30

def input_matrices
  @matrices
end

#input_matrices=(val) ⇒ Object


26
27
28
# File 'lib/predictor/base.rb', line 26

def input_matrices=(val)
  @matrices = val
end

#input_matrix(key, opts = {}) ⇒ Object


7
8
9
10
# File 'lib/predictor/base.rb', line 7

def input_matrix(key, opts={})
  @matrices ||= {}
  @matrices[key] = opts
end

#limit_similarities_to(val) ⇒ Object


12
13
14
15
# File 'lib/predictor/base.rb', line 12

def limit_similarities_to(val)
  @similarity_limit_set = true
  @similarity_limit     = val
end

#processing_technique(technique) ⇒ Object


50
51
52
# File 'lib/predictor/base.rb', line 50

def processing_technique(technique)
  @technique = technique
end

#redis_prefix(prefix = nil, &block) ⇒ Object


34
35
36
# File 'lib/predictor/base.rb', line 34

def redis_prefix(prefix = nil, &block)
  @redis_prefix = block_given? ? block : prefix
end

#reset_similarity_limit!Object


21
22
23
24
# File 'lib/predictor/base.rb', line 21

def reset_similarity_limit!
  @similarity_limit_set = nil
  @similarity_limit     = nil
end

#similarity_limitObject


17
18
19
# File 'lib/predictor/base.rb', line 17

def similarity_limit
  @similarity_limit_set ? @similarity_limit : 128
end