Skip to content

Commit a064ba3

Browse files
authored
Merge pull request #50 from alan-turing-institute/dev
For a 0.2.8 release
2 parents 673761e + 39ece9d commit a064ba3

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJModelInterface"
22
uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
33
authors = ["Thibaut Lienart and Anthony Blaom"]
4-
version = "0.2.7"
4+
version = "0.2.8"
55

66
[deps]
77
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

src/data_utils.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ const UNIVARIATE_FINITE_DOCSTRING =
318318
319319
Construct a discrete univariate distribution whose finite support is
320320
the elements of the vector `support`, and whose corresponding
321-
probabilities are elements of the vector `probs`. More generally,
321+
probabilities are elements of the vector `probs`. Alternatively,
322322
construct an abstract *array* of `UnivariateFinite` distributions by
323323
choosing `probs` to be an array of one higher dimension than the array
324324
generated.
@@ -328,13 +328,13 @@ Unless `pool` is specified, `support` should have type
328328
share the same categorical pool, which may be larger than `support`.
329329
330330
*Important.* All levels of the common pool have associated
331-
probabilites, not just those in the specified `support`. However,
331+
probabilities, not just those in the specified `support`. However,
332332
these probabilities are always zero (see example below).
333333
334334
If `probs` is a matrix, it should have a column for each class in
335335
`support` (or one less, if `augment=true`). More generally, `probs`
336336
will be an array whose size is of the form `(n1, n2, ..., nk, c)`,
337-
where `c = length(suppport)` (or one less, if `augment=true`) and the
337+
where `c = length(support)` (or one less, if `augment=true`) and the
338338
constructor then returns an array of size `(n1, n2, ..., nk)`.
339339
340340
```
@@ -345,7 +345,7 @@ julia> UnivariateFinite(classes(v), [0.2, 0.3, 0.5])
345345
UnivariateFinite{Multiclass{3}}(x=>0.2, y=>0.3, z=>0.5)
346346
347347
julia> d = UnivariateFinite([v[1], v[end]], [0.1, 0.9])
348-
UnivariateFiniteMulticlass{3}(x=>0.1, z=>0.9)
348+
UnivariateFinite{Multiclass{3}(x=>0.1, z=>0.9)
349349
350350
julia> rand(d, 3)
351351
3-element Array{Any,1}:
@@ -416,10 +416,13 @@ the set of keys of the provided dictionary, `prob_given_class`, and
416416
whose values specify the corresponding probabilities.
417417
418418
The type requirements on the keys of the dictionary are the same as
419-
the elements of `support` given above. If the values (probabilities)
420-
are arrays instead of scalars, then an abstract array of
421-
`UnivariateFinite` elements is created, with the same size as the
422-
array.
419+
the elements of `support` given above with this exception: if
420+
non-categorical elements (raw labels) are used as keys, then
421+
`pool=...` must be specified and cannot be `missing`.
422+
423+
If the values (probabilities) are arrays instead of scalars, then an
424+
abstract array of `UnivariateFinite` elements is created, with the
425+
same size as the array.
423426
424427
"""
425428
UNIVARIATE_FINITE_DOCSTRING

0 commit comments

Comments
 (0)