导入时出现下列问题
FutureWarning: The sklearn.linear_model.coordinate_descent module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.linear_model. Anything that cannot be imported from sklearn.linear_model is now part of the private API.
warnings.warn(message, FutureWarning)
翻译为:
FutureWarning:sklearn.linear_model.coordinate_descent 模块在 0.22 版中已弃用,并将在 0.24 版中删除。 相应的类/函数应该从 sklearn.linear_model 导入。 任何不能从 sklearn.linear_model 导入的东西现在都是私有 API 的一部分。
因此,使用新版本的sklearn时无法导入ConvergenceWarning。
解决方法如下:
改用:
from sklearn.exceptions import ConvergenceWarning