INNER CODE UNIT · Python
evaluate_single
google/fully-homomorphic-encryption · demos/cc_fraud/cleartext/evaluate_cleartext.py:55
def evaluate_single(
model_path: str,
feature_cols_path: str,
data_path: str,
sample_idx: int,
) -> None:
"""Loads the model and evaluates a single fraud detection sample."""
resolved_model_path = resolve_path(model_path)
if not os.path.exists(resolved_model_path):
raise FileNotFoundError(
f"Model file not found at {model_path} (resolved:"
f" {resolved_model_path})"
)
print(f"Loading model from: {resolved_model_path}")
checkpoint = torch.load(
resolved_model_path, map_location="cpu", weights_only=False
)