oraclesai.regression.GWRRegressor
- class GWRRegressor(spatial_weights_definition=None, bandwidth=None, fixed=True)
The GWR model trains a local regression model for every observation in the dataset by incorporating the target and explanatory variables from the observations within their neighborhood, allowing the relationships between the independent and dependent variables to vary by locality.
- Parameters:
spatial_weights_definition – SpatialWeightsDefinition, default=None. Specifies the spatial relationship among neighbors.
bandwidth – scalar, default=None. Bandwidth value consisting of either a distance or K nearest neighbors. If not None, ignores the
spatial_weights_definition
parameter and defines spatial weights according tofixed
; iffixed
is True, it usesDistanceBandWeightsDefinition
, otherwise, it usesKNNWeightsDefinition
.fixed – boolean, default=True. True for based distance based kernel function and False for adaptive (nearest neighbor) kernel function.
Methods
__init__
([spatial_weights_definition, ...])fit
(X, y[, geometries, crs])Executes local linear regressions for every sample on the dataset, incorporating the dependent and independent variables of locations falling within a specified bandwidth.
get_params
([deep])Get parameters for this estimator.
predict
(X[, geometries])Evaluates the GWR model using the given data.
score
(X, y[, sample_weight, geometries])Returns the value of the regression score function or R-Squared.
set_params
(**params)Set the parameters of this estimator.
Attributes
- returns:
A 2D-array with the estimated parameters (n x k) for the trained GWR 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