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

企业网站的推广方法有哪些上海猎头公司前十名

企业网站的推广方法有哪些,上海猎头公司前十名,重庆景点简笔画,网站维护主要做什么1. 随机森林超参数 极其重要的三个超参数是必须要调整的#xff0c;一般再加上两到三个其他超参数进行优化即可。 2. 学习曲线确定n_estimators搜索范围 首先导入必要的库#xff0c;使用sklearn自带的房价预测数据集#xff1a; import numpy as np import pandas as pd f…1. 随机森林超参数 极其重要的三个超参数是必须要调整的一般再加上两到三个其他超参数进行优化即可。 2. 学习曲线确定n_estimators搜索范围 首先导入必要的库使用sklearn自带的房价预测数据集 import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.datasets import fetch_california_housing from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import KFold from sklearn.model_selection import cross_validate import matplotlib.pyplot as plt housing fetch_california_housing() # 特征数据 X housing.data[:, [0, 1, 2, 3, 4, 5, 6, 7]] # 目标变量房价 y housing.target 初始化以及5折交叉验证计算RMSE trainRMSE np.array([]) testRMSE np.array([]) trainSTD np.array([]) testSTD np.array([])Option range(5,101,5) for n_estimators in Option :reg_f RandomForestRegressor(n_estimatorsn_estimators, random_state1412)# 交叉验证输出结果cv KFold(n_splits5,shuffleTrue,random_state1412)result_f cross_validate(reg_f,X,y,cvcv,scoringneg_mean_squared_error,return_train_scoreTrue,n_jobs-1)# 根据输出的MSE进行RMSE计算train abs(result_f[train_score])**0.5test abs(result_f[test_score])**0.5trainRMSE np.append(trainRMSE,train.mean())testRMSE np.append(testRMSE,test.mean())trainSTD np.append(trainSTD,train.std())testSTD np.append(testSTD,test.std()) 定义绘图函数  def plotCVresult(Option,trainRMSE,testRMSE,trainSTD,testSTD) :xaxis Option# RMSEplt.plot(xaxis, trainRMSE,colork,labelRandomForestTrain)plt.plot(xaxis, testRMSE, colorred, labelRandomForestTest)# 将标准差围绕在RMSE旁边区间越大表示模型越不稳定plt.plot(xaxis, trainRMSE trainSTD, colork, linestyledotted)plt.plot(xaxis, trainRMSE - trainSTD, colork, linestyledotted)plt.plot(xaxis, testRMSE testSTD, colorred, linestyledotted)plt.plot(xaxis, testRMSE - testSTD, colorred, linestyledotted)plt.xticks([*xaxis])plt.legend(loc1)plt.xlabel(n_estimators)plt.ylabel(RMSE)plt.title(Learning Curve)plt.show()plotCVresult(Option,trainRMSE,testRMSE,trainSTD,testSTD) 输出结果如下  3. 使用Tree模块判断max_depth搜索范围 只需在输出的最小值和最大值之间进行搜索即可。 reg_f RandomForestRegressor(n_estimators100,random_state1412) reg_f reg_f.fit(X,y) d pd.Series([],dtypeint64) for idx,t in enumerate(reg_f.estimators_) :d[idx] t.tree_.max_depth print(决策树的最大深度的最小值为,d.min()) print(决策树的最大深度的最大值为,d.max()) 输出结果为 4. 使用Tree模块判断min_weight_fraction_leaf搜索范围 reg_f RandomForestRegressor(n_estimators100,random_state1412) reg_f reg_f.fit(X,y) n pd.Series([],dtypeint64) for idx,t in enumerate(reg_f.estimators_) :n[idx] t.tree_.weighted_n_node_samples meann np.zeros(20) for i in range(0,20) :meann[i] n[i].mean() print(决策树分枝所需最小样本权重的最小值为,meann.min()) print(决策树分枝所需最小样本权重的最大值为,meann.max()) print(决策树分枝所需最小样本权重的平均值为,meann.mean()) 输出结果为 5. 使用Tree模块判断min_sample_split搜索范围 reg_f RandomForestRegressor(n_estimators20,random_state1412) reg_f reg_f.fit(X,y) s pd.Series([],dtypeint64) for idx,t in enumerate(reg_f.estimators_) :s[idx] t.tree_.n_node_samples meann np.zeros(20) for i in range(0,20) :meann[i] s[i].mean() print(决策树需要最小样本的最小值为,meann.min()) print(决策树需要最小样本的最大值为,meann.max()) print(决策树需要最小样本的平均值为,meann.mean()) 输出结果为
http://www.w-s-a.com/news/51499/

相关文章:

  • 电商网站建设建议免费下载app
  • 网站搭建设计是什么意思百度地图放到网站上
  • 东莞网站建设市场分析淘宝网站框架
  • 新网站多久被百度收录网站空间单位
  • 2017常用的网站昆明网站代理
  • 成都海鸥手表网站安阳网站建设策划
  • 做好的网站怎么发布做网站应该做哪方面的
  • 可以找厂家的网站品牌创意型网站开发
  • 有没有做牛羊角的网站电商网站报价
  • 网站建设行业咨讯文章网站兼容模式怎么设置
  • 商务网站建设概念东莞做网站的公司吗
  • 高稳定性的网站设计制作wordpress 检测插件
  • 无锡网站制作排名自适应网站建设推荐
  • 度娘网站桃花怎么做网站制作 p
  • 小欢喜林磊儿什么网站做家教搜索优化公司
  • 龙岗做网站哪里找网站建设简介是什么意思
  • 做网站的标准北京西站出站口
  • asp.net新建网站市场营销管理是做什么的
  • 南昌网站建设模板服务商建设什么网站挣钱
  • 网站建设实训记录企业网站建设运营
  • 视频网站文案住房和城乡建设部门
  • 汕头网站排名推广新余门户网站开发
  • 湖南智能网站建设哪家好wordpressμ
  • 公司网站备案必须是企业信息么睢宁县凌城做网站的
  • 上海网站建设公司 珍岛宁波免费自助建站模板
  • 南昌知名的网站建设公司南京网站开发选南京乐识赞
  • 外贸网站建设 深圳seo怎么提升关键词的排名
  • 网站推广效果的评价google关键词
  • 模板网站建站哪家好做微信充值网站
  • 抽奖的网站怎么做的广州小程序定制开发