mlfinlab.features.lowess

Module implements Locally Weighted Scatterplot Smoothing (LOWESS) as presented by Marcos Lopez de Prado and Riccardo Rebonato in the following paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2422183

Module Contents

Classes

LOWESS

Locally Weighted Scatterplot Smoothing (LOWESS), is a non-parametric regression

class LOWESS(time_series: pandas.DataFrame, fraction: float | None = 0.5)

Bases: mlfinlab.features.base_noise_reduction.NoiseReductionMethod

Locally Weighted Scatterplot Smoothing (LOWESS), is a non-parametric regression technique to obtain a smooth line through a scatterplot.

This class implementation applies LOWESS to a noisy time-series signal to obtain a smoother signal as a feature.

property fraction: float

Returns fraction of datapoints used for estimation by LOWESS.

Returns:

(float) Fraction of datapoints.

property dataframe: pandas.DataFrame

Returns dataframe with original time series and relevant signals generated by the noise reduction method.

Returns:

(pd.DataFrame) Pandas DataFrame with relevant signals.

property signal: numpy.array

Returns main signal generated from noise reduction method.

Returns:

(np.array) Main signal generated from noise reduction method.

__slots__ = ()
set_fraction(fraction: float)

Set LOWESS fraction value.

Parameters:

fraction – (int) Fraction amount to use for estimations.

generate_signal() numpy.array

Generate signal by applying a LOWESS fit.

Returns:

(np.array) Smooth signal.