语法错误尝试调用sklearn_genetic
安装Sklearn-Genetic-Opt之后 我试图使用此代码来称呼它
from sklearn_genetic import GASearchCV
from sklearn_genetic.space import Continuous
from sklearn_genetic.plots import plot_fitness_evolution, plot_search_space
,但是我遇到了这个语法错误,但我不知道
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\IPython\core\interactiveshell.py:3398 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Input In [9] in <cell line: 26>
from sklearn_genetic import GASearchCV
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn_genetic\__init__.py:1 in <module>
from .genetic_search import GASearchCV, GAFeatureSelectionCV
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn_genetic\genetic_search.py:6 in <module>
from deap import base, creator, tools
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\deap\base.py:192
raise TypeError, ("Both weights and assigned values must be a "
^
SyntaxError: invalid syntax
我是Python的新手,您能帮助我定义这是什么错误?
After Installing sklearn-genetic-opt
I tried to call it with this code
from sklearn_genetic import GASearchCV
from sklearn_genetic.space import Continuous
from sklearn_genetic.plots import plot_fitness_evolution, plot_search_space
But I got this Syntax Error, and I don't have an idea what is that
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\IPython\core\interactiveshell.py:3398 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Input In [9] in <cell line: 26>
from sklearn_genetic import GASearchCV
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn_genetic\__init__.py:1 in <module>
from .genetic_search import GASearchCV, GAFeatureSelectionCV
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn_genetic\genetic_search.py:6 in <module>
from deap import base, creator, tools
File c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\deap\base.py:192
raise TypeError, ("Both weights and assigned values must be a "
^
SyntaxError: invalid syntax
I am new to Python, can you help me define what error is this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论