Skip to content

mopipe.segment

Mean Objects

class Mean(SummaryType, AnySeriesInput, SingleNumericValueOutput, Segment)

Calculate the mean of the input series.

process

def process(x: t.Union[pd.Series, pd.DataFrame], **kwargs) -> float

Process the input series and return the mean value.

Arguments:

  • x pd.Series | pd.DataFrame - The input series.

Returns:

  • float - The mean value.

ColMeans Objects

class ColMeans(SummaryType, MultivariateSeriesInput, UnivariateSeriesOutput,
               Segment)

Calculate the mean of each column in the input dataframe.

process

def process(x: pd.DataFrame,
            col: t.Union[str, int, slice, None] = None,
            **kwargs) -> pd.Series

Process the input dataframe and return the mean value of each column.

Arguments:

  • x pd.DataFrame - The input dataframe.
  • col str | int | slice | None, optional - The column to calculate the mean for. Defaults to None.

Returns:

  • pd.Series - The mean value of each column.

CalcShift Objects

class CalcShift(TransformType, MultivariateSeriesInput,
                MultivariateSeriesOutput, Segment)

Calculate the difference between the input series and a shifted version of itself.

process

def process(x: pd.DataFrame,
            cols: pd.Index | None = None,
            shift: int = 1,
            **kwargs) -> pd.DataFrame

Process the input dataframe and return the difference between the input series and a shifted version of itself.

Arguments:

  • x pd.DataFrame - The input dataframe.
  • cols pd.Index | None, optional - The columns to calculate the difference for. Defaults to None.
  • shift int, optional - The number of periods to shift. Defaults to 1.

Returns:

  • pd.DataFrame - The difference between the input series and a shifted version of itself.

SimpleGapFilling Objects

class SimpleGapFilling(TransformType, MultivariateSeriesInput,
                       MultivariateSeriesOutput, Segment)

Fill gaps in the input series with the linear interpolation.

process

def process(x: pd.DataFrame, **kwargs) -> pd.DataFrame

Process the input dataframe and fill gaps in the input series with the linear interpolation.

Arguments:

  • x pd.DataFrame - The input dataframe.

Returns:

  • pd.DataFrame - The input dataframe with gaps filled using linear interpolation.

RQAStats Objects

class RQAStats(AnalysisType, UnivariateSeriesInput, MultivariateSeriesOutput,
               Segment)

Calculate Recurrence Quantification Analysis (RQA) statistics for the input series.

process

def process(x: pd.Series,
            dim: int = 1,
            tau: int = 1,
            threshold: float = 0.1,
            lmin: int = 2,
            **kwargs) -> pd.DataFrame

Process the input series and return the RQA statistics.

Arguments:

  • x pd.Series - The input series.
  • dim int, optional - The embedding dimension. Defaults to 1.
  • tau int, optional - The time delay. Defaults to 1.
  • threshold float, optional - The recurrence threshold. Defaults to 0.1.
  • lmin int, optional - The minimum line length. Defaults to 2.

Returns:

  • pd.DataFrame - The RQA statistics.

CrossRQAStats Objects

class CrossRQAStats(AnalysisType, MultivariateSeriesInput,
                    MultivariateSeriesOutput, Segment)

Calculate Recurrence Quantification Analysis (RQA) statistics between two input series.

process

def process(x: pd.DataFrame,
            col_a: t.Union[str, int] = 0,
            col_b: t.Union[str, int] = 0,
            dim: int = 1,
            tau: int = 1,
            threshold: float = 0.1,
            lmin: int = 2,
            **kwargs) -> pd.DataFrame

Process the input dataframe and return the RQA statistics between two input series.

Arguments:

  • x pd.DataFrame - The input dataframe.
  • col_a str | int - The first column to calculate the RQA statistics for.
  • col_b str | int - The second column to calculate the RQA statistics for.
  • dim int, optional - The embedding dimension. Defaults to 1.
  • tau int, optional - The time delay. Defaults to 1.
  • threshold float, optional - The recurrence threshold. Defaults to 0.1.
  • lmin int, optional - The minimum line length. Defaults to 2.

Returns:

  • pd.DataFrame - The RQA statistics.

WindowedCrossRQAStats Objects

class WindowedCrossRQAStats(AnalysisType, MultivariateSeriesInput,
                            MultivariateSeriesOutput, Segment)

Calculate Recurrence Quantification Analysis (RQA) statistics between two input series in a moving window.

process

def process(x: pd.DataFrame,
            col_a: t.Union[str, int] = 0,
            col_b: t.Union[str, int] = 0,
            dim: int = 1,
            tau: int = 1,
            threshold: float = 0.1,
            lmin: int = 2,
            window: int = 100,
            step: int = 10,
            **kwargs) -> pd.DataFrame

Process the input dataframe and return the RQA statistics between two input series in a moving window.

Arguments:

  • x pd.DataFrame - The input dataframe.
  • col_a str | int - The first column to calculate the RQA statistics for.
  • col_b str | int - The second column to calculate the RQA statistics for.
  • dim int, optional - The embedding dimension. Defaults to 1.
  • tau int, optional - The time delay. Defaults to 1.
  • threshold float, optional - The recurrence threshold. Defaults to 0.1.
  • lmin int, optional - The minimum line length. Defaults to 2.
  • window int, optional - The window size. Defaults to 100.
  • step int, optional - The step size. Defaults to 10.

Returns:

  • pd.DataFrame - The RQA statistics.