python - 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)
解决方案
推荐阅读
- python - Fabric:如何访问 postgres shell
- flutter - 如何创建网格布局?
- c# - 如何在不同的方法中验证在一个方法中创建的用户信息对象
- exoplayer2.x - 如何序列化/存储 Media3/ExoPlayer MediaItem
- java - Android numberPicker to countdownTimer
- python - SQLAlchemy ORM & 依赖倒置
- ionic-framework - 在 ionic5 ion-slide 中转到您想要的幻灯片页面
- visual-studio - 如何更改 Visual Studio 中选项卡布局的字体和背景颜色?
- python - 值错误:使用 GPT-J 进行文本摘要时索引不能包含负值
- sml - 为什么标准 ml 中的此功能附加列表不起作用?