Pipeline.py 897 B

1234567891011121314151617181920212223242526272829303132333435
  1. from pycs.pipeline import Result
  2. from pycs.pipeline.Job import Job
  3. class Pipeline:
  4. def __init__(self, root_folder, distribution):
  5. """
  6. prepare everything needed to run jobs later
  7. :param root_folder: relative path to model folder
  8. :param distribution: object parsed from distribution.json
  9. """
  10. raise NotImplementedError
  11. def close(self):
  12. """
  13. is called everytime a pipeline is not needed anymore and should be used
  14. to free native resources
  15. :return:
  16. """
  17. raise NotImplementedError
  18. def execute(self, job: Job) -> Result:
  19. """
  20. receive a job, execute it and return the predicted result
  21. :param job: that should be executed
  22. :return:
  23. """
  24. raise NotImplementedError
  25. # TODO documentation
  26. def fit(self, data):
  27. raise NotImplementedError