skmisc.loess.loess

class skmisc.loess.loess(x, y, weights=None, **options)

Locally-weighted regression

A loess object is initialized with the combined parameters of loess_inputs, loess_model and loess_control. The parameters of loess_inputs i.e x, y and weights can be positional in that order. In the descriptions below, n is the number of observations, and p is the number of predictor variables.

Parameters:
xndarray[n, p]

n independent observations for p no. of variables

yndarray[n,]

A (n,) ndarray of response observations

weightsndarray[n] or None

Weights to be given to individual observations in the sum of squared residuals that forms the local fitting criterion. If not None, the weights should be non negative. If the different observations have non-equal variances, the weights should be inversely proportional to the variances. By default, an unweighted fit is carried out (all the weights are one).

**optionsdict

The parameters of loess_model and loess_control.

Attributes:
inputsloess_inputs

Object that handles the inputs

modelloess_model

Object that handles the model

controlloess_control

Object that holds the control parameters

kd_treeloess_kdtree

Object that holds the parameters and structures used internally by the regression algorithm.

outputsloess_outputs

Object that holds the output values and parameters. These should be read after loess.fit() has been called.

fit(self)

Computes the loess parameters on the current inputs and sets of parameters.

input_summary(self)

Returns some generic information about the loess parameters.

output_summary(self)

Returns some generic information about the loess fit.

predict(self, newdata, stderror=False)

Compute loess estimates at the given new data points newdata.

Parameters:
newdatandarray[m, p]

Independent variables where the surface must be estimated, with m the number of new data points, and p the number of independent variables.

stderrorboolean

Whether the standard error should be computed

Returns:
A loess_prediction object.