Skip to content

Instantly share code, notes, and snippets.

@harisankarh
Last active March 12, 2018 16:12
Show Gist options
  • Save harisankarh/482382fb90e000d480546e8948ce9c44 to your computer and use it in GitHub Desktop.
Save harisankarh/482382fb90e000d480546e8948ce9c44 to your computer and use it in GitHub Desktop.
SELECT *,
(CASE
WHEN y = 0 THEN (probs_0–1)/num_examples
ELSE probs_0/num_examples
END) AS dscores_0,
(CASE
WHEN y = 1 THEN (probs_1–1)/num_examples
ELSE probs_1/num_examples
END) AS dscores_1
FROM {inner subquery}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment