gtime.feature_extraction.Exogenous¶
-
class
gtime.feature_extraction.Exogenous¶ Reindex
exogenous_time_serieswith the index oftime_series. To check the documentation ofpandas.DataFrame.reindexand to see which type ofmethodare available, please refer to the pandas documentation.Examples
>>> import pandas as pd >>> from gtime.feature_extraction import Exogenous >>> ts = pd.DataFrame({'exogenous': [10, 8, 1, 3, 2, 7]}, index=[3, 4, 5, 6, 7, 8]) >>> exog = Exogenous() >>> exog.fit_transform(ts) exogenous__Exogenous 3 10 4 8 5 1 6 3 7 2 8 7
Methods
fit(self, time_series[, y])Fit the estimator. fit_transform(self, X[, y])Fit to data, then transform it. get_feature_names(self)Return feature names for output features. get_params(self[, deep])Get parameters for this estimator. set_params(self, \*\*params)Set the parameters of this estimator. transform(self, time_series)It returns the input time series adding the class name to it -
__init__(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
fit(self, time_series, y=None)¶ Fit the estimator.
Parameters: - time_series : pd.DataFrame, shape (n_samples, n_features)
Input data.
- y : None
There is no need of a target in a transformer, yet the pipeline API requires this parameter.
Returns: - self : object
Returns self.
-
fit_transform(self, X, y=None, **fit_params)¶ Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: - X : numpy array of shape [n_samples, n_features]
Training set.
- y : numpy array of shape [n_samples]
Target values.
- **fit_params : dict
Additional fit parameters.
Returns: - X_new : numpy array of shape [n_samples, n_features_new]
Transformed array.
-
get_feature_names(self)¶ Return feature names for output features.
Returns: - output_feature_names : ndarray, shape (n_output_features,)
Array of feature names.
-
get_params(self, deep=True)¶ Get parameters for this estimator.
Parameters: - deep : bool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns: - params : mapping of string to any
Parameter names mapped to their values.
-
set_params(self, **params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>so that it’s possible to update each component of a nested object.Parameters: - **params : dict
Estimator parameters.
Returns: - self : object
Estimator instance.
-
transform(self, time_series: pandas.core.frame.DataFrame) → pandas.core.frame.DataFrame¶ It returns the input time series adding the class name to it
Parameters: - time_series : pd.DataFrame, shape (n_samples, n_features), required
The input DataFrame.
Returns: - time_series_t : pd.DataFrame, shape (n_samples, n_features)
The original
exogenous_time_series, adding the class name to it
-