-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPD: Migration for MapieRegressor #305
UPD: Migration for MapieRegressor #305
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #305 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 32 +5
Lines 3475 3523 +48
Branches 360 364 +4
=========================================
+ Hits 3475 3523 +48
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I think there are some missing small things. But overall, will really simplify structure of MAPIE!
) == y`` | ||
It should be specified if ``consistency_check==True``. | ||
|
||
By default ``np.float64(1e-8)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we use this as an eps in other classes in MAPIE.
from ._machine_precision import EPSILON
I think we should keep this uniform.
self, | ||
sym: bool, | ||
consistency_check: bool = True, | ||
eps: np.float64 = np.float64(1e-8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same logic for epsilon.
) -> NDArray: | ||
""" | ||
Placeholder for ``get_signed_conformity_scores``. | ||
Subclasses should implement this method! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to use exclamation marks. Seems a bit overdone ;)
|
||
Parameters | ||
---------- | ||
y: NDArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be recurrent, but in the parameters, you call this an NDArray
but it's an ArrayLike
. Also you are not give the shape of these arrays.
"are not consistent. " | ||
"The following equation must be verified: " | ||
"self.get_estimation_distribution(y_pred, " | ||
"self.get_conformity_scores(y, y_pred)) == y. " # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this # noqa: E501
?
def _check_predicted_data( | ||
self, | ||
y_pred: ArrayLike, | ||
) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No docstring?
def _all_strictly_positive( | ||
self, | ||
y: ArrayLike, | ||
) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No docstring?
@@ -0,0 +1,343 @@ | |||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Difficult to see with the github diff, but have you changed any of the code from the previous code to this one?
@@ -0,0 +1,709 @@ | |||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Difficult to see with the github diff, but have you changed any of the code from the previous code to this one?
|
||
y_pred_1, y_pis_1 = mapie_c1.predict(X, alpha=0.1) | ||
y_pred_2, y_pis_2 = mapie_c2.predict(X, alpha=0.1) | ||
np.testing.assert_allclose(y_pis_1[:, 0, 0], y_pis_2[:, 0, 0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using np.testing.assert_allclose
and not np.testing. assert_array_equal
?
Description
Propose a migration of some methods / classes / modules.
Type of change
Checklist
make lint
make type-check
make tests
make coverage
make doc