Skip to content

Instantly share code, notes, and snippets.

@harisankarh
Last active March 15, 2018 19:55
Show Gist options
  • Save harisankarh/017b6da02b9d720547bef2e0169c3f53 to your computer and use it in GitHub Desktop.
Save harisankarh/017b6da02b9d720547bef2e0169c3f53 to your computer and use it in GitHub Desktop.
SELECT *,
EXP(scores_0)/(EXP(scores_0) + EXP(scores_1)) AS probs_0,
EXP(scores_1)/(EXP(scores_0) + EXP(scores_1)) AS probs_1
FROM
( SELECT *,
((d0*w2_00 + d1*w2_10) + b2_0) AS scores_0,
((d0*w2_01 + d1*w2_11) + b2_1) AS scores_1
FROM {INNER sub-query})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment