Class ADerivateFilter
- java.lang.Object
-
- ai.libs.jaicore.ml.tsc.filter.derivate.ADerivateFilter
-
- All Implemented Interfaces:
IFilter
- Direct Known Subclasses:
BackwardDifferenceDerivate,ForwardDifferenceDerivate,GulloDerivate,KeoghDerivate
public abstract class ADerivateFilter extends java.lang.Object implements IFilter
Abstract superclass for all derivate filters.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanwithBoundariesFlag that states wheter the filter should add a padding to the derivate assure that is has the same length as the origin time series or not.
-
Constructor Summary
Constructors Constructor Description ADerivateFilter()ADerivateFilter(boolean withBoundaries)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract double[]derivate(double[] t)Calculates the derivate of a time series.protected abstract double[]derivateWithBoundaries(double[] t)Calcuates the derivates of a time series.voidfit(double[] input)The function only fits a single instance of the datasetvoidfit(double[][] input)voidfit(TimeSeriesDataset input)the function computes the needed information for the transform function.double[]fitTransform(double[] input)the function fit and transforms a single instancedouble[][]fitTransform(double[][] input)TimeSeriesDatasetfitTransform(TimeSeriesDataset input)a utility function to avoid the added effort of calling the fit and transform function separatedouble[]transform(double[] input)This function transforms only a single instance.double[][]transform(double[][] input)TimeSeriesDatasettransform(TimeSeriesDataset input)represents a function working on a dataset by transforming the dataset itself.
-
-
-
Method Detail
-
derivate
protected abstract double[] derivate(double[] t)
Calculates the derivate of a time series.- Parameters:
t- The time series to calculate the derivate for.- Returns:
- The derivate of the time series.
-
derivateWithBoundaries
protected abstract double[] derivateWithBoundaries(double[] t)
Calcuates the derivates of a time series. In contrast to the normalderivate(double[])calculation, this method is guaranteed to return a derivate that has the same length than the original time series. This is accomplished via padding.- Parameters:
t- The time series to calculate the derivate for.- Returns:
- The, possibly padded, derivate of the time series.
-
transform
public TimeSeriesDataset transform(TimeSeriesDataset input)
Description copied from interface:IFilterrepresents a function working on a dataset by transforming the dataset itself.
-
transform
public double[] transform(double[] input)
Description copied from interface:IFilterThis function transforms only a single instance.
-
transform
public double[][] transform(double[][] input)
-
fit
public void fit(TimeSeriesDataset input)
Description copied from interface:IFilterthe function computes the needed information for the transform function.
-
fit
public void fit(double[] input)
Description copied from interface:IFilterThe function only fits a single instance of the dataset
-
fitTransform
public TimeSeriesDataset fitTransform(TimeSeriesDataset input)
Description copied from interface:IFiltera utility function to avoid the added effort of calling the fit and transform function separate- Specified by:
fitTransformin interfaceIFilter- Parameters:
input- the dataset that is to be transfromed- Returns:
- the transformed dataset
-
fitTransform
public double[] fitTransform(double[] input)
Description copied from interface:IFilterthe function fit and transforms a single instance- Specified by:
fitTransformin interfaceIFilter- Parameters:
input- the to fit and transform instance- Returns:
- the transformed instance
-
fitTransform
public double[][] fitTransform(double[][] input)
- Specified by:
fitTransformin interfaceIFilter
-
-