Machine Learning

Spatial AI provides the following machine learning capabilities.

Regression

Spatial regression algorithms.

OLSRegressor([spatial_weights_definition])

The Ordinary Least Square (OLS) algorithm fits a line that minimizes the Mean Squared Error (MSE) from the training set to predict new values.

GWRRegressor([spatial_weights_definition, ...])

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.

SLXRegressor([spatial_weights_definition])

The SLX regression model executes a regular Liner Regression involving a feature engineering step to add features that provide a spatial context to the data since, according to Tobler's law, closer things are more related than distant things.

SpatialRegimesRegressor([...])

The regression equation parameters are estimated according to a categorical variable called regime; this categorical variable can represent different things, such as a region in a spatial context.

SpatialLagRegressor([spatial_weights_definition])

The Spatial Lag regression model considers spatial dependence over the target variable, meaning that the value of a region's target variable is related to its neighbors' target variable.

SpatialErrorRegressor([...])

The Spatial Error model introduces a spatial lag in the error term of the linear equation.

SpatialFixedEffectsRegressor([...])

The Spatial Fixed Effects algorithm is a simplified version of Spatial Regimes, computing an intercept or constant parameter for each regime, while the other model parameters remain constant.

GeographicalRegressor([global_model, ...])

Geographical regression algotithm.

SpatialAdaptiveRegressor([...])

Consists of an automated approach that finds the regression algorithm that better fits the data.

Classification

Spatial classification algorithms.

GeographicalClassifier([global_model, ...])

Geographical classification algorithm.

SLXClassifier([spatial_weights_definition, ...])

Implementation of the SLX Logistic Regression model.

GWRClassifier([spatial_weights_definition, ...])

Geographical Weighted Regression for binary classification.

Clustering

Clustering and regionalization algorithms.

DBScanClustering([eps, min_samples, metric, ...])

DBSCAN is a density-based clustering technique capable of finding clusters of different shapes and sizes from a large amount of data.

KMeansClustering([n_clusters, init, n_init, ...])

K-Means Clustering Algorithm.

LISAHotspotClustering([column, ...])

Hotspot clustering implementation.

AgglomerativeClustering([n_clusters, ...])

Agglomerative Clustering Algorithm.

Preprocessing

Spatial preprocessing functuons usint scikit-learn-like Transformer classes which can be used with Spatial Pipelines.

SpatialLagTransformer([...])

The spatial lag of a particular feature reflects the average value of that feature in the neighborhood around each observation.

CategoricalLagTransformer([...])

The categorical lag is used for categorical variables and represents the most common value in the neighborhood.

SpatialImputer([missing_values, ...])

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

SCoordTransformer([crs])

Transformer that returns the centroid of the geometries for each observation

spatial_train_test_split(X[, y, geometries, ...])

Splits data into train and test sub sets.

Pipelines

Spatial version of scikit-learn pipelines. It allows chainning both, spatial and regular transformers/predictors.

SpatialPipeline(steps[, memory, verbose])

A SpatialPipeline is like a scikit-learn pipeline, but it also can contain spatial estimators which accept a spatial column and may use or compute spatial information such as spatial weights objects.

SpatialFeatureUnion(transformer_list, *[, ...])

A spatial version of the scikit-learn FeatureUnion class that can take spatial estimator steps.

SpatialColumnTransformer(transformers, *[, ...])

A spatial version of the scikit-learn class ColumnTransformer that can contain spatial estimator steps.