ConvergenceWarning: Liblinear failed to converge, increase the number of iterations解决办法

训练时出现了这个警告

warnings.warn(ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.

根据提示,知道问题出在== Liblinear ==,它说Liblinear收敛失败,要增加迭代次数

ConvergenceWarning: Liblinear failed to converge, increase the number of iterations解决办法_第1张图片

解决:

找到Liblinear的字段
ConvergenceWarning: Liblinear failed to converge, increase the number of iterations解决办法_第2张图片
此处是默认值,默认max_iter=1000
要增加迭代,所以修改为max_iter=10000,或者其他数值,要大于默认值
ConvergenceWarning: Liblinear failed to converge, increase the number of iterations解决办法_第3张图片

再次运行,问题解决。ConvergenceWarning: Liblinear failed to converge, increase the number of iterations解决办法_第4张图片

你可能感兴趣的:(python,svm)