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:
xpd.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:
xpd.DataFrame - The input dataframe.colstr | 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:
xpd.DataFrame - The input dataframe.colspd.Index | None, optional - The columns to calculate the difference for. Defaults to None.shiftint, 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:
xpd.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:
xpd.Series - The input series.dimint, optional - The embedding dimension. Defaults to 1.tauint, optional - The time delay. Defaults to 1.thresholdfloat, optional - The recurrence threshold. Defaults to 0.1.lminint, 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:
xpd.DataFrame - The input dataframe.col_astr | int - The first column to calculate the RQA statistics for.col_bstr | int - The second column to calculate the RQA statistics for.dimint, optional - The embedding dimension. Defaults to 1.tauint, optional - The time delay. Defaults to 1.thresholdfloat, optional - The recurrence threshold. Defaults to 0.1.lminint, 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:
xpd.DataFrame - The input dataframe.col_astr | int - The first column to calculate the RQA statistics for.col_bstr | int - The second column to calculate the RQA statistics for.dimint, optional - The embedding dimension. Defaults to 1.tauint, optional - The time delay. Defaults to 1.thresholdfloat, optional - The recurrence threshold. Defaults to 0.1.lminint, optional - The minimum line length. Defaults to 2.windowint, optional - The window size. Defaults to 100.stepint, optional - The step size. Defaults to 10.
Returns:
pd.DataFrame- The RQA statistics.