You could use your metric, e.g. MSE, and use a threshold to separate the predictions.
predictions = torch.randn(100)
threshold = 0
pred_cluster = torch.where(predictions > threshold, torch.ones(1), torch.zeros(1))