donlnz / nonconformist

Python implementation of the conformal prediction framework.
MIT License
425 stars 94 forks source link

Mondrian Cross-Conformal Prediction #13

Open chupvl opened 6 years ago

chupvl commented 6 years ago

Hello,

do I understand correctly that Mondrian Cross-Conformal Prediction is not implemented in the pipelines ?

Thanks!

donlnz commented 5 years ago

It is correct that CrossConformalClassifier currently does not properly support conditional (Mondrian) Conformal Prediction.

You should, however, be able to construct an AggregatedConformalPredictor that uses Mondrian ICPs as the ensemble members, to achieve something similar:

model_adapter = ClassifierAdapter(SVC(probability=True))
nc = ClassifierNc(model_adapter)
icp = IcpClassifier(nc, condition=lambda x: x[1])
ccp = AggregatedCp(icp, CrossSampler())