Checkpoint API

Checkpoint Contexts

compresso_recsys.checkpoint.update_checkpoint(path)[source]

Extract a zip checkpoint to a temp dir, let caller edit it, then rewrite it.

Return type:

Iterator[Path]

Parameters:

path (str | Path)

compresso_recsys.checkpoint.read_checkpoint(path)[source]

Extract a zip checkpoint to a read-only temp workspace.

Return type:

Iterator[Path]

Parameters:

path (str | Path)

Manifest and JSON Helpers

compresso_recsys.checkpoint.load_manifest(root)[source]
Return type:

dict[str, Any]

Parameters:

root (str | Path)

compresso_recsys.checkpoint.save_manifest(root, manifest)[source]
Return type:

None

Parameters:
  • root (str | Path)

  • manifest (dict[str, Any])

compresso_recsys.checkpoint.update_stage_manifest(root, stage, metadata)[source]
Return type:

None

Parameters:
  • root (str | Path)

  • stage (str)

  • metadata (dict[str, Any])

compresso_recsys.checkpoint.save_json(root, relpath, data)[source]
Return type:

Path

Parameters:
  • root (str | Path)

  • relpath (str)

  • data (dict[str, Any])

compresso_recsys.checkpoint.load_json(root, relpath)[source]
Return type:

dict[str, Any]

Parameters:
  • root (str | Path)

  • relpath (str)

Split and Cluster Stages

compresso_recsys.checkpoint.save_recsys_split(root, *, item_ids, x_train, val_source_indices, val_target_indices, test_source_indices, test_target_indices, train_source_matrix=None, train_target_matrix=None, val_source_matrix=None, val_target_matrix=None, test_source_matrix=None, test_target_matrix=None, train_user_ids=None, val_user_ids=None, test_user_ids=None, val_eval_user_ids=None, test_eval_user_ids=None, train_item_indices=None, val_item_indices=None, test_item_indices=None, entity_tag_matrix=None, tag_names=None, entity_metadata=None, metadata=None)[source]
Return type:

None

Parameters:
  • root (str | Path)

  • item_ids (ndarray)

  • x_train (csr_matrix)

  • val_source_indices (list[ndarray])

  • val_target_indices (list[ndarray])

  • test_source_indices (list[ndarray])

  • test_target_indices (list[ndarray])

  • train_source_matrix (csr_matrix | None)

  • train_target_matrix (csr_matrix | None)

  • val_source_matrix (csr_matrix | None)

  • val_target_matrix (csr_matrix | None)

  • test_source_matrix (csr_matrix | None)

  • test_target_matrix (csr_matrix | None)

  • train_user_ids (ndarray | list[str] | None)

  • val_user_ids (ndarray | list[str] | None)

  • test_user_ids (ndarray | list[str] | None)

  • val_eval_user_ids (ndarray | list[str] | None)

  • test_eval_user_ids (ndarray | list[str] | None)

  • train_item_indices (ndarray | None)

  • val_item_indices (ndarray | None)

  • test_item_indices (ndarray | None)

  • entity_tag_matrix (csr_matrix | None)

  • tag_names (ndarray | list[str] | None)

  • entity_metadata (DataFrame | None)

  • metadata (dict[str, Any] | None)

compresso_recsys.checkpoint.load_recsys_split(root)[source]
Return type:

dict[str, Any]

Parameters:

root (str | Path)

compresso_recsys.checkpoint.save_cluster_graph_stage(root, graph, *, stage_dir='clustering', metadata=None)[source]
Return type:

Path

Parameters:
  • root (str | Path)

  • graph (SparseClusterSet)

  • stage_dir (str)

  • metadata (dict[str, Any] | None)

compresso_recsys.checkpoint.load_cluster_graph_stage(root, *, stage_dir='clustering')[source]
Return type:

SparseClusterSet

Parameters:
  • root (str | Path)

  • stage_dir (str)