Closed poroc300 closed 2 years ago
Hi, thanks for the report! I've checked this and it happens because spacy samples from a uniform distribution with limits [lower, lower + upper] instead of [lower, upper], that is something that I missed. I'll fix this and release it on 0.6.1 this week.
Thank you for addressing this.
System information OS Platform and Distribution: Windows 10 Sklearn-genetic-opt version: 0.6.0 Scikit-learn version: 0.24.1 Python version: 3.8
Describe the bug When defining a
Continuous
parameter range, it appears the generated values are not within the specified range. This is evident for algorithms that have hyperparameters, in which, the values can only be within an interval (e.g. between 0 and 1). Below, I show an example with aRandomForestRegressor
where the parametermin_weight_fraction_leaf
has a limit of [0 - 0.5].To Reproduce
Expected behavior The analysis above will raise
ValueError: min_weight_fraction_leaf must in [0, 0.5]
. This means thatContinuous(0.45, 0.49)
is generating values outside [0 - 0.5] even though I have specified those to be within 0.45 and 0.49. This problem also occurs with other algorithms, such asXGBRegressor
with the parametersubsample
(interval between 0 and 1). In the latter case I have specifiedContinuous(0, 1)
and I was getting the error that values forsubsample
were 1.2 or even higher.Screenshots Full error log for the analysis with
RandomForestRegressor
: