skdownscale.pointwise_models.LinearTrendTransformer¶
- class skdownscale.pointwise_models.LinearTrendTransformer(lr_kwargs=None)[source]¶
Bases:
TransformerMixin,BaseEstimatorTransform features by removing linear trends.
Uses Ordinary least squares Linear Regression as implemented in sklear.linear_model.LinearRegression.
- Parameters:
**lr_kwargs – Keyword arguments to pass to sklearn.linear_model.LinearRegression
- lr_model_¶
Linear Regression object.
Methods
__init__([lr_kwargs])fit(X[, y])Compute the linear trend.
fit_transform(X[, y])Fit to data, then transform it.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
Add the trend back to the data.
set_output(*[, transform])Set output container.
set_params(**params)Set the parameters of this estimator.
transform(X)Perform transformation by removing the trend.
trendline(X)helper function to calculate a linear trendline
- fit(X, y=None)[source]¶
Compute the linear trend.
- Parameters:
X (
array-like,shape [n_samples,n_features]) – Training data.
- inverse_transform(X)[source]¶
Add the trend back to the data.
- Parameters:
X (
array-like,shape [n_samples,n_features]) – The data that should be transformed back.