Giter Club home page Giter Club logo

Comments (3)

oboulant avatar oboulant commented on June 6, 2024 1

If you want to keep the timeseries' structure along the time axis, then yes you have to fill the missing values with something.

And here, there are many many strategies (0.0, last known value, randomly draw from the series, mean or median on a particular time window, etc), but it all depends your use case and this is a decision you have to make according to the underlying goal of the task you are trying to solve !

Hope it helps !

Olivier

from ruptures.

oboulant avatar oboulant commented on June 6, 2024

Hi @jdkworld ,

Thx for you interest in ruptures.

This is because of the nan values in your series ! Indeed, ruptures expects the user to have handled on its own missing data. If ruptures has as input series with missing data, then the behaviour is unexpected.

If you remove the missing data, the outputs "looks" fine.

series = dataframe.to_numpy(dtype='float', na_value=np.nan)
print(f"Raw data : shape is {series.shape}")
series = series[~np.isnan(series)]
print(f"After removing the nans : shape is {series.shape}")
algo = rpt.Binseg(model="normal", min_size=12*24*7, jump=12*24).fit(series)
result = algo.predict(pen=100)  
rpt.display(series, result)
plt.show()

which outputs
image

I hope this helps ! Let us know !

Olivier

from ruptures.

jdkworld avatar jdkworld commented on June 6, 2024

Hi Olivier,

Thanks a lot for your answer.
The signal is a timeseries and I still want min_size and jump to correspond to the correct time period. So just removing the NaNs is no option.
As I understand you, I should therefore fill in all missing data so that no NaN values are left and the time interval for each step is constant?

Josien

from ruptures.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.