Beispiel #1
0
 def load(self, path):
     self.curdir = os.path.abspath(path)
     self.model = self.io.load(path)
     self.methods = read(os.path.join(path, self.methods_json),
                         typing.Optional[Methods])
     self.requirements = read(os.path.join(path, self.requirements_json),
                              Requirements)
Beispiel #2
0
 def from_config_file(cls, filepath):
     """
     Read and create Ebonite instance from config file
     :param filepath: path to read config from
     :return: :class:`~ebontie.Ebonite` instance
     """
     return read(filepath, Ebonite)
Beispiel #3
0
 def load(self) -> Interface:
     metas = read(MODELS_META_PATH, List[Model])
     for i, meta in enumerate(metas):
         meta.wrapper.load(os.path.join(MODEL_BIN_PATH, str(i)))
     ifaces = {
         meta.name: model_interface(meta) for meta in metas
     }
     return merge(ifaces)
Beispiel #4
0
from pyjackson import read

from ebonite.core.objects.metric import Metric

if __name__ == '__main__':
    metric: Metric = read('metric.json', Metric)

    assert metric.evaluate(1, 3) == 14
Beispiel #5
0
 def load(self) -> Interface:
     meta = read(MODEL_META_PATH, Model)
     meta.wrapper.load(MODEL_BIN_PATH)
     return model_interface(meta)
Beispiel #6
0
 def load(self) -> Interface:
     meta = read(PIPELINE_META_PATH, PipelineMeta)
     for name, model in meta.models.items():
         model.wrapper.load(os.path.join(MODEL_BIN_PATH, name))
     meta.pipeline.models = meta.models
     return pipeline_interface(meta.pipeline)
Beispiel #7
0
 def load(self) -> Interface:
     metas = read(MODEL_META_PATH, List[core.Model])
     for meta in metas:
         meta.wrapper.load(os.path.join(MODEL_BIN_PATH, meta.name))
     ifaces = {meta.name: model_interface(meta) for meta in metas}
     return merge(ifaces)