def METHOD_NAME(
    self,
    pairs: DataFrame,
    log: Optional[DataFrame] = None,
    user_features: Optional[DataFrame] = None,
    item_features: Optional[DataFrame] = None,
) -> DataFrame:
    if not user_features:
        raise ValueError("User features are missing for predict")
    user_clusters = self._make_user_clusters(pairs.select("user_idx").distinct(), user_features)
    pairs_with_clusters = pairs.join(user_clusters, on="user_idx")
    filtered_items = (self.item_rel_in_cluster
                      .join(pairs.select("item_idx").distinct(), on="item_idx"))
    pred = (pairs_with_clusters
            .join(filtered_items, on=["cluster", "item_idx"])
            .select("user_idx","item_idx","relevance"))
    return pred