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