Closed Darel13712 closed 2 years ago
with indexers extracted we now need separate functions to save indexer. something like
def save_index(indexer, path: str): self.user_type = users.schema[self.user_col].dataType self.item_type = items.schema[self.item_col].dataType indexer.user_indexer.save(join(path, "user_indexer")) indexer.item_indexer.save(join(path, "item_indexer")) indexer.inv_user_indexer.save(join(path, "inv_user_indexer")) indexer.inv_item_indexer.save(join(path, "inv_item_indexer")) def load_index(path: str): indexer = Indexer() model.user_indexer = StringIndexerModel.load(join(path, "user_indexer")) model.item_indexer = StringIndexerModel.load(join(path, "item_indexer")) model.inv_user_indexer = IndexToString.load(join(path, "inv_user_indexer")) model.inv_item_indexer = IndexToString.load(join(path, "inv_item_indexer"))
with indexers extracted we now need separate functions to save indexer. something like