cps_mond_norm.predict gives results per bin, not per test instance #22
-
In the example https://github.com/henrikbostrom/crepes/blob/main/docs/crepes_nb.ipynb, the function cps_mond_norm.predict gives results per test instance, and if results per bin are required then cpds_by_bins=True should be included. However, I already get results per bin when using the standard call: cpds = cps_mond_norm.predict(y_hat=y_hat_test, sigmas=sigmas_test, bins=bins_test, return_cpds=True) I included cpds_by_bins=False, but then I get the error TypeError: predict() got an unexpected keyword argument 'cpds_by_bins'. Am I doing something wrong? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, Sorry for the late response! Since providing "cpds_by_bins=False" to cps_mond_norm.predict(...) raises an error (due to an unexpected keyword argument) in your case, I suggest that you check that "cps_mond_norm" indeed is an object of the correct type; type(cps_mond_norm) should give crepes.base.ConformalPredictiveSystem. The example call that you provide is exactly the one given in the notebook for version 0.6.1, except for that "sigmas_test" in your example is "sigmas_test_knn_res" in the notebook, which indeed results in a vector of the same length as the number of test objects (as shown in the notebook). The subsequent example in the notebook shows the result of providing "cpds_by_bins=True", which changes the format of the output accordingly. You are welcome to report any additional problems that you may have! Best regards, |
Beta Was this translation helpful? Give feedback.
Hi,
Sorry for the late response!
Since providing "cpds_by_bins=False" to cps_mond_norm.predict(...) raises an error (due to an unexpected keyword argument) in your case, I suggest that you check that "cps_mond_norm" indeed is an object of the correct type; type(cps_mond_norm) should give crepes.base.ConformalPredictiveSystem.
The example call that you provide is exactly the one given in the notebook for version 0.6.1, except for that "sigmas_test" in your example is "sigmas_test_knn_res" in the notebook, which indeed results in a vector of the same length as the number of test objects (as shown in the notebook). The subsequent example in the notebook shows the result of providing "cpds_by…