Source code for lore_sa.bbox.bbox

from abc import ABC, abstractmethod

__all__ = ["AbstractBBox"]

[docs]class AbstractBBox(ABC): """ Generic Black Box class witch provides two sklearn-like methods. pass """
[docs] def __init__(self, classifier): pass
[docs] def model(self): """ Provides the bbox. """ return self.model()
[docs] @abstractmethod def predict(self, sample_matrix: list): """ Wrap of sklearn predict method, that predict the class labels for the provided data. :param sample_matrix: {array-like, sparse matrix} of shape (n_queries, n_features) samples. :return: ndarray of shape (n_queries, n_classes), or a list of n_outputs of such arrays if n_outputs > 1. """ pass
[docs] @abstractmethod def predict_proba(self, sample_matrix: list): """ Wrap of sklearn predict_proba method, that return probability estimates for the test data. :param sample_matrix: {array-like, sparse matrix} of shape (n_queries, n_features) samples :return: ndarray of shape (n_queries, n_classes), or a list of n_outputs of such arrays if n_outputs > 1. """ pass