scikit-learn-contrib / scikit-matter

A collection of scikit-learn compatible utilities that implement methods born out of the materials science and chemistry communities
https://scikit-matter.readthedocs.io/en/v0.2.0/
BSD 3-Clause "New" or "Revised" License
70 stars 18 forks source link

Negative distances for fitted points with the DirectionalConvexHull #162

Closed agoscinski closed 1 year ago

agoscinski commented 1 year ago

@victorprincipe found an important bug / logical error

We get negative distances for points we fitted on. Since we fitted on them the distance should be >= 0

from skmatter.sample_selection import DirectionalConvexHull
import numpy as np
X = np.load('X.npy')
y = np.load('y.npy')
dch = DirectionalConvexHull(low_dim_idx=[0, 1]).fit(X, y)
print(dch.score_samples(X, y))
print(dch.interpolator_y_(X))

data.zip

agoscinski commented 1 year ago

fixed in #165