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
andloess_control
. The parameters ofloess_inputs
i.ex
,y
andweights
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:
- x
ndarray
[n
,p
] n independent observations for p no. of variables
- y
ndarray
[n,] A (n,) ndarray of response observations
- weights
ndarray
[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).
- **options
dict
The parameters of
loess_model
andloess_control
.
- x
- Attributes:
- inputs
loess_inputs
Object that handles the inputs
- model
loess_model
Object that handles the model
- control
loess_control
Object that holds the control parameters
- kd_tree
loess_kdtree
Object that holds the parameters and structures used internally by the regression algorithm.
- outputs
loess_outputs
Object that holds the output values and parameters. These should be read after
loess.fit()
has been called.
- inputs
- 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:
- Returns:
A
loess_prediction
object.