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

网校网站模板东莞网站关键字

网校网站模板,东莞网站关键字,用什么软件做网站交互效果,深圳做网站公司华弹性网络 代码原文 下面代码参考scikit-learn中文社区#xff0c;链接在上面。 但是由于scikit-learn中文社区上的代码有些地方跑不通#xff0c;故对此代码做了修改#xff0c;输出结果与社区中显示的结果相同。 对弹性网络进行简单的介绍#xff1a; ElasticNet是一个训…弹性网络 代码原文 下面代码参考scikit-learn中文社区链接在上面。 但是由于scikit-learn中文社区上的代码有些地方跑不通故对此代码做了修改输出结果与社区中显示的结果相同。 对弹性网络进行简单的介绍 ElasticNet是一个训练时同时用ℓ1和ℓ2范数进行正则化的线性回归模型lasso是使用ℓ1范数进行正则化的线性回归模型。弹性网络简弹性网络简介弹性网络简 from itertools import cycle import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import lasso_path, enet_path from sklearn import datasetsX, y datasets.load_diabetes(return_X_yTrue)X / X.std(axis0) # Standardize data (easier to set the l1_ratio parameter) print(------------------------------------) print(X) print(------------------------------------) print(y) # Compute pathseps 5e-3 # the smaller it is the longer is the pathprint(Computing regularization path using the lasso...) # alphas_lasso, coefs_lasso, _ lasso_path(X, y, epseps, fit_interceptFalse) alphas_lasso, coefs_lasso, _ lasso_path(X, y)print(Computing regularization path using the positive lasso...) # alphas_positive_lasso, coefs_positive_lasso, _ lasso_path( # X, y, epseps, positiveTrue, fit_interceptFalse) alphas_positive_lasso, coefs_positive_lasso, _ lasso_path(X, y, epseps, positiveTrue)print(Computing regularization path using the elastic net...) # alphas_enet, coefs_enet, _ enet_path( # X, y, epseps, l1_ratio0.8, fit_interceptFalse) alphas_enet, coefs_enet, _ enet_path(X, y, epseps, l1_ratio0.8)print(Computing regularization path using the positive elastic net...) # alphas_positive_enet, coefs_positive_enet, _ enet_path( # X, y, epseps, l1_ratio0.8, positiveTrue, fit_interceptFalse) alphas_positive_enet, coefs_positive_enet, _ enet_path(X, y, epseps, l1_ratio0.8, positiveTrue) print(------------------------------------) print(alphas_positive_enet) print(------------------------------------) print(coefs_positive_enet) # Display resultsplt.figure(1) colors cycle([b, r, g, c, k]) neg_log_alphas_lasso -np.log10(alphas_lasso) neg_log_alphas_enet -np.log10(alphas_enet) for coef_l, coef_e, c in zip(coefs_lasso, coefs_enet, colors):l1 plt.plot(neg_log_alphas_lasso, coef_l, cc)l2 plt.plot(neg_log_alphas_enet, coef_e, linestyle--, cc)plt.xlabel(-Log(alpha)) plt.ylabel(coefficients) plt.title(Lasso and Elastic-Net Paths) plt.legend((l1[-1], l2[-1]), (Lasso, Elastic-Net), loclower left) plt.axis(tight)plt.figure(2) neg_log_alphas_positive_lasso -np.log10(alphas_positive_lasso) for coef_l, coef_pl, c in zip(coefs_lasso, coefs_positive_lasso, colors):l1 plt.plot(neg_log_alphas_lasso, coef_l, cc)l2 plt.plot(neg_log_alphas_positive_lasso, coef_pl, linestyle--, cc)plt.xlabel(-Log(alpha)) plt.ylabel(coefficients) plt.title(Lasso and positive Lasso) plt.legend((l1[-1], l2[-1]), (Lasso, positive Lasso), loclower left) plt.axis(tight)plt.figure(3) neg_log_alphas_positive_enet -np.log10(alphas_positive_enet) for (coef_e, coef_pe, c) in zip(coefs_enet, coefs_positive_enet, colors):l1 plt.plot(neg_log_alphas_enet, coef_e, cc)l2 plt.plot(neg_log_alphas_positive_enet, coef_pe, linestyle--, cc)plt.xlabel(-Log(alpha)) plt.ylabel(coefficients) plt.title(Elastic-Net and positive Elastic-Net) plt.legend((l1[-1], l2[-1]), (Elastic-Net, positive Elastic-Net),loclower left) plt.axis(tight) plt.show()
http://www.pierceye.com/news/732030/

相关文章:

  • 做游戏的php网站2019做seo网站
  • 做外贸那个网站好免费asp主机网站
  • 网站设计服务要不要交文化事业建设费在线解压zip网站
  • 沈阳关键词自然排名西安百度seo排名软件
  • 徐州网站建设市场分析手工灯笼简单又好看
  • 网站开发学什么语音提供设计的的网站
  • 微站和网站数据同步icp备案查询
  • 诸城网站制作wordpress圆角插件汉化
  • 杨家平网站建设小程序开发网站
  • 校园文化建设图片网站浅析图书馆门户网站建设
  • 网站开发与应用案例教程哈尔滨自助建站系统
  • 网站关键词排名seo百度网址链接是多少
  • 电子商务网站的建设收益直播软件的app
  • 遵义在百度做个网站多少钱如何建立企业网站
  • 我想做个网站手机网站建设优势
  • 网站制作毕业设计滁州市建设局网站
  • saas建站和开源建站的区别比较高端的网页
  • 新公司董事长致辞做网站wordpress二次开发手册chm
  • 网站显示建设中大型企业网站制作
  • 长沙自动化网站建设wordpress 自定义栏目 调用
  • 吉大建设工程学院官方网站wordpress 文章图片插件
  • 赤峰中国建设招标网站网页设计素材网站推荐
  • 天津网站建设电焊机wordpress主题jenney
  • 个人网站制作wordpress英文注册查询网站
  • 哪里有免费网站空间申请wordpress重定向插件
  • 福州微网站开发什么样的网站快速盈利
  • 吉首市建设局官方网站一对一直播软件开发定制
  • 网站开发验收单做的网站如何被百度搜到
  • 网站的数据库是什么两学一做网站链接
  • 做窗帘网站济南网络科技公司排名