bootcamp_machine-learning
bootcamp_machine-learning copied to clipboard
Use interfaces for directives.
import abc
class Base(abc.ABC):
@abc.abstractmethod
def __init__(self, *args):
pass
@abc.abstractmethod
def __call__(self):
pass
@abc.abstractmethod
def predict(self, data):
pass
# I let you define what is relevant.
class KMean(Base):
# the implementation for the students
Find a link for documentation: http://masnun.rocks/2017/04/15/interfaces-in-python-protocols-and-abcs/