Skip to content

Commit 0438133

Browse files
committed
update readme
1 parent 74e8d42 commit 0438133

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,9 @@ this package is the class pool of a `CategoricalArray`:
3232
```julia
3333
using CategoricalDistributions
3434
using CategoricalArrays
35-
julia> data = rand(["yes", "no", "maybe"], 10) |> categorical
36-
10-element CategoricalArray{String,1,UInt32}:
37-
"maybe"
38-
"maybe"
39-
"no"
40-
"yes"
41-
"maybe"
42-
"no"
43-
"no"
44-
"no"
45-
"no"
46-
"yes"
47-
35+
import Distributions
36+
data = ["no", "yes", "no", "maybe", "maybe", "no",
37+
"maybe", "no", "maybe"] |> categorical
4838
julia> d = fit(UnivariateFinite, data)
4939
UnivariateFinite{Multiclass{3}}(maybe=>0.3, no=>0.5, yes=>0.2)
5040

@@ -60,7 +50,11 @@ from a probability vector:
6050

6151
```julia
6252
julia> d2 = UnivariateFinite(["no", "yes"], [0.15, 0.85], pool=data)
63-
UnivariateFinite{Multiclass{3}}(no=>0.15, yes=>0.85)
53+
UnivariateFinite{Multiclass{3}}
54+
┌ ┐
55+
no ┤■■■■■■ 0.15
56+
yes ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 0.85
57+
└ ┘
6458
```
6559

6660
A `UnivariateFinite` distribution tracks all classes in the pool:

0 commit comments

Comments
 (0)