Skip to content

Commit 9e301a9

Browse files
committed
testing new docs
1 parent 3a6341e commit 9e301a9

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

docs/src/usage.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ TikzPictures.save(SVG("plot9"), plot) # hide
325325

326326
We can specify the number of categories for each variable in case it cannot be correctly inferred:
327327

328-
```julia
328+
```@example bayesnet
329329
bn = fit(DiscreteBayesNet, data, parameters, ncategories=[3,3,2])
330330
```
331331

@@ -338,19 +338,17 @@ A whole suite of features are supported for DiscreteBayesNets. Here, we illustra
338338

339339
We also detail obtaining a bayesian score for a network structure in the next section.
340340

341-
```julia
342-
bn = DiscreteBayesNet()
343-
push!(bn, DiscreteCPD(:hospital, [:a, :b], [2,2],
344-
[Categorical([0.9,0.1]),
345-
Categorical([0.2,0.8]),
346-
Categorical([0.7,0.3]),
347-
Categorical([0.01,0.99]),
348-
]))
349-
350-
count(bn, :a, data) # 1
351-
statistics(bn.dag, data) # 2
352-
table(bn, :b) # 3
353-
table(bn, :c, :a=>1) # 4
341+
```@example bayesnet
342+
count(bn, :a, data)
343+
```
344+
```@example bayesnet
345+
statistics(bn.dag, data)
346+
```
347+
```@example bayesnet
348+
table(bn, :b)
349+
```
350+
```@example bayesnet
351+
table(bn, :c, :a=>1)
354352
```
355353

356354
## Reading from XDSL

0 commit comments

Comments
 (0)