mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-06-05 14:55:13 +02:00
Externalize BlackboxClassifier dataset (x and predictions)
This commit is contained in:
parent
fb534f7a0f
commit
a13415ad67
2 changed files with 20 additions and 0 deletions
|
|
@ -316,10 +316,20 @@ class BlackboxClassifierPredictions(BlackboxClassifier):
|
|||
|
||||
self._nb_classes = get_nb_classes(y_pred)
|
||||
self._input_shape = x_pred.shape[1:]
|
||||
self._x_pred = x_pred
|
||||
self._y_pred = y_pred
|
||||
predict_fn = (x_pred, y_pred)
|
||||
self._art_model = BlackBoxClassifier(predict_fn, self._input_shape, self._nb_classes, fuzzy_float_compare=True,
|
||||
preprocessing=None)
|
||||
|
||||
def get_predictions(self) -> Tuple[OUTPUT_DATA_ARRAY_TYPE, OUTPUT_DATA_ARRAY_TYPE]:
|
||||
"""
|
||||
Return all the data for which the model contains predictions.
|
||||
|
||||
:return: Tuple containing data and predictions as numpy arrays.
|
||||
"""
|
||||
return self._x_pred, self._y_pred
|
||||
|
||||
|
||||
class BlackboxClassifierPredictFunction(BlackboxClassifier):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue