Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1026375 // bayes

JavaX fragment (include)

// likelihood = P(E | H)
// prior = P(H)
// modelEvidence = P(E)
// returns P(H | E)
static double bayes(double likelihood, double prior, double modelEvidence) {
  ret likelihood*prior/modelEvidence;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026375
Snippet name: bayes
Eternal ID of this version: #1026375/1
Text MD5: 4270911dbe2aab6e9e1031520056114d
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-12-29 21:49:11
Source code size: 207 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 207 / 237
Referenced in: [show references]