Published
Edited
Jun 30, 2021
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tshirt = new Learner({
hypotheses:
{ is_english: 0.2, not_english: 0.8 },
likelihoods: {
wearing_tshirt: { is_english: 0.4, not_english: 0.1 },
not_wearing: { is_english: 0.6, not_english: 0.9 }
}
})
Insert cell
tshirt.plot()
Insert cell
tshirt.learn('wearing_tshirt')
Insert cell
tshirt.learn('wearing_tshirt', 'wearing_tshirt')
Insert cell
Insert cell
Insert cell
covid = new Learner({
hypotheses:
{ infected: 0.02, not_infected: 0.98 },
likelihoods: {
positive_test: { infected: 0.95, not_infected: 0.02 },
negative_test: { infected: 0.05, not_infected: 0.98 }
}
})
Insert cell
covid.plot()
Insert cell
covid.learn("positive_test")
Insert cell
Insert cell
Insert cell
dice = new Learner({
hypotheses:
{4:1/5, 6:1/5, 8:1/5, 12: 1/5, 20: 1/5},
likelihoods: {
1: {4:1/4, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
2: {4:1/4, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
3: {4:1/4, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
4: {4:1/4, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
5: {4: 0, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
6: {4: 0, 6:1/6, 8:1/8, 12:1/12, 20:1/20},
7: {4: 0, 6: 0, 8:1/8, 12:1/12, 20:1/20},
8: {4: 0, 6: 0, 8:1/8, 12:1/12, 20:1/20},
9: {4: 0, 6: 0, 8: 0, 12:1/12, 20:1/20},
10: {4: 0, 6: 0, 8: 0, 12:1/12, 20:1/20},
11: {4: 0, 6: 0, 8: 0, 12:1/12, 20:1/20},
12: {4: 0, 6: 0, 8: 0, 12:1/12, 20:1/20},
13: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
14: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
15: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
16: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
17: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
18: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
19: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
20: {4: 0, 6: 0, 8: 0, 12: 0, 20:1/20},
}
})
Insert cell
dice.plot()
Insert cell
dice.learn(6, 4, 5)
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more