0

I'm hoping to get some advice on approaching a clustering problem. I have two separate spatial datasets, being real data and modelled data. The real data contains a binary output (0,1), which is displayed in the figure below. The green scatter points represent 1 and red is 0.

Is it possible to assign a probability (of being 1 attributed to real data) to the modelled data based on the binary output of the real data? On face value, a nearest neighbour approach makes the most sense but are there any other approaches that may be applicable?

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from itertools import cycle

real_data = pd.DataFrame(np.random.randint(0,100,size=(100, 2)), columns=['x1','y1'])
outcome = cycle([0,1])
real_data['Outcome'] = [next(outcome) for fruit in range(len(real_data))]
colors = np.where(real_data["Outcome"]==1,'green','red')

model_data = pd.DataFrame(np.random.randint(-25,125,size=(1000, 2)), columns=['x2','y2'])

fig, ax = plt.subplots()

ax.scatter(model_data['x2'], model_data['y2'], alpha=0.5, color = 'blue', zorder = -1)
ax.scatter(real_data['x1'], real_data['y1'], color = colors, s = 100, zorder = 0)

plt.show()

enter image description here

1 Answer 1

0

If your data isn't governed by an underlying law involving regularities (which seems to be the case in your example), Knn is indeed what makes the most sense, and linear methods (Gaussian modeling, regression, etc.) won't help you.

The best is to use nonlinear methods. You could try using a random forest method. Decision trees create a tree structure that delineates areas and identifies clusters. You just need to limit the number of parameters to avoid overfitting (like max depth or min samples per leaf), especially on ambiguous data like the one you've shown.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.