donlnz / nonconformist

Python implementation of the conformal prediction framework.
MIT License
436 stars 96 forks source link

Allow y_hat instead of unfitted model as input for regression ICP #14

Open ghost opened 6 years ago

ghost commented 6 years ago

Users may have predictions generated from different fitted underlying models in different languages and just want to get the prediction interval. This change allows user to set underlying model = None but using y_hat (prediction value) to get the result. Only regression part is done in this commit for my work purpose. Will enhance classification part as well later.

donlnz commented 6 years ago

I agree that it seems reasonable to provide functionality to produce prediction intervals from a model trained outside of nonconformist, but I'm not sure this is the 'nicest' way. Ideally, in situations like this, I would recommend creating a custom ModelAdapter (inheriting from, e.g., nonconformist.base.RegressorAdapter). Would that be a possible alternative in your use case?