首页 > 解决方案 > ConvergenceWarning:Liblinear 无法收敛

问题描述

在 EEG 数据集上训练 SVM 时,我收到一条警告消息。我试图用不同的迭代次数来解决错误,但这没有帮助。请你帮助我好吗?这是我使用的代码的一部分。

mean=np.mean(temp, axis=1, keepdims=True)
std=np.std(temp, axis=1, keepdims=True) 
if standard_before:
signal = (signal-mean)/std 
if apply_class_weight:
y0_rate = np.mean(np.where(y == 0, 1, 0))
y1_rate = np.mean(np.where(y == 1, 1, 0))
class_weight = {0: y1_rate, 1: y0_rate}
else:
class_weight = None
classifier=Block.LinearSVC(class_weight=class_weight, max_iter=7000)

标签: pythonpython-3.xsvmstandardized

解决方案


推荐阅读