首页 > 其他 > 详细

The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features.

时间:2019-07-11 22:47:20      阅读:456      评论:0      收藏:0      [点我收藏+]

实现《python数据科学手册》代码时出现如下警告:

py:196: FutureWarning: The default value of gamma will change from auto to scale in version 0.22 to account better for unscaled features. Set gamma explicitly to auto or scale to avoid this warning.
  "avoid this warning.", FutureWarning

出现该警告的源码如下:

clf = SVC(kernel=rbf, C=1E6)
clf.fit(X, y)

解决方案:

根据 warning 的提示,在 C=1E6 后加上 , gamma=‘auto‘, 即

clf = SVC(kernel=rbf, C=1E6, gamma=auto)
clf.fit(X, y)

 

The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features.

原文:https://www.cnblogs.com/xiangsui/p/11172906.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!