kats.utils.cupik module¶
- class kats.utils.cupik.Pipeline(steps: List[Tuple[str, Any]])[source]¶
Bases:
object
CuPiK (Customized Pipeline for Kats) is created with a similar mindset of sklearn pipeline. Users can call multiple methods within Kats library and run them in sequential to perform a series of useful timeseries processes at once.
Due to the current distribution of Kats library, we provide the function to apply detectors, transformers and time series modeling sequentially using CuPiK. We also offer api to sklearn, once feature extraction using TsFeatures is performed, users can feed the results directly to an sklearn machine learning model.
- fit(data: Any, params: Optional[Dict[str, Any]] = None, **kwargs) → Any[source]¶
This function is the external function for user to fit the pipeline
inputs: data: a single univariate time series data or a list of multiple univariate
time series data
- params: a dictionary with the extra parameters for each step. The dictionary
holds the format of {“user_defined_method_name”: {“parameter”: value}}
extra key word arguments: remove: a boolean for telling the pipeline to remove outlier or not
- useFeatures: a boolean for telling the pipeline whether to use TsFeatures to process
the data for sklearn models, or merely getting the features as metadata for other usage
y: label data for fitting sklearn model, an array or a list
outputs: data: output a single result for univariate data, or a list of results for multiple
univariate time series data fed originally in the format of a list. Determined by the last step, the output could be processed time series data, or fitted kats/sklearn model, etc.