For example if the index is [:a, :b, :a, :c, :b, :b] with categories :a, :b and :c, the hash table would be {a: [0, 2], b: [1, 4, 5], c: [3]} and array would be [0, 1, 0, 2, 1, 1].
Any thoughts?
Regards
Lokesh
Firstly, what name would you suggest? Is CategoricalIndex fine or is CategoryIndex better?Hello mentorsThe coding period begins tomorrow and I'll be starting with implementing Daru::CategoricalIndex.
Second, how should the development proceed? Should I create a separate branch and push commits on it until CategoricalIndex is implemented and then propose a PR?
Tomorrow I will begin by implementing the high level specs for Categorical Index.
Keeping in mind the aim of having CategoricalIndex is effectively store and retrieve categorical index, I have planned to use two data structures-
- Hash-Table: to enable retrieval of all elements which belong to a certain category in constant time.
- Array: to find each category of every element in constant time.
For example if the index is [:a, :b, :a, :c, :b, :b] with categories :a, :b and :c, the hash table would be {a: [0, 2], b: [1, 4, 5], c: [3]} and array would be [0, 1, 0, 2, 1, 1].
Any thoughts?
Regards
Lokesh