Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Possible Minor Bug] Encoding of NaN's in run encoding #120

Open
eddiebergman opened this issue Feb 23, 2024 · 0 comments
Open

[Possible Minor Bug] Encoding of NaN's in run encoding #120

eddiebergman opened this issue Feb 23, 2024 · 0 comments

Comments

@eddiebergman
Copy link
Contributor

eddiebergman commented Feb 23, 2024

I found this comment here where it says "NaNs should be encodere with -0.5" yet the actual imputation value is -0.2.

In def encode_config()

for value, hp in zip(values, hps):
# NaNs should be encoded as -0.5
if np.isnan(value):
value = NAN_VALUE
# Categorical values should be between 0..1
elif isinstance(hp, CategoricalHyperparameter):
value = value / (len(hp.choices) - 1)
# Constants should be encoded as 1.0 (from 0)
elif isinstance(hp, Constant):
value = CONSTANT_VALUE
x += [value]
return x

In constants.py

NAN_VALUE = -0.2
NAN_LABEL = "NaN"
VALUE_RANGE = [NAN_VALUE, 1]
CONSTANT_VALUE = 1.0
BORDER_CONFIG_ID = -1 # Used for border configs
RANDOM_CONFIG_ID = -2 # Used for random configs
COMBINED_COST_NAME = "Combined Cost"
COMBINED_BUDGET = -1

Not sure which is "correct". From the configuration footprint point of view (where I found it from), I imagine -0.5 is a bit better as everything else is scaled from (0, 1) when valid. However this encoding is a bit more general and used for other purposes it's probably good to find the original source to clarfiy. I don't know what that orginal source is unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant