当前位置: 首页 > news >正文

优化网站性能监测石排镇做网站

优化网站性能监测,石排镇做网站,做交网站,网页制做写在前面 之前只停留在理论上#xff0c;没有实际沉下心去调参#xff0c;实际去做了后#xff0c;发现调参是个大工程#xff08;玄学#xff09;。于是这篇来总结一下sklearn中svm的参数说明以及调参经验。方便以后查询和回忆。 常用核函数 1.linear核函数: K(xi,xj)xTi… 写在前面 之前只停留在理论上没有实际沉下心去调参实际去做了后发现调参是个大工程玄学。于是这篇来总结一下sklearn中svm的参数说明以及调参经验。方便以后查询和回忆。 常用核函数 1.linear核函数: K(xi,xj)xTixjK(xi,xj)xiTxj 2.polynomial核函数: K(xi,xj)(γxTixjr)d,d1K(xi,xj)(γxiTxjr)d,d1 3.RBF核函数高斯核函数: K(xi,xj)exp(−γ||xi−xj||2),γ0K(xi,xj)exp(−γ||xi−xj||2),γ0 4.sigmoid核函数: K(xi,xj)tanh(γxTixjr),γ0,r0K(xi,xj)tanh(γxiTxjr),γ0,r0   sklearn svm 相关参数的官方说明 Parameters:C : float, optional (default1.0). Penalty parameter C of the error term.kernel : string, optional (default’rbf’). Specifies the kernel type to be used in the algorithm. It must be one of ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable. If none is given, ‘rbf’ will be used. If a callable is given it is used to pre-compute the kernel matrix from data matrices; that matrix should be an array of shape (n_samples, n_samples).degree : int, optional (default3). Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels.gamma : float, optional (default’auto’). Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’. If gamma is ‘auto’ then 1/n_features will be used instead.coef0 : float, optional (default0.0). Independent term in kernel function. It is only significant in ‘poly’ and ‘sigmoid’.probability : boolean, optional (defaultFalse). Whether to enable probability estimates. This must be enabled prior to calling fit, and will slow down that method.shrinking : boolean, optional (defaultTrue). Whether to use the shrinking heuristic.tol : float, optional (default1e-3). Tolerance for stopping criterion.cache_size : float, optional. Specify the size of the kernel cache (in MB).class_weight : {dict, ‘balanced’}, optional. Set the parameter C of class i to class_weight[i]C for SVC. If not given, all classes are supposed to have weight one. The “balanced” mode uses the values of y to automatically adjust weights inversely proportional to class frequencies in the input data as n_samples / (n_classesnp.bincount(y))verbose : bool, default: False. Enable verbose output. Note that this setting takes advantage of a per-process runtime setting in libsvm that, if enabled, may not work properly in a multithreaded context.max_iter : int, optional (default-1). Hard limit on iterations within solver, or -1 for no limit.decision_function_shape : ‘ovo’, ‘ovr’ or None, defaultNone. Whether to return a one-vs-rest (‘ovr’) decision function of shape (n_samples, n_classes) as all other classifiers, or the original one-vs-one (‘ovo’) decision function of libsvm which has shape (n_samples, n_classes * (n_classes - 1) / 2). The default of None will currently behave as ‘ovo’ for backward compatibility and raise a deprecation warning, but will change ‘ovr’ in 0.19.New in version 0.17: decision_function_shape’ovr’ is recommended.Changed in version 0.17: Deprecated decision_function_shape’ovo’ and None.random_state : int seed, RandomState instance, or None (default). The seed of the pseudo random number generator to use when shuffling the data for probability estimation. libsvm中参数说明 因为sklearn底层是调用libsvm的因此sklearn中svm参数说明是可以直接参考libsvm中的。 1.linear核函数: K(xi,xj)xTixjK(xi,xj)xiTxj 2.polynomial核函数: K(xi,xj)(γxTixjr)d,d1K(xi,xj)(γxiTxjr)d,d1 3.RBF核函数高斯核函数: K(xi,xj)exp(−γ||xi−xj||2),γ0K(xi,xj)exp(−γ||xi−xj||2),γ0 4.sigmoid核函数: K(xi,xj)tanh(γxTixjr),γ0,r0K(xi,xj)tanh(γxiTxjr),γ0,r0   首先介绍下与核函数相对应的参数1对于线性核函数没有专门需要设置的参数2对于多项式核函数有三个参数。-d用来设置多项式核函数的最高次项次数也就是公式中的d默认值是3。-g用来设置核函数中的gamma参数设置也就是公式中的gamma默认值是1/k特征数。-r用来设置核函数中的coef0也就是公式中的第二个r默认值是0。3对于RBF核函数有一个参数。-g用来设置核函数中的gamma参数设置也就是公式中gamma默认值是1/kk是特征数。4对于sigmoid核函数有两个参数。-g用来设置核函数中的gamma参数设置也就是公式中gamma默认值是1/kk是特征数。-r用来设置核函数中的coef0也就是公式中的第二个r默认值是0。 具体来说说rbf核函数中C和gamma  SVM模型有两个非常重要的参数C与gamma。其中 C是惩罚系数即对误差的宽容度。c越高说明越不能容忍出现误差,容易过拟合。C越小容易欠拟合。C过大或过小泛化能力变差 gamma是选择RBF函数作为kernel后该函数自带的一个参数。隐含地决定了数据映射到新的特征空间后的分布gamma越大支持向量越少gamma值越小支持向量越多。支持向量的个数影响训练与预测的速度。 这里面大家需要注意的就是gamma的物理意义大家提到很多的RBF的幅宽它会影响每个支持向量对应的高斯的作用范围从而影响泛化性能。我的理解如果gamma设的太大方差会很小方差很小的高斯分布长得又高又瘦 会造成只会作用于支持向量样本附近对于未知样本分类效果很差存在训练准确率可以很高(如果让方差无穷小则理论上高斯核的SVM可以拟合任何非线性数据但容易过拟合)而测试准确率不高的可能就是通常说的过训练而如果设的过小则会造成平滑效应太大无法在训练集上得到特别高的准确率也会影响测试集的准确率。 此外可以明确的两个结论是结论1样本数目少于特征维度并不一定会导致过拟合这可以参考余凯老师的这句评论“这不是原因啊呵呵。用RBF kernel, 系统的dimension实际上不超过样本数与特征维数没有一个trivial的关系。” 结论2RBF核应该可以得到与线性核相近的效果按照理论RBF核可以模拟线性核可能好于线性核也可能差于但是不应该相差太多。当然很多问题中比如维度过高或者样本海量的情况下大家更倾向于用线性核因为效果相当但是在速度和模型大小方面线性核会有更好的表现。 Referencehttp://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVChttp://blog.csdn.net/lqhbupt/article/details/8610443http://blog.csdn.net/lujiandong1/article/details/46386201 转载于:https://www.cnblogs.com/sddai/p/9696771.html
http://www.yutouwan.com/news/496757/

相关文章:

  • 建设网站投标标书范本图片如何连接到wordpress
  • 无法连接到wordpress站点长春通信网络
  • 深圳的网站建设的公司绍兴公司网站建设
  • 删除百度收录的网站网站运营部门职责
  • 新网金商网站怎么做网站关键词推广
  • 壹搜网站建设如何设置网站的关键词
  • 网站做不下去化学试剂网站建设
  • 爱站网主要功能企业开发流程
  • 什么是静态页面网站软件开发工程师胜任力模型
  • 网站建设的具体流程县网站建设检查情况汇报
  • 做服装外贸哪个网站好简述网络营销的方法
  • 私人定制网站建设网站开发维护员挣钱吗
  • 网站改版一般需要多久百度关键词推广价格查询
  • 网站设计模板免费快速开发小程序
  • 做网站 语言wordpress paypal收款
  • 服务器不是自己的做违法网站观光农业规划设计
  • 网站域名费用怎么做分录个人网站 不备案
  • 亦庄网站开发wordpress百万文章秒开
  • 做网站如何不被忽悠wordpress底部文件修改
  • 建站需要钱中恒建设职业技术培训学校网站
  • 需要建设一个什么样的网站牡丹江地区做网站的公司
  • 公司网站怎么做简介创世网络网站建设怎么样
  • 网站建设丶金手指a排名15wordpress如何压缩图片大小
  • 网站开发主要技术wordpress最大上传
  • 宁波建网站选哪家好一点dedecms网站入侵
  • 广西南宁网站制作网站怎么做区域性优化
  • 网站什么时候备案好百度搜索引擎排名规则
  • 品牌网站设计公司wordpress内容表单
  • 潍坊网站建设 潍坊做网站信息流广告投放平台
  • 麻将网站开发有哪些建站的公司