@@ -53,21 +53,24 @@ def check_dimension(dimension, transform=None):
53
53
----------
54
54
dimension : Dimension
55
55
Search space Dimension.
56
- Each search dimension can be defined either as
56
+ Each search dimension can be defined either as:
57
57
58
+ - an instance of a `Dimension` object (`Real`, `Integer` or
59
+ `Categorical`).
58
60
- a list or numpy array of choices, for `Categorical` dimension
59
61
- a 2-, 3- or 4-tuple, for `Real` and `Integer` dimensions, of
60
62
the form ``(low, high [, prior [, base]])`` (values in square
61
63
brackets are optional). If both ``low`` and ``high`` are integral
62
64
numbers (as per the `number.Integral`), a `Integer` dimension is
63
65
returned, else a `Real` dimension is returned.
64
66
65
- NOTE: For a transitionary period, tuple, list and array currently all
66
- undergo dimension inference as describe in the tuple entry above. If
67
- no `Integer` or `Real` dimension can be inferred, a `Categorical` is
68
- returned. This behavior will be tightened to the above description in
69
- an upcoming version, and a warning is raised if the upcoming
70
- inference would differ from the current behavior.
67
+ ..note::
68
+ For a transitionary period, tuple, list and array currently all
69
+ undergo dimension inference as describe in the tuple entry above.
70
+ If no `Integer` or `Real` dimension can be inferred, a
71
+ `Categorical` is returned. This behavior will be tightened to the
72
+ above description in an upcoming version, and a warning is raised
73
+ if the upcoming inference would differ from the current behavior.
71
74
72
75
transform : "identity", "normalize", "string", "label", "onehot" optional
73
76
- For `Categorical` dimensions, the following transformations are
@@ -108,7 +111,7 @@ def _check_dimension(dimension, transform=None):
108
111
return dimension
109
112
elif isinstance (dimension , (list , np .ndarray )):
110
113
return Categorical (dimension , transform = transform )
111
- elif isinstance (dimension , tuple ) and 1 <= len (dimension ) <= 4 :
114
+ elif isinstance (dimension , tuple ) and 2 <= len (dimension ) <= 4 :
112
115
low , high , * args = dimension
113
116
if (isinstance (low , numbers .Integral )
114
117
and isinstance (high , numbers .Integral )):
0 commit comments