oraclesai.regression.SLXRegressor
- class SLXRegressor(spatial_weights_definition=None)
The SLX regression model executes a regular Liner Regression involving a feature engineering step to add features that provide a spatial context to the data since, according to Tobler’s law, closer things are more related than distant things. The algorithm adds one or more columns with the spatial lag of certain features, representing the average from neighboring observations.
- Parameters:
spatial_weights_definition – SpatialWeightsDefinition, default=None. Specifies the spatial relationship among neighbors.
Methods
__init__
([spatial_weights_definition])fit
(X, y[, geometries, crs, ...])Trains an OLS model using a combination of the independent variables in
X
and the spatial lag of the columns specified incolumn_ids
get_params
([deep])Get parameters for this estimator.
predict
(X[, geometries, spatial_weights, ...])Estimates the target variable for the given data.
score
(X, y[, sample_weight, geometries, ...])Returns the R-Squared metric.
set_params
(**params)Set the parameters of this estimator.
Attributes
- returns:
An array with the estimated parameters of the trained model
- returns:
A SpatialDiagnostics instance containing statistics of the trained model. If no
- returns:
The number of variables for which coefficients are estimated (including the
- returns:
The regression model defined
- returns:
An array with the predictions for the training data
- returns:
The summary of the trained model
- returns:
An array with the residuals of the trained model