oraclesai.classification.GWRClassifier

class GWRClassifier(spatial_weights_definition=None, bandwidth=None, fixed=True)

Geographical Weighted Regression for binary classification. A logistic model is trained for each observation by including the target and explanatory variables from the observations falling within a specified bandwidth.

Parameters:
  • spatial_weights_definition – SpatialWeightsDefinition, default=None. Spatial relationship specification.

  • bandwidth – scalar, default=None. Bandwidth value consisting of either a distance or K nearest neighbors. If the bandwidth is provided, it overrides the parameter spatial_weights_definition according to fixed.

  • fixed – boolean, default=True. Works only when bandwidth is defined. If True it uses DistanceBandWeightsDefinition as spatial weights; otherwise, it uses KNNWeightsDefinition.

Methods

__init__([spatial_weights_definition, ...])

fit(X, y[, geometries, crs])

Search for the bandwidth and fits a binomial GWR model with the given data.

get_params([deep])

Get parameters for this estimator.

predict(X[, geometries])

Evaluates the binomial GWR model with the given data.

score(X, y[, sample_weight, geometries])

Returns the accuracy of the model.

set_params(**params)

Set the parameters of this estimator.

Attributes

betas

returns:

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

k

returns:

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

model_type

returns:

The type of the classification model

predy

returns:

An array with the predictions for the training data

summary

returns:

A summary of the trained model

u

returns:

An array with the residuals of the trained binomial GWR model