oraclesai.preprocessing.SpatialLagTransformer
- class SpatialLagTransformer(spatial_weights_definition=None, strategy='mean')
The spatial lag of a particular feature reflects the average value of that feature in the neighborhood around each observation. For example, given a neighborhood, the spatial lag of the house price for a specific house is the average house price in its surroundings.
- Parameters:
spatial_weights_definition – SpatialWeightsDefinition, default=None. Spatial relationship specification
strategy – {“mean”, “median”}, default=”mean”. For “median”, it calculates the median from the neighbors. For “mean”, it calculates the average from the neighbors
Methods
__init__
([spatial_weights_definition, strategy])fit
(X[, y, geometries, spatial_weights])Computes the spatial weights according to the parameter
spatial_weights_definition
.fit_transform
(X[, y, geometries])Fit to data, then transform it.
get_params
([deep])Get parameters for this estimator.
set_params
(**params)Set the parameters of this estimator.
transform
(X[, y, geometries, ...])Changes the values of a given data for their spatial lag.