@@ -88,7 +88,7 @@ ERROR_AMBIGUOUS_UNION = ArgumentError(
88
88
" in the example, `range(Int, :dummy, lower=1, upper=10)`." )
89
89
90
90
"""
91
- r = range(model, :hyper; values=nothing )
91
+ r = range(model, :hyper; values=... )
92
92
93
93
Define a one-dimensional `NominalRange` object for a field `hyper` of
94
94
`model`. Note that `r` is not directly iterable but `iterator(r)` is.
@@ -97,19 +97,14 @@ A nested hyperparameter is specified using dot notation. For example,
97
97
`:(atom.max_depth)` specifies the `max_depth` hyperparameter of
98
98
the submodel `model.atom`.
99
99
100
- r = range(model, :hyper; upper=nothing , lower=nothing ,
101
- scale=nothing, values=nothing )
100
+ r = range(model, :hyper; upper=... , lower..., unit=..., origin=... ,
101
+ scale=nothing)
102
102
103
- Assuming `values` is not specified, define a one-dimensional
104
- `NumericRange` object for a `Real` field `hyper` of `model`. Note
105
- that `r` is not directly iteratable but `iterator(r, n)`is an iterator
106
- of length `n`. To generate random elements from `r`, instead apply
107
- `rand` methods to `sampler(r)`. The supported scales are `:linear`,`
108
- :log`, `:logminus`, `:log10`, `:log10minus`, `:log2`, or a callable
109
- object.
110
-
111
- Note that `r` is not directly iterable, but `iterator(r, n)` is, for
112
- given resolution (length) `n`.
103
+ Define a one-dimensional `NumericRange` object for a `Real` property `hyper` of `model`.
104
+ Note that `r` is not directly iteratable but `iterator(r, n)`is an iterator of length
105
+ `n`. To generate random elements from `r`, instead apply `rand` methods to
106
+ `sampler(r)`. The supported scales are `:linear`,` :log`, `:logminus`, `:log10`,
107
+ `:log10minus`, `:log2`, or a callable object.
113
108
114
109
By default, the behaviour of the constructed object depends on the
115
110
type of the value of the hyperparameter `:hyper` at `model` *at the
@@ -119,12 +114,22 @@ behaviour is determined by the value of the specified type.
119
114
120
115
A nested hyperparameter is specified using dot notation (see above).
121
116
117
+ # keyword options
118
+
122
119
If `scale` is unspecified, it is set to `:linear`, `:log`,
123
120
`:log10minus`, or `:linear`, according to whether the interval
124
121
`(lower, upper)` is bounded, right-unbounded, left-unbounded, or
125
122
doubly unbounded, respectively. Note `upper=Inf` and `lower=-Inf` are
126
123
allowed.
127
124
125
+ You must specify at least two of the keyword arguments `upper`, `lower`, `unit` and
126
+ `origin`. The last two parameters are used when fitting some distributions to
127
+ unbounded `NumericRange` objects. See [`Distributions.fit`](@ref) for details.
128
+
129
+ A range is *unbounded* if `lower=-Inf` or `upper=Inf`, or one of these is left
130
+ unspecified. In this case, both `unit` and `origin` must be specified. In the bounded
131
+ case, these have the radius and midpoint of `[lower, upper]` as fallbacks.
132
+
128
133
If `values` is specified, the other keyword arguments are ignored and
129
134
a `NominalRange` object is returned (see above).
130
135
0 commit comments