Using a machine learning model to obtain a huge amount of simple patterns from coordinates without any other feature becomes difficult because it depends on how much information your model can learn. KNN, as a non-parametric algorithm, can address this problem, but struggles with more complex patterns. Here’s KNN Spatial Boost algorithm comes in.
pip install knn_spatial_boost
In the example we are going to use the MLPRegressor from the scikit-learn library.
from knn_spatial_boost.core import KNNSpatialBooster
from sklearn.neural_network import MLPRegressor
nn = KNNSpatialBooster(
n_neighbors=2,
spatial_features=[1, 2],
estimator=MLPRegressor()
)