Open cleysonl opened 4 years ago
Are you using the versions mentioned in this git repo?
Good point, I am using windows so maybe that's the problem. Let me go through it again using Linux and the exact same versions in the git repo and I'll come back to you.
If im not wrong, windows shouldn't be a problem. could you try creating environment from files mentioned in this repo? README file, in the end.?
Used the requirements.txt
in the repo for my conda environment and still got the error.
(ml) C:\Users\leyso\Documents\Courses\Approaching almost all ML problems\Chapter 8\src>python rf_gp_minimize.py
[Integer(low=3, high=15, prior='uniform', transform='identity'), Integer(low=100, high=1500, prior='uniform', transform='identity'), Categorical(categories=('gini', 'entropy'), prior=None), Real(low=0.01, high=1, prior='uniform', transform='identity')]
Iteration No: 1 started. Evaluating function at random point.
Traceback (most recent call last):
File "rf_gp_minimize.py", line 109, in <module>
result = gp_minimize(
File "C:\Users\leyso\anaconda3\envs\ml\lib\site-packages\skopt\optimizer\gp.py", line 264, in gp_minimize
return base_minimize(
File "C:\Users\leyso\anaconda3\envs\ml\lib\site-packages\skopt\optimizer\base.py", line 271, in base_minimize
next_x = optimizer.ask()
File "C:\Users\leyso\anaconda3\envs\ml\lib\site-packages\skopt\optimizer\optimizer.py", line 332, in ask
return self._ask()
File "C:\Users\leyso\anaconda3\envs\ml\lib\site-packages\skopt\optimizer\optimizer.py", line 398, in _ask
return self.space.rvs(random_state=self.rng)[0]
File "C:\Users\leyso\anaconda3\envs\ml\lib\site-packages\skopt\space\space.py", line 764, in rvs
if sp_version < (0, 16):
TypeError: '<' not supported between instances of 'Version' and 'tuple'
Had to install scikit-optimize
because it wasn't in the file requirements.txt
.
Which version are you using? I have 0.7.4
Just ran the exactly same code with a new environment created inside WSL2 using the requirements.txt
file in the repo an runs perfectly. Maybe it is a Windows thing.
Hi, I am running the code for
gp_minimize.py
and in the following part of the code I get an error:The error is the following:
Exception has occurred: TypeError '<' not supported between instances of 'Version' and 'tuple'
Going through the
gp_minimize
info there is an example:Where
[(-2.0, 2.0)]
is what we have asparam_space
in the book but if I print the latter we get:[Integer(low=3, high=15, prior='uniform', transform='identity'), Integer(low=100, high=1500, prior='uniform', transform='identity'), Categorical(categories=('gini', 'entropy'), prior=None), Real(low=0.01, high=1, prior='uniform', transform='identity')]
Wondering if the error is the way we are passing the values but didn't found anything.