Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 5
0
 def load(self) -> Interface:
     meta = read(MODEL_META_PATH, Model)
     meta.wrapper.load(MODEL_BIN_PATH)
     return model_interface(meta)
Esempio n. 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)
Esempio n. 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)