Skip to content

Instantly share code, notes, and snippets.

@ThomasParistech
Created July 15, 2024 17:33
Show Gist options
  • Save ThomasParistech/33e756f2ead8e0be93c45b310e4a5c68 to your computer and use it in GitHub Desktop.
Save ThomasParistech/33e756f2ead8e0be93c45b310e4a5c68 to your computer and use it in GitHub Desktop.
from sklearn.neighbors import KernelDensity
kde = KernelDensity(kernel='linear', bandwidth="silverman")
kde.fit(input_xy)
density = np.exp(kde.score_samples(pred_xy))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment