15 lines
361 B
Python
15 lines
361 B
Python
import abc
|
|
|
|
|
|
class ServiceEstimator(abc.ABC):
|
|
def __init__(self, estimator, classes):
|
|
self.__estimator = estimator
|
|
self.__classes = classes
|
|
|
|
@property
|
|
def estimator(self):
|
|
return self.__estimator
|
|
|
|
def predict(self, batch):
|
|
return [self.__classes[numeric_label] for numeric_label in self.estimator.predict(batch)]
|