gwdetchar.lasso.core module

Lasso regression utilities

gwdetchar.lasso.core.find_alpha(data, target)[source]

Find the best alpha value to use for the given data

gwdetchar.lasso.core.find_outliers(ts, N=5)[source]

Find outliers within a TimeSeries

Parameters:

ts : TimeSeries

data to find outliers within

N : float, optional

number of standard deviations to consider an outlier, default: 5

Returns:

out : ndarray

array indices of the input where outliers occur

gwdetchar.lasso.core.fit(data, target, alpha=None)[source]

Fit some data to the target using a Lasso model

Parameters:

data : numpy.ndarray

the data

target : numpy.ndarray

the target data

alpha : float

the Lasso alpha parameter, if None one will be determined using find_alpha()

Returns:

model : Lasso

the fitted model

gwdetchar.lasso.core.remove_bad(tsdict)[source]

Remove data that cannot be scaled from a TimeSeriesDict

gwdetchar.lasso.core.remove_flat(tsdict)[source]

Remove flat timeseries from a TimeSeriesDict

gwdetchar.lasso.core.remove_outliers(ts, N=5)[source]

Find and remove outliers within a TimeSeries

Parameters:

ts : TimeSeries

data to find outliers within

N : float, optional

number of standard deviations to consider an outlier, default: 5

Notes

This action is done in-place, with no return statement.