Class: App42::Recommend::RecommenderSimilarity

Inherits:
App42Response show all
Defined in:
lib/recommend/RecommenderSimilarity.rb

Constant Summary collapse

EUCLIDEAN_DISTANCE =
"EuclideanDistanceSimilarity"
PEARSON_CORRELATION =
"PearsonCorrelationSimilarity"

Instance Attribute Summary

Attributes inherited from App42Response

#isResponseSuccess, #strResponse, #totalRecords

Instance Method Summary collapse

Instance Method Details

#enum(string) ⇒ Object

Sets the value of the Recommender Similarity. EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.

Parameters:

  • string
    • the string of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.



29
30
31
# File 'lib/recommend/RecommenderSimilarity.rb', line 29

def enum(string)
  return RecommenderSimilarity.const_get(string)
end

#isAvailable(string) ⇒ Object

Returns the value of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.

Returns:

  • the value of Recommender Similarity.



40
41
42
43
44
45
46
47
48
# File 'lib/recommend/RecommenderSimilarity.rb', line 40

def isAvailable(string)
  if(string == "EuclideanDistanceSimilarity")
    return "EUCLIDEAN_DISTANCE"
  elsif(string == "PearsonCorrelationSimilarity")
    return "PEARSON_CORRELATION";
  else
    return nil
  end
end