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

Implementation of local prediction rigidity #191

Closed agoscinski closed 10 months ago

agoscinski commented 1 year ago

For discussions about how to implement it the best.

Probably https://github.com/lab-cosmo/scikit-matter/tree/main/src/skmatter/metrics is the best place to put it in.

What would be the user interface? Seems like a similar interface like the directional convex hull which uses the score function to output the directional convex hull distance.

class LPR(BaseEstimator):
    def __init__(self, estimator):
        self._estimatior = estimator.clone()
    def fit(self, X):
        self.estimator_.fit(X)
        return self
    def score(self, X):
       # LPR computation 
        lpr_score = ... # using self.estimator_.coef_
        return lpr_score
Luthaf commented 1 year ago

AFAIK, the way to compute LPR depends on the choice of estimator. I would be surprised if we can make the proposed LPR class generic over the estimator. We might need instead to have separate LinearLPR, KernelLPR, … classes

SanggyuChong commented 11 months ago

Really late to a follow-up here, my apologies.

I did have a few discussions with @agoscinski regarding where would be the best place to implement the LPR, and how it could be implemented. Thing is, computing the LPR requires more of the actual model training detail than how it seems on the surface. To me, offering it as a "bonus" of some solver package could be another viable option.

Between the two of us, decision was made to have it implemented in both a solver and scikit-matter, and first here. A bare bones implementation and an accompanying tutorial will be provided, hopefully soon. Thanks everyone!