deepcharles / ruptures

ruptures: change point detection in Python
BSD 2-Clause "Simplified" License
1.6k stars 163 forks source link

Does Ruptures have requirements of the length of the dataset? #272

Closed dzheng2333 closed 1 year ago

dzheng2333 commented 1 year ago

I only have a short dataset with only 5-6 rows of data. Although I can obviously see changes in my dataset, the code returns error "BadSegmentationParameters: ":

model = "rbf" # "l1", "rbf", "linear", "normal", "ar",... algo = rpt.Binseg(model=model).fit(data) my_bkps2 = algo.predict(n_bkps=1)

rpt.show.display(data, my_bkps2, figsize=(10, 6)) plt.show()

So, if I want to remove the issue, I have to reset the n_bkps=0, then the error will disappear:

model = "rbf" # "l1", "rbf", "linear", "normal", "ar",... algo = rpt.Binseg(model=model).fit(data) my_bkps2 = algo.predict(n_bkps=0)

rpt.show.display(data, my_bkps2, figsize=(10, 6)) plt.show()

Does it mean there is a requirement of the legenth of the data? Thanks

deepcharles commented 1 year ago

Hi thanks for your interest in ruptures.

Do you mean that your signal have 5 or 6 samples?

The requirement of ruptures is that there are length>= number of segments * minimum size of segment.

deepcharles commented 1 year ago

Closing for now. Feel free to reopen.