@@ -113,8 +113,6 @@ def __init__(
113
113
self .lower_threshold_value_limit : Optional [float ] = lower_threshold_value_limit
114
114
self .upper_threshold_value_limit : Optional [float ] = upper_threshold_value_limit
115
115
116
- self .confidence_deviation : Optional [float ] = None
117
-
118
116
self .uncalibrated_y_pred_proba = f'uncalibrated_{ self .y_pred_proba } '
119
117
120
118
self .confidence_upper_bound : Optional [float ] = 1.0
@@ -163,9 +161,6 @@ def fit(self, reference_data: pd.DataFrame):
163
161
164
162
reference_chunks = self .chunker .split (reference_data )
165
163
166
- # Calculate confidence bands
167
- self .confidence_deviation = self ._confidence_deviation (reference_chunks )
168
-
169
164
# Calculate alert thresholds
170
165
reference_chunk_results = np .asarray ([self ._realized_performance (chunk .data ) for chunk in reference_chunks ])
171
166
self .lower_threshold_value , self .upper_threshold_value = calculate_threshold_values (
@@ -196,9 +191,6 @@ def _sampling_error(self, data: pd.DataFrame) -> float:
196
191
f"'{ self .__class__ .__name__ } ' is a subclass of Metric and it must implement the _sampling_error method"
197
192
)
198
193
199
- def _confidence_deviation (self , reference_chunks : List [Chunk ]):
200
- return np .std ([self ._estimate (chunk .data ) for chunk in reference_chunks ])
201
-
202
194
@abc .abstractmethod
203
195
def _realized_performance (self , data : pd .DataFrame ) -> float :
204
196
raise NotImplementedError (
@@ -2151,9 +2143,6 @@ def fit(self, reference_data: pd.DataFrame): # override the superclass fit meth
2151
2143
2152
2144
self .alert_thresholds = self ._multiclass_confusion_matrix_alert_thresholds (reference_chunks )
2153
2145
2154
- # Calculate confidence bands
2155
- self .confidence_deviations = self ._multiclass_confusion_matrix_confidence_deviations (reference_chunks )
2156
-
2157
2146
# Delegate to confusion matrix subclass
2158
2147
self ._fit (reference_data ) # could probably put _fit functionality here since overide fit method
2159
2148
@@ -2211,22 +2200,6 @@ def _multi_class_confusion_matrix_realized_performance(self, data: pd.DataFrame)
2211
2200
2212
2201
return cm
2213
2202
2214
- def _multiclass_confusion_matrix_confidence_deviations (
2215
- self ,
2216
- reference_chunks : List [Chunk ],
2217
- ) -> Dict [str , float ]:
2218
- confidence_deviations = {}
2219
-
2220
- num_classes = len (self .classes )
2221
-
2222
- for i in range (num_classes ):
2223
- for j in range (num_classes ):
2224
- confidence_deviations [f'true_{ self .classes [i ]} _pred_{ self .classes [j ]} ' ] = np .std (
2225
- [self ._get_multiclass_confusion_matrix_estimate (chunk .data )[i , j ] for chunk in reference_chunks ]
2226
- )
2227
-
2228
- return confidence_deviations
2229
-
2230
2203
def _get_multiclass_confusion_matrix_estimate (self , chunk_data : pd .DataFrame ) -> np .ndarray :
2231
2204
if isinstance (self .y_pred_proba , str ):
2232
2205
raise ValueError (
0 commit comments