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 tofixed
.fixed – boolean, default=True. Works only when
bandwidth
is defined. If True it usesDistanceBandWeightsDefinition
as spatial weights; otherwise, it usesKNNWeightsDefinition
.
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
- returns:
A 2D-array with the estimated parameters (n x k) for the binomial GWR model
- returns:
The number of variables for which coefficients are estimated (including the
- returns:
The type of the classification model
- returns:
An array with the predictions for the training data
- returns:
A summary of the trained model
- returns:
An array with the residuals of the trained binomial GWR model