基于XGBoost方法的共享单车需求预测

 2022-07-11 08:07

论文总字数:32973字

摘 要

共享单车秉承低碳环保、共用共享的理念,现已成为人们日常出行的一个重要交通工具,有效的需求量(租用量)预测有助于共享单车公司及时调整不同地段的布局策略和维修计划,提高盈利能力,也方便了市民的出行。

本文以某地2016年1月1日0:00至2017年12月31日24:00的共享单车租用量及相关信息为数据集,使用R语言进行编程实现,预测了2016 ~ 2017年每月20日0:00至月底24:00的共享单车的租用量。

在实验过程中,首先采用了探索性数据分析与可视化描述,得到了各个因子和租用量的大致关系;特征工程中,对原始数据和原始因子进行处理,完成特征构建、特征选择和特征生成三个步骤,选出用于单模型的训练特征,实践时采用了XGBoost(Extreme Gradient Boosting)模型和随机森林(Random Forest)模型,并以RMSE(Root Mean Square Error)和运行时长作为评价标准。通过对比,初步发现XGBoost能够取得更好的效果。为探索更加高效的解决方案,本文采用主成分分析法筛选特征,结合XGBoost模型建立组合模型,实验证明,最终的组合模型可以明显提高共享单车需求量预测的精度。

关键词:XGBoost算法,机器学习,共享单车需求预测

Abstract

The main idea of shared bikes is environment protection and sharing, and the shared bikes have become one of the most popular means of transportation in the modern society. Therefore, if the amount of rented bikes can be predicted efficiently as well as accurately, the bike-sharing companies will benefit from which, and as a result, earn more profit.

The count of rented bikes as well as some related information in the time between 2016/01/01 0:00 to 2017/12/31 24:00 is taken as the dataset for analysis and prediction with R.

First of all, exploratory data analysis and visualization methods are used to find out the relationship between the independent and the dependent variable, which provide helpful information for the next steps. During feature engineering, the raw data are transformed into new features that better represent the problems to the predictive models. The XGBoost model (by Chen Tianqi) and Random Forest model are chosen to train the data, and the metric is RMSE (Root Mean Square Error) as well as time duration. The XGBoost performs far better in both accuracy and efficiency by comparison. To further improve the accuracy of XGBoost model, it takes a lot of time on parameter adjustment. In order to explore more efficient solutions, the PCA (Principle Component Analysis) is also used as part of the original combined model, which turns out to be the best among three models.

KEY WORDS: XGBoost, Machine Learning, Bike demand prediction

目录

摘要 I

Abstract Ⅱ

第一章 引言 4

1.1 选题背景和意义 4

1.2 现状 4

1.3 可行性分析 4

第二章 基础算法综述 6

2.1 提升树简介 6

2.2 梯度提升树 7

2.3 分裂点查找算法 8

2.3.1 近似算法 8

2.3.2 加权分位数图 9

2.3.3 稀疏感知分裂点查找算法 10

2.4 系统设计 10

2.4.1 并行式学习的列块 10

2.4.2 高速缓存感知通道 11

2.4.3 out-of-core 计算的块 11

2.5 相关工作 12

2.6 端对端评测 12

2.7 随机森林 13

2.7.1 简述 13

2.7.2 随机森林的生成 13

第三章 探索性数据分析(EDA)、数据的可视化描述 14

3.1 数据描述和数据字典 14

3.2 可视化描述 15

第四章 模型实现 20

4.1 特征工程 20

4.1.1 简述 20

4.1.2 数据预处理和特征构建 21

4.1.3 组合算法 22

4.2 模型选择和优化 22

4.2.1 XGBoost的模型参数 22

4.2.2 XGBoost调参方法 23

4.3 组合算法探索 24

4.4 模型对比和优化 25

4.4.1 交叉验证和参数表 25

4.4.2 评估标准 26

第五章 结论和展望 27

5.1 结论 27

5.2 可进一步探索的研究方向 27

致谢 29

参考文献 30

附录 33

引言

选题背景和意义

共享经济是近一两年来的热门话题,其中最贴近我们生活的就是日常都会使用的共享单车。随着共享单车的普及和流行,其需求问题和维护问题也逐渐成为被关注的重点问题:如何较为准确地预测不同地区的需求,并由此调整布局策略和维修策略呢?

机器学习的理论和实践也随着统计学与的发展和大数据的兴旺日益成熟,被越来越多地应用于实际问题的处理。机器学习算法目前的发展重点之一是集成学习,即如何将基本的学习器用某种规则结合,构成高效的可以处理庞大数据的强学习器。本次研究的对象是tree boosting中的eXtreme Tree Boosting(XGBoost)[3],是一种基于梯度提升树的算法,近年来在大数据竞赛中强势兴起,在解决很多实际问题上取得了优异的表现。

本次毕业设计旨在通过学习XGBoost算法及其应用,对机器学习有更专业、更深入的认识,并结合大学期间所学的统计学知识,将理论应用于实际,结合软件编程,不仅提高了自身的实践能力,更是为解决共享单车需求预测问题提出自己的解决方案。

现状

XGBoost算法是由梯度提升树演化而来的,其影响力已经在大量机器学习和数据挖掘竞赛中获得广泛认可。比如Kaggle竞赛。Kaggle于2015年发表的29个获胜方案中,17个使用了XGBoost,其中8个单独使用XGBoost来训练模型,其他11个组大多将此方法与神经网络结合起来做集成。该系统在2015年KDD杯中也大获成功,前十名获胜者均使用了XGBoost。获胜队伍表示,只有小部分集成方法的性能优于配置好的XGBoost。目前,已经专门的文献研究“为什么XGBoost能在每次的数据挖掘竞赛中获得胜利”[5]。

剩余内容已隐藏,请支付后下载全文,论文总字数:32973字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;