10000 corrected as per review · scikit-optimize/scikit-optimize@fde2119 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit fde2119

Browse files
corrected as per review
1 parent 887b711 commit fde2119

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

skopt/space/space.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ def check_dimension(dimension, transform=None):
5353
----------
5454
dimension : Dimension
5555
Search space Dimension.
56-
Each search dimension can be defined either as
56+
Each search dimension can be defined either as:
5757
58+
- an instance of a `Dimension` object (`Real`, `Integer` or
59+
`Categorical`).
5860
- a list or numpy array of choices, for `Categorical` dimension
5961
- a 2-, 3- or 4-tuple, for `Real` and `Integer` dimensions, of
6062
the form ``(low, high [, prior [, base]])`` (values in square
6163
brackets are optional). If both ``low`` and ``high`` are integral
6264
numbers (as per the `number.Integral`), a `Integer` dimension is
6365
returned, else a `Real` dimension is returned.
6466
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.
7174
7275
transform : "identity", "normalize", "string", "label", "onehot" optional
7376
- For `Categorical` dimensions, the following transformations are
@@ -108,7 +111,7 @@ def _check_dimension(dimension, transform=None):
108111
return dimension
109112
elif isinstance(dimension, (list, np.ndarray)):
110113
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:
112115
low, high, *args = dimension
113116
if (isinstance(low, numbers.Integral)
114117
and isinstance(high, numbers.Integral)):

0 commit comments

Comments
 (0)
0