Skip to content

Commit 485e382

Browse files
committed
more doc-string tweaks
1 parent 9b28d57 commit 485e382

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/data_utils.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,9 @@ these probabilities are always zero (see example below).
319319
320320
If `probs` is a matrix, it should have a column for each class in
321321
`support` (or one less, if `augment=true`). More generally, `probs`
322-
will be an array of size of the form `(n1, n2, ..., nk, C)` where `C`
323-
is the number of classes (or one less, if `augment=true`), the
324-
constructor returning an array of size `(n1, n2, ..., nk)`.
325-
326-
Unless `augment=true`, sums of elements along the last axis (row-sums
327-
in the case of a matrix) must be equal to one, and otherwise such an
328-
array is created by inserting appropriate elements *ahead* of those
329-
provided. For example, in the binary case, augmentation will transform
330-
a vector into a matrix, and the given probabilities will be associated
331-
with the *second* class in `support`.
322+
will be an array whose size is of the form `(n1, n2, ..., nk, c)`,
323+
where `c = length(suppport)` (or one less, if `augment=true`) and the
324+
constructor then returns an array of size `(n1, n2, ..., nk)`.
332325
333326
```
334327
using CategoricalArrays
@@ -356,6 +349,8 @@ julia> pdf(d, :y)
356349
0.0
357350
```
358351
352+
### Specifying a pool
353+
359354
Alternatively, `support` may be a list of raw (non-categorical)
360355
elements if `pool` is:
361356
@@ -390,6 +385,14 @@ julia> UnivariateFinite([:x, :y, :z], probs, pool=v)
390385
UnivariateFinite{Multiclass{4}}(x=>0.292, y=>0.339, z=>0.369)
391386
```
392387
388+
### Probability augmentation
389+
390+
Unless `augment=true`, sums of elements along the last axis (row-sums
391+
in the case of a matrix) must be equal to one, and otherwise such an
392+
array is created by inserting appropriate elements *ahead* of those
393+
provided. This means the provided probabilities are associated with
394+
the the classes `c2, c3, ..., cn`.
395+
393396
---
394397
395398
UnivariateFinite(prob_given_class; pool=nothing, ordered=false)

0 commit comments

Comments
 (0)