Cannot understand what CubicalCover kind='balanced' does #658
Replies: 3 comments
-
Hi! This is the relevant portion of the docstring (not sure whether you had already seen it): giotto-tda/gtda/mapper/cover.py Lines 35 to 39 in 7b3e47d Let us know if you still have questions. |
Beta Was this translation helpful? Give feedback.
-
Thank you, yes actually I had already seen it, and I had also seen this: Notes So for example if my entry is X=[1,1,2,3,3,5,7,7,8,9,9,18,27] and the cover kind is uniform with defined n_intervals and overlap_frac my intervals will be x1=[1,1,2], x2=[2,3,3], x3=[3,5,7], x4 = [7,7,8], x5 = [8,9,9] x6= [9,18,27]. |
Beta Was this translation helpful? Give feedback.
-
Hi! I apologize for the slow reply. Here is your example and the and intervals computed by the cover: from gtda.mapper import OneDimensionalCover
n_intervals = 6
overlap_frac = 0.2
cover = OneDimensionalCover(kind='balanced',n_intervals=n_intervals, overlap_frac=overlap_frac)
X = np.array([1, 1, 2, 3, 3, 5, 7, 7, 8, 9, 9, 18, 27])
cover.fit(X)
y = cover.transform(X)
print(f"- Cover:\n{y}")
print(f"- Left limits of each cover interval: {cover.left_limits_}")
print(f"- Right limits of each cover interval: {cover.right_limits_}")
The for i in range(n_intervals):
print(f"Cover set {i}: {X[y[:, i]]}")
As you can see, it does what it says on the "cover" (i.e. in the docstring): "approximately the same number of unique values from |
Beta Was this translation helpful? Give feedback.
-
I can't figure it out what CubicalCover(kind='balanced') does, any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions