Conversation
2d5adb6 to
6a315d2
Compare
2cbf790 to
340d1e7
Compare
08b732c to
3c609fd
Compare
|
I don't think this PR closes #905 since we still don't let the user specify the test data set (and use all |
radka-j
left a comment
There was a problem hiding this comment.
This looks great! All my comments are really just about naming/docstrings.
Ah I see - #905 is distinct from updates to the |
|
From discussion with @radka-j:
|
|
I was thinking about our discussion yesterday about evaluating conformal intervals using MSLL. I only had a brief look but I don't think we can treat the conformal intervals as a distribution - we don't know if it is normal but also don't have a reason to assume it is uniform. We only have the 2 quantiles we compute (and the mean). |
Yes good point - adding a distribution s imposing an additional assumption so that we can represent as a |
Also revises comments
I think that sounds really good. This discussion made me think about whether in the case of Ensembles we also shouldn't assume normality. One option would be to introduce something like an |
|
Related to some of the discussion here, I also think we might want to update our plots to show 95% intervals (rather than 2 sigma). Can create an issue for that if you agree. |
Yes good point given we have other distributions than normals potentially - let's update this. |
|
Can I check where we are with this PR? |
|
@EdwinB12 waiting for me to do a second review |
|
At the meeting on Wednesday a suggestion was made to plot calibration of the conformal predictor on a test data set to check it is behaving as expected - I think this is standard. In that instance a user would probably want to loop over different |
|
After a discussion with @sgreenbury we've agreed on the following design: # Q: possibly namedtuple instead for clarity?
IntervalLike = tuple[TensorLike, TensorLike] # lower/upper interval
# NOTE: call predict_mean in predict
class IntervalEmulator(Emulator):
# Q: Possibly abstractmethod?
# NOTE: use alpha to determine lower/upper quantile pair (e.g., 0.05 and 0.95 quantiles for alpha=0.1)
def predict_interval(self, x: TensorLike, alpha=0.05) -> IntervalLike:
raise NotImplementedException("Should be implemented in subclass")
class Conformal(InervalEmulator):
emulator: Emulator
# Q: custom fit? could refit here?
def _fit(self, x: TensorLike, ..., refit: bool = True):
...
def predict_interval(self, x: TensorLike, alpha=0.05) -> IntervalLike:
...
class ConformalConstant(Conformal):
...
class ConformalizedQR(Conformal):
alpha: float | list[float] # self.alphas = [alpha] if isinstance(alpha, float)
...
# NOTE: alpha has to be in self.alphas
def predict_interval(self, x: TensorLike, alpha=0.05) -> IntervalLike:
... |
Closes #848.
Contributes towards #589.
(merge after #917)
This PR:
Ensemble)ConformalMLPclass (analogous toEnsembleMLP). This supports both constant width and quantile regression derived UQ.ConformalMLPto registry and re-exports (not adding as default emulator)n_samples- this is to enable this to be controlled at lower levels of the API from the high-levelAutoEmulate.output_to_tensorsmethod onConversionMixinto avoid repeated mapping of outputs to tensorsQuestion:
Next steps:
ConformalMLP(e.g. on projectile and other simulators)