Coder Social home page Coder Social logo

alternative to block_size about pyextremes HOT 2 CLOSED

georgebv avatar georgebv commented on July 1, 2024
alternative to block_size

from pyextremes.

Comments (2)

georgebv avatar georgebv commented on July 1, 2024

I may be late, but, if you have a custom way you extract extreme values from your data, you can use the EVA.set_extremes method:

def set_extremes(self, extremes: pd.Series, **kwargs) -> None:
"""
Set extreme values.
This method is used to set extreme values onto the model instead
of deriving them from data directly using the 'get_extremes' method.
This way user can set extremes calculated using a custom methodology.
Parameters
----------
extremes : pd.Series
Time series of extreme values to be set onto the model.
Must be numeric, have date-time index, and have the same name
as self.data.
kwargs:
method : str, optional
Extreme value extraction method.
Supported values:
BM (default) - Block Maxima
POT - Peaks Over Threshold
extremes_type : str, optional
high (default) - extreme high values
low - extreme low values
if method is BM:
block_size : str or pandas.Timedelta, optional
Block size.
If None (default), then is calculated as median distance
between extreme events.
errors : str, optional
raise - raise an exception
when encountering a block with no data
ignore (default) - ignore blocks with no data
coerce - get extreme values for blocks with no data
as mean of all other extreme events in the series
with index being the middle point of corresponding interval
min_last_block : float, optional
Minimum data availability ratio (0 to 1) in the last block
for it to be used to extract extreme value from.
This is used to discard last block when it is too short.
If None (default), last block is always used.
if method is POT:
threshold : float, optional
Threshold used to find exceedances.
By default is taken as smallest value.
r : pandas.Timedelta or value convertible to timedelta, optional
Duration of window used to decluster the exceedances.
By default r='24H' (24 hours).
See pandas.to_timedelta for more information.
"""

This way you can extract extreme values yourself and then use them with pyextremes.

from pyextremes.

yngwaz avatar yngwaz commented on July 1, 2024

Many thanks for that hint!
Yes, that would work perfectly fine for me. Sorry, I didn't see this option!

from pyextremes.

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.