Integer
ConfigSpace.api.types.integer
#
Integer
#
Integer(
name: str,
bounds: tuple[int, int],
*,
distribution: Distribution | None = None,
default: int | None = None,
log: bool = False,
meta: dict | None = None
) -> (
UniformIntegerHyperparameter
| NormalIntegerHyperparameter
| BetaIntegerHyperparameter
)
Create an IntegerHyperparameter.
# Uniformly distributed
Integer("a", (1, 10))
Integer("a", (1, 10), distribution=Uniform())
# Normally distributed at 2 with std 3
Integer("b", (0, 5), distribution=Normal(2, 3))
# Beta distributed with alpha 1 and beta 2
Integer("c", (0, 3), distribution=Beta(1, 2))
# Give it a default value
Integer("a", (1, 10), default=4)
# Sample on a log scale
Integer("a", (1, 100), log=True)
# Add meta info to the param
Integer("a", (1, 10), meta={"use": "For counting chickens"})
Note
Integer
is actually a function, please use the corresponding return types if
doing an isinstance(param, type)
check and not Integer
.
PARAMETER | DESCRIPTION |
---|---|
name |
The name to give to this hyperparameter
TYPE:
|
bounds |
The bounds to give to the integer. |
distribution |
The distribution to use for the hyperparameter. See above
TYPE:
|
default |
The default value to give to the hyperparameter.
TYPE:
|
log |
Whether to this parameter lives on a log scale
TYPE:
|
meta |
Any meta information you want to associate with this parameter
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
UniformIntegerHyperparameter | NormalIntegerHyperparameter | BetaIntegerHyperparameter
|
The corresponding hyperparameter type |
Source code in src/ConfigSpace/api/types/integer.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|