共享单车项目项目说明
自行车共享系统是一种租赁自行车的方法,注册会员、租车、还车都将通过城市中的站点网络自动完成,
通过这个系统人们可以根据需要从一个地方租赁一辆自行车然后骑到自己的目的地归还。
在这次比赛中,参与者需要结合历史天气数据下的使用模式,来预测D.C.华盛顿首都自行车共享项目的自行车租赁需求。数据内容说明
比赛提供了跨越两年的每小时租赁数据,包含天气信息和日期信息,
训练集由每月前19天的数据组成,测试集是每月第二十天到当月底的数据。
1.提出问题
影响租用共享单车人数的因素是什么?
注意:本文暂只对可能的影响因素做分析,因此不涉及机器学习相关内容
2.理解数据
#导入所需数据包
import pandas as pd
import matplotlib.pyplot as plt
#不提示警告
import warnings
warnings.filterwarnings('ignore')
#导入训练数据
trainDf=pd.read_csv(r'C:\Users\86158\Desktop\train_bike.csv')
#查看数据
trainDf.head()
理解数据含义
datetime(日期) - hourly date + timestamp
season(季节) - 1 = spring, 2 = summer, 3 = fall, 4 = winter
holiday(是否假日) - whether the day is considered a holiday
workingday(是否工作日) - whether the day is neither a weekend nor holiday
weather(天气等级) -
1: Clear, Few clouds, Partly cloudy 清澈,少云,多云。
2: Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist 雾+阴天,雾+碎云、雾+少云、雾
3: Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds 小雪、小雨+雷暴+散云,小雨+云
4: Heavy Rain + Ice Pallets + Thunderstorm + Mist, Snow + Fog 暴雨+冰雹+雷暴+雾,雪+雾
temp(温度) - temperature in Celsius
atemp(体感温度) - "feels like" temperature in Celsius
humidity(相对湿度) - relative humidity
windspeed(风速) - wind speed
casual(临时租赁数量) - number of non-registered user rentals initiated