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

智能建站系统免费版wordpress 打开速度

智能建站系统免费版,wordpress 打开速度,一个空间放两个网站,wordpress主题屋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/559911/

相关文章:

  • 成都网站建设有名的公司怎么做出有品牌感的网站
  • 中国网站的建设淘宝数据网站开发
  • 深圳建站网站模板wordpress 文章最长
  • 服务器建立网站建网站做seo
  • 帮人做彩票网站支付接口网上请人做软件的网站
  • 万全网站建设wl17581做旅游广告在哪个网站做效果好
  • 钢城网站建设安徽省住房和城乡建设厅网站
  • 协会网站建设方案大良营销网站建设好么
  • 网站引导页一般是什么格式网页设计师的应聘岗位
  • 构建网站空间网站开发与维护招聘
  • 网站建设的网页怎么做番禺网站开发哪家强
  • 网站开发是程序员吗百度网盘下载电脑版官方下载
  • 中国电力建设集团网站杭州网站运营
  • 大气网站模板下载效果好的网站建设公
  • 住房和城乡建设部网站打不开重庆市建设工程信息网官网30系统
  • 做美食软件视频网站大数据精准营销策略
  • 网站后台密码错误陕西大型网站建设
  • 网站建站中关键字搜索怎么弄wordpress 后台插件无法访问
  • 做减肥餐的网站网站优化注意事项
  • 做网站做推广有效果吗专门做淘宝优惠券的网站
  • 菜谱网站开发系统ps做网页效果图
  • 徐州品牌网站建设wordpress多重筛选页面
  • 网站改版提示无需改版个人怎么申请微信小程序
  • 电子商务网站建设的简要任务执行书可以注册免费网站
  • 公司网站设计需要什么豪爵铃木摩托车官网
  • 建收费网站合肥地区网站制作
  • 自己做头像网站小网站建设公司
  • 电子商务建设与网站规划wordpress linux安装
  • wordpress新手建站win8网站模版
  • 网站的简单布局孝感 商务 网站建设