def initialize indexes
      # Create a hash to map each category to positional indexes
      categories = indexes.each_with_index.group_by(&:first)
      @cat_hash = categories.map { |cat, group| [cat, group.map(&:last)] }.to_h

      # Map each category to a unique integer for effective storage in @array
      map_cat_int = categories.keys.each_with_index.to_h

      # To link every instance to its category,
      # it stores integer for every instance representing its category
      @array = map_cat_int.values_at(*indexes)
    end
Create a categorical index object.
@param indexes [Array<object>] array of indexes
@return [Daru::CategoricalIndex] categorical index
@example
Daru::CategoricalIndex.new [:a, 1, :a, 1, :c]
# => #<Daru::CategoricalIndex(5): {a, 1, a, 1, c}>