Sha256: 79c113be0755d13d6b7853246e835a8745d33fb41bbc9c816edeeca70fdf5d4a

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

# -----------------------------------------------------------------------
#  Copyright © 2012 ShepHertz Technologies Pvt Ltd. All rights reserved.
# -----------------------------------------------------------------------

require 'App42_Ruby_API/App42Response.rb'

#
# An enum that contains 2 types of the Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.
#
#

module App42
  module Recommend
    class RecommenderSimilarity < App42Response
      unless (const_defined?(:EUCLIDEAN_DISTANCE))
        EUCLIDEAN_DISTANCE = "EuclideanDistanceSimilarity"
      end
      unless (const_defined?(:PEARSON_CORRELATION))
        PEARSON_CORRELATION = "PearsonCorrelationSimilarity"
      end

      #
      # Sets the value of the Recommender Similarity. EuclideanDistanceSimilarity
      # or PearsonCorrelationSimilarity.
      #
      # @param string
      #       - the string of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.
      #
      def enum(string)
        return RecommenderSimilarity.const_get(string)
      end

      #
      # Returns the value of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity.
      #
      # @return the value of Recommender Similarity.
      #
      #

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

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
App42_Ruby_API-0.8.4 lib/recommend/RecommenderSimilarity.rb