oraclesai.preprocessing.SpatialImputer

class SpatialImputer(missing_values=nan, spatial_weights_definition=None, strategy='mean')

Fill all the missing values using the values from the neighbors for each observation.

Parameters:
  • missing_values – int, float, str, np.nan, None or pandas.NA, default=np.nan. The placeholder for the missing values. All occurrences of missing_values will be imputed

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

  • strategy – {“mean”, “median”, “maximum”, “minimum”}, default=”mean”. It calculates the specified statistic from the neighbors to fill the missing value.

Methods

__init__([missing_values, ...])

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

Calculate the spatial weights according to 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, ...])

Returns a NumPy array with the data passed as parameter filled according to the specified strategy.

Attributes

mask_

A boolean array with True in those cells with missing values, and False anywhere else