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 to fixed; if fixed is True, it uses DistanceBandWeightsDefinition, otherwise, it uses KNNWeightsDefinition.

  • 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

betas

returns:

A 2D-array with the estimated parameters (n x k) for the trained GWR model

diagnostics

returns:

A SpatialDiagnostics instance containing statistics of the trained model. If no

k

returns:

The number of variables for which coefficients are estimated (including the

model_type

returns:

The regression model defined

predy

returns:

An array with the predictions for the training data

summary

returns:

The summary of the trained model

u

returns:

An array with the residuals of the trained model