ML之回归预测:利用十(xgboost,10-1)种机器学习算法对无人驾驶汽车系统参数(2017年的data,18+2)进行回归预测值VS真实值——bug调试记录

2021/6/15 20:33:25

本文主要是介绍ML之回归预测:利用十(xgboost,10-1)种机器学习算法对无人驾驶汽车系统参数(2017年的data,18+2)进行回归预测值VS真实值——bug调试记录,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

ML之回归预测:利用十(xgboost,10-1)种机器学习算法对无人驾驶汽车系统参数(2017年的data,18+2)进行回归预测值VS真实值——bug调试记录

 

 

 

目录

输出结果

1、增加XGBR算法


 

 

 

 

输出结果

1、增加XGBR算法

1、增加XGBR算法时候,采用网格搜索的方法

XGBR_grid_model Training time: 135.60037931849538
输出XGBR_grid_model模型的最优参数: 
 {'learning_rate': 0.03, 'max_depth': 4, 'n_estimators': 100}
XGBR_grid_model_best_score: 0.7993051604810518
XGBR_grid_model_score: -0.339632045000555

2、增加XGBR算法时候,调用得到的最佳参数,却输不出最佳参数对应的准确度!

 

3、增加XGBR算法时候,对新数据进行预测,遇到bug:因为XGBR算法,要求传入的数据都为数值型

成功解决ValueError: DataFrame.dtypes for label must be int, float or bool

 

4、默认配置参数,输出的准确度较低:54%
(1)、通过特征选择可得到最高准确度为67.69%

ML之回归预测:利用十种机器学习(LiR+xgboost(特征重要性+特征选择))算法对无人驾驶汽车系统参数(2017年的data,18+2)进行回归预测值VS真实值

 

XGBR:The value of default parameter of XGBR is 0.539021005879261
XGBR:R-squared value of DecisionTreeRegressor: 0.539021005879261
XGBR:测试[12.8, 13.0]行数据, 
 [53.609283 53.47569  53.920986 53.920986 53.61446  53.61446  53.826157
 53.773552 53.44194  53.09419  54.089035 54.353115 53.321796 53.293243
 53.970306 53.752117 53.460567 53.44237  53.840027 53.920986 52.35085
 57.61133  57.598843 57.911274 58.06042  57.945023 57.665913]
------------------------------------------------------------
XGBR_model.feature_importances_: 
 [0.08985916 0.01444405 0.08940411 0.         0.03163605 0.01870877
 0.00869713 0.12159647 0.03933521 0.12161936 0.02289704 0.04260873
 0.02663714 0.04179822 0.03441375 0.14182347 0.01409451 0.14042689]
Thresh=0.000, n=18, Accuracy: 52.56%
Thresh=0.009, n=17, Accuracy: 52.56%
Thresh=0.014, n=16, Accuracy: 51.94%
Thresh=0.014, n=15, Accuracy: 52.89%
Thresh=0.019, n=14, Accuracy: 54.23%
Thresh=0.023, n=13, Accuracy: 53.38%
Thresh=0.027, n=12, Accuracy: 52.86%
Thresh=0.032, n=11, Accuracy: 53.08%
Thresh=0.034, n=10, Accuracy: 64.67%
Thresh=0.039, n=9, Accuracy: 67.69%
Thresh=0.042, n=8, Accuracy: 66.25%
Thresh=0.043, n=7, Accuracy: 67.52%
Thresh=0.089, n=6, Accuracy: 64.64%
Thresh=0.090, n=5, Accuracy: 40.05%
Thresh=0.122, n=4, Accuracy: 37.93%
Thresh=0.122, n=3, Accuracy: 19.23%
Thresh=0.140, n=2, Accuracy: 22.15%
Thresh=0.142, n=1, Accuracy: 11.77%

 

 

 

 

 

 

 

 

 

 

 

 

 

 



这篇关于ML之回归预测:利用十(xgboost,10-1)种机器学习算法对无人驾驶汽车系统参数(2017年的data,18+2)进行回归预测值VS真实值——bug调试记录的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程