Skip to content

Commit 77c8306

Browse files
DOC - Fix docstrings formatting, add classes to the API page in ReadTheDoc
1 parent 357bc15 commit 77c8306

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

doc/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Risk Control
102102
:template: class.rst
103103

104104
mapie.risk_control.PrecisionRecallController
105+
mapie.risk_control.BinaryClassificationController
106+
mapie.risk_control.BinaryClassificationRisk
105107

106108
Calibration
107109
===========

mapie/risk_control.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ class BinaryClassificationRisk:
760760
Attributes
761761
----------
762762
higher_is_better : bool
763-
See above.
763+
See params.
764764
765765
References
766766
----------
@@ -803,14 +803,15 @@ def get_value_and_effective_sample_size(
803803
804804
Returns
805805
-------
806-
A tuple containing the value of the risk between 0 and 1,
807-
and the number of effective samples used to compute that value
808-
(between 1 and n_samples).
806+
Tuple[float, int]
807+
A tuple containing the value of the risk between 0 and 1,
808+
and the number of effective samples used to compute that value
809+
(between 1 and n_samples).
809810
810-
In the case of a performance metric, this function returns 1 - perf_value.
811+
In the case of a performance metric, this function returns 1 - perf_value.
811812
812-
If the risk is not defined (condition never met), the value is set to 1,
813-
and the number of effective samples is set to -1.
813+
If the risk is not defined (condition never met), the value is set to 1,
814+
and the number of effective samples is set to -1.
814815
"""
815816
risk_occurrences = np.array([
816817
self._risk_occurrence(y_true_i, y_pred_i)
@@ -1066,12 +1067,14 @@ def predict(self, X_test: ArrayLike) -> NDArray:
10661067
10671068
Returns
10681069
-------
1069-
NDArray of shape (n_samples,)
1070+
NDArray
1071+
NDArray of shape (n_samples,)
10701072
10711073
Raises
10721074
------
1073-
ValueError if the method .calibrate was not called,
1074-
or if no valid thresholds were found during calibration.
1075+
ValueError
1076+
If the method .calibrate was not called,
1077+
or if no valid thresholds were found during calibration.
10751078
"""
10761079
if self.best_predict_param is None:
10771080
raise ValueError(

0 commit comments

Comments
 (0)