<commit_before>module RecommEngine
  class EuclideanCalculator < Calculator
    attr_reader :data, :subject, :comparate

    def initialize(data:, subject:, comparate:)
      super
    end

    def calc
      1.0 / (Math.sqrt(1.0 + sum_simalarities))
    end

    private

    def sum_simalarities
      @data[@subject].map{ |k, v| ((v - data[comparate][k])**2) if data[comparate][k] }.compact.inject(:+)
    end
  end
end<commit_msg>rename obscure variables<commit_after>module RecommEngine
  class EuclideanCalculator < Calculator
    attr_reader :data, :subject, :comparate

    def initialize(data:, subject:, comparate:)
      super
    end

    def calc
      1.0 / (Math.sqrt(1.0 + sum_simalarities))
    end

    private

    def sum_simalarities
      @data[@subject].map{ |product, score| ((score - data[comparate][product])**2) if data[comparate][product] }.compact.inject(:+)
    end
  end
end
{'fraction_non_alphanumeric': 0.12375690607734807, 'fraction_numerical': 0.011049723756906077, 'mean_word_length': 3.293838862559242, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4909459', 'n_tokens_mistral': 320, 'n_tokens_neox': 301, 'n_words': 71}