def count category=UNDEFINED
      return @cat_hash.values.map(&:size).inject(&:+) if category == UNDEFINED # count all
      raise ArgumentError, "Invalid category #{category}" unless
        categories.include?(category)

      @cat_hash[category].size
    end
def count category=UNDEFINED
      return @cat_hash.values.map(&:size).inject(&:+) if category == UNDEFINED # count all
      raise ArgumentError, "Invalid category #{category}" unless
        categories.include?(category)

      @cat_hash[category].size
    end
Returns frequency of given category
 @param [object] category given category whose count has to be founded
 @return count/frequency of given category
 @example
   dv = Daru::Vector.new [:a, 1, :a, 1, :c], type: :category
   dv.count :a
   # => 2
   dv.count
   # => 5