feat: 完成共享单车课程设计

This commit is contained in:
luochen570
2026-06-08 23:15:05 +08:00
commit 0026c4bf84
24 changed files with 912 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,100 @@
{
"data": {
"rows": 731,
"columns": 16,
"future_rows": 100,
"missing": {
"季节": 0,
"年": 0,
"月": 0,
"节假日": 0,
"星期": 0,
"工作日": 0,
"天气": 0,
"气温": 0,
"体感温度": 0,
"湿度": 0,
"风速": 0,
"总骑行量": 0
},
"duplicate_dates": 0,
"target_min": 22,
"target_max": 8714,
"target_mean": 4504.3488372093025
},
"initial_comparison": [
{
"模型": "梯度提升树",
"RMSE": 651.1440567037434,
"MAE": 448.99523765137667,
"R2": 0.8942640825672749
},
{
"模型": "随机森林",
"RMSE": 703.9966504917254,
"MAE": 450.0664823777129,
"R2": 0.8764025354772573
},
{
"模型": "支持向量回归",
"RMSE": 738.1033329574317,
"MAE": 529.5340809792003,
"R2": 0.8641365279788986
},
{
"模型": "线性回归",
"RMSE": 796.4617765623753,
"MAE": 583.0197588300691,
"R2": 0.8418029967286178
},
{
"模型": "神经网络",
"RMSE": 809.7923656712804,
"MAE": 609.9584660642089,
"R2": 0.836463110808386
}
],
"best_model": "梯度提升树",
"best_test_metrics": {
"模型": "梯度提升树",
"RMSE": 651.1440567037434,
"MAE": 448.99523765137667,
"R2": 0.8942640825672749
},
"cross_validation": {
"模型": "梯度提升树",
"RMSE均值": 655.1166606641779,
"RMSE标准差": 42.75460340121525,
"MAE均值": 466.577603572732,
"MAE标准差": 14.719481812429436,
"R2均值": 0.8818566774188483,
"R2标准差": 0.023087453303387278
},
"importance_method": "GradientBoostingRegressor 内置重要性",
"top_features": {
"气温": 0.38973625494728426,
"年": 0.2984069767787937,
"季节": 0.0932052430981216,
"体感温度": 0.07101028400532663,
"湿度": 0.05891447646010377,
"天气": 0.029590235728090393,
"风速": 0.026177907657402667,
"月": 0.01607120463407045
},
"future_prediction": {
"min": 1319,
"max": 6025,
"mean": 3775.15
},
"outputs": {
"figures": [
"/root/bike_course_design/outputs/figures/actual_vs_predicted.png",
"/root/bike_course_design/outputs/figures/feature_importance.png",
"/root/bike_course_design/outputs/figures/future_prediction_trend.png",
"/root/bike_course_design/outputs/figures/historical_trend.png",
"/root/bike_course_design/outputs/figures/residual_distribution.png"
],
"best_model": "/root/bike_course_design/outputs/models/best_bike_demand_model.pkl",
"prediction_excel": "/root/bike_course_design/outputs/2013前100天骑行量预测结果.xlsx"
}
}

View File

@@ -0,0 +1,2 @@
模型,RMSE均值,RMSE标准差,MAE均值,MAE标准差,R2均值,R2标准差
梯度提升树,655.1166606641779,42.75460340121525,466.577603572732,14.719481812429436,0.8818566774188483,0.023087453303387278
1 模型 RMSE均值 RMSE标准差 MAE均值 MAE标准差 R2均值 R2标准差
2 梯度提升树 655.1166606641779 42.75460340121525 466.577603572732 14.719481812429436 0.8818566774188483 0.023087453303387278

View File

@@ -0,0 +1,12 @@
,重要性
气温,0.38973625494728426
,0.2984069767787937
季节,0.0932052430981216
体感温度,0.07101028400532663
湿度,0.05891447646010377
天气,0.029590235728090393
风速,0.026177907657402667
,0.01607120463407045
星期,0.00832340663049113
工作日,0.004855667817542203
节假日,0.003708342242773187
1 重要性
2 气温 0.38973625494728426
3 0.2984069767787937
4 季节 0.0932052430981216
5 体感温度 0.07101028400532663
6 湿度 0.05891447646010377
7 天气 0.029590235728090393
8 风速 0.026177907657402667
9 0.01607120463407045
10 星期 0.00832340663049113
11 工作日 0.004855667817542203
12 节假日 0.003708342242773187

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -0,0 +1,6 @@
模型,RMSE,MAE,R2
梯度提升树,651.1440567037434,448.99523765137667,0.8942640825672749
随机森林,703.9966504917254,450.0664823777129,0.8764025354772573
支持向量回归,738.1033329574317,529.5340809792003,0.8641365279788986
线性回归,796.4617765623753,583.0197588300691,0.8418029967286178
神经网络,809.7923656712804,609.9584660642089,0.836463110808386
1 模型 RMSE MAE R2
2 梯度提升树 651.1440567037434 448.99523765137667 0.8942640825672749
3 随机森林 703.9966504917254 450.0664823777129 0.8764025354772573
4 支持向量回归 738.1033329574317 529.5340809792003 0.8641365279788986
5 线性回归 796.4617765623753 583.0197588300691 0.8418029967286178
6 神经网络 809.7923656712804 609.9584660642089 0.836463110808386

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,148 @@
日期,真实总骑行量,预测总骑行量,残差
2011-01-03,1349,1577,-228.44
2011-01-11,1263,1199,64.1
2011-01-24,1416,1465,-49.06
2011-01-31,1501,1554,-52.9
2011-02-01,1360,950,410.36
2011-02-03,1550,1504,46.2
2011-02-09,1605,1455,150.06
2011-02-14,1913,2320,-406.86
2011-02-19,1635,1886,-251.38
2011-02-24,1807,1201,606.29
2011-02-25,1461,1134,327.36
2011-03-02,2134,2191,-56.9
2011-03-05,2077,2130,-53.29
2011-03-07,1872,1694,177.93
2011-03-08,2133,2248,-115.27
2011-03-11,1977,1676,300.91
2011-03-12,2132,2349,-217.47
2011-03-14,2046,2226,-179.8
2011-03-18,3239,4044,-804.76
2011-03-19,3117,3370,-253.27
2011-03-20,2471,2064,407.14
2011-03-21,2077,2692,-615.29
2011-03-23,2121,2103,18.4
2011-03-26,2496,2591,-94.52
2011-03-28,2028,2460,-431.86
2011-04-01,2227,1954,273.39
2011-04-08,1471,1773,-301.99
2011-04-12,2034,3717,-1682.75
2011-04-20,3944,4423,-478.72
2011-04-29,4595,4603,-8.29
2011-05-01,3351,3850,-499.24
2011-05-12,4864,4534,330.31
2011-05-14,3409,4328,-918.66
2011-05-16,3958,3809,148.76
2011-05-29,4788,4370,417.83
2011-06-05,4906,4317,588.98
2011-06-08,4401,4109,291.88
2011-06-14,4891,4949,-58.17
2011-06-15,5180,4954,225.68
2011-06-24,4991,5067,-75.7
2011-07-01,5362,5370,-7.84
2011-07-12,4258,4201,57.37
2011-07-16,5923,5163,760.0
2011-07-18,4458,4614,-156.27
2011-07-19,4541,4128,413.2
2011-07-30,4475,3982,493.17
2011-07-31,4302,3854,448.1
2011-08-01,4266,4499,-232.75
2011-08-07,3785,4459,-673.9
2011-08-09,4602,4177,424.81
2011-08-16,4725,4796,-70.79
2011-08-23,5895,4925,970.15
2011-08-24,5130,4796,334.21
2011-09-02,4727,4418,309.5
2011-09-05,3351,3770,-419.29
2011-09-12,4713,5118,-404.54
2011-09-17,4511,4179,331.63
2011-09-23,2395,3520,-1124.77
2011-09-24,5423,4669,754.39
2011-10-03,3570,3909,-338.53
2011-10-14,3644,4314,-669.66
2011-10-18,4748,4912,-164.41
2011-10-28,3747,3665,82.18
2011-10-30,3331,3567,-235.88
2011-11-03,3974,3630,344.25
2011-11-11,3368,2273,1094.97
2011-11-16,1817,2447,-630.11
2011-11-23,2566,3439,-873.31
2011-11-24,1495,2390,-895.02
2011-11-25,2792,3982,-1189.72
2011-11-28,3867,4444,-576.52
2011-12-02,3940,3851,88.98
2011-12-05,3811,3527,284.14
2011-12-07,705,1651,-946.28
2011-12-09,3620,3786,-165.78
2011-12-11,2743,2912,-169.37
2011-12-17,2739,2998,-259.32
2011-12-18,2431,2814,-383.19
2011-12-19,3403,3491,-88.36
2011-12-22,3068,2795,272.56
2011-12-23,2209,1710,498.59
2011-12-24,1011,2143,-1131.82
2011-12-27,1162,1523,-360.64
2012-01-04,2368,2742,-374.41
2012-01-05,3272,3353,-81.08
2012-01-11,2177,2724,-547.45
2012-01-16,2298,2465,-167.13
2012-02-04,2832,2833,-0.88
2012-02-09,3830,3233,597.12
2012-02-28,4363,4302,60.68
2012-03-01,4990,6011,-1020.55
2012-03-06,3956,3165,791.34
2012-03-10,4118,3709,408.86
2012-03-12,5298,5856,-558.23
2012-03-19,6153,6305,-151.59
2012-03-21,6230,6325,-95.16
2012-03-24,3372,5652,-2279.64
2012-03-25,4996,4696,300.25
2012-04-01,6041,4352,1688.79
2012-04-10,5918,6416,-497.99
2012-04-12,5409,4941,468.22
2012-04-13,6398,6410,-12.48
2012-04-14,7460,6934,526.08
2012-04-18,4367,5904,-1537.08
2012-04-25,6196,6642,-445.52
2012-05-28,6043,6531,-487.78
2012-05-29,5743,6794,-1050.6
2012-06-07,7494,7312,181.84
2012-06-11,6664,6500,164.39
2012-06-20,6211,6244,-32.85
2012-06-26,7442,6989,453.43
2012-06-29,5463,5797,-334.07
2012-07-04,7403,5172,2230.86
2012-07-11,7264,7181,82.86
2012-07-13,7499,7513,-13.89
2012-07-22,7410,6212,1198.03
2012-07-23,6966,6820,145.94
2012-07-26,6861,6310,551.18
2012-08-01,7580,6910,669.83
2012-08-03,7175,6090,1085.44
2012-08-18,7865,7339,526.24
2012-08-20,6530,6418,112.26
2012-08-24,7582,7232,350.11
2012-08-25,6053,6488,-435.36
2012-08-28,7040,7101,-60.93
2012-08-29,7697,7241,455.71
2012-08-30,7713,7287,425.85
2012-09-16,7333,7350,-16.69
2012-09-21,8167,7771,396.26
2012-09-24,7436,7609,-172.87
2012-09-25,7538,7702,-164.34
2012-10-05,8156,7832,323.83
2012-10-12,7282,7113,168.73
2012-10-29,22,3514,-3491.84
2012-11-06,5686,4806,879.7
2012-11-09,5992,5555,436.88
2012-11-14,5495,4837,657.66
2012-11-21,5146,5562,-416.47
2012-11-28,5260,4875,385.29
2012-11-30,5668,5264,404.17
2012-12-04,6606,6580,26.22
2012-12-12,5319,5046,272.6
2012-12-18,5557,5442,115.19
2012-12-19,5267,4985,281.86
2012-12-27,2114,1858,255.82
2012-12-28,3095,2515,579.82
2012-12-30,1796,1942,-145.6
1 日期 真实总骑行量 预测总骑行量 残差
2 2011-01-03 1349 1577 -228.44
3 2011-01-11 1263 1199 64.1
4 2011-01-24 1416 1465 -49.06
5 2011-01-31 1501 1554 -52.9
6 2011-02-01 1360 950 410.36
7 2011-02-03 1550 1504 46.2
8 2011-02-09 1605 1455 150.06
9 2011-02-14 1913 2320 -406.86
10 2011-02-19 1635 1886 -251.38
11 2011-02-24 1807 1201 606.29
12 2011-02-25 1461 1134 327.36
13 2011-03-02 2134 2191 -56.9
14 2011-03-05 2077 2130 -53.29
15 2011-03-07 1872 1694 177.93
16 2011-03-08 2133 2248 -115.27
17 2011-03-11 1977 1676 300.91
18 2011-03-12 2132 2349 -217.47
19 2011-03-14 2046 2226 -179.8
20 2011-03-18 3239 4044 -804.76
21 2011-03-19 3117 3370 -253.27
22 2011-03-20 2471 2064 407.14
23 2011-03-21 2077 2692 -615.29
24 2011-03-23 2121 2103 18.4
25 2011-03-26 2496 2591 -94.52
26 2011-03-28 2028 2460 -431.86
27 2011-04-01 2227 1954 273.39
28 2011-04-08 1471 1773 -301.99
29 2011-04-12 2034 3717 -1682.75
30 2011-04-20 3944 4423 -478.72
31 2011-04-29 4595 4603 -8.29
32 2011-05-01 3351 3850 -499.24
33 2011-05-12 4864 4534 330.31
34 2011-05-14 3409 4328 -918.66
35 2011-05-16 3958 3809 148.76
36 2011-05-29 4788 4370 417.83
37 2011-06-05 4906 4317 588.98
38 2011-06-08 4401 4109 291.88
39 2011-06-14 4891 4949 -58.17
40 2011-06-15 5180 4954 225.68
41 2011-06-24 4991 5067 -75.7
42 2011-07-01 5362 5370 -7.84
43 2011-07-12 4258 4201 57.37
44 2011-07-16 5923 5163 760.0
45 2011-07-18 4458 4614 -156.27
46 2011-07-19 4541 4128 413.2
47 2011-07-30 4475 3982 493.17
48 2011-07-31 4302 3854 448.1
49 2011-08-01 4266 4499 -232.75
50 2011-08-07 3785 4459 -673.9
51 2011-08-09 4602 4177 424.81
52 2011-08-16 4725 4796 -70.79
53 2011-08-23 5895 4925 970.15
54 2011-08-24 5130 4796 334.21
55 2011-09-02 4727 4418 309.5
56 2011-09-05 3351 3770 -419.29
57 2011-09-12 4713 5118 -404.54
58 2011-09-17 4511 4179 331.63
59 2011-09-23 2395 3520 -1124.77
60 2011-09-24 5423 4669 754.39
61 2011-10-03 3570 3909 -338.53
62 2011-10-14 3644 4314 -669.66
63 2011-10-18 4748 4912 -164.41
64 2011-10-28 3747 3665 82.18
65 2011-10-30 3331 3567 -235.88
66 2011-11-03 3974 3630 344.25
67 2011-11-11 3368 2273 1094.97
68 2011-11-16 1817 2447 -630.11
69 2011-11-23 2566 3439 -873.31
70 2011-11-24 1495 2390 -895.02
71 2011-11-25 2792 3982 -1189.72
72 2011-11-28 3867 4444 -576.52
73 2011-12-02 3940 3851 88.98
74 2011-12-05 3811 3527 284.14
75 2011-12-07 705 1651 -946.28
76 2011-12-09 3620 3786 -165.78
77 2011-12-11 2743 2912 -169.37
78 2011-12-17 2739 2998 -259.32
79 2011-12-18 2431 2814 -383.19
80 2011-12-19 3403 3491 -88.36
81 2011-12-22 3068 2795 272.56
82 2011-12-23 2209 1710 498.59
83 2011-12-24 1011 2143 -1131.82
84 2011-12-27 1162 1523 -360.64
85 2012-01-04 2368 2742 -374.41
86 2012-01-05 3272 3353 -81.08
87 2012-01-11 2177 2724 -547.45
88 2012-01-16 2298 2465 -167.13
89 2012-02-04 2832 2833 -0.88
90 2012-02-09 3830 3233 597.12
91 2012-02-28 4363 4302 60.68
92 2012-03-01 4990 6011 -1020.55
93 2012-03-06 3956 3165 791.34
94 2012-03-10 4118 3709 408.86
95 2012-03-12 5298 5856 -558.23
96 2012-03-19 6153 6305 -151.59
97 2012-03-21 6230 6325 -95.16
98 2012-03-24 3372 5652 -2279.64
99 2012-03-25 4996 4696 300.25
100 2012-04-01 6041 4352 1688.79
101 2012-04-10 5918 6416 -497.99
102 2012-04-12 5409 4941 468.22
103 2012-04-13 6398 6410 -12.48
104 2012-04-14 7460 6934 526.08
105 2012-04-18 4367 5904 -1537.08
106 2012-04-25 6196 6642 -445.52
107 2012-05-28 6043 6531 -487.78
108 2012-05-29 5743 6794 -1050.6
109 2012-06-07 7494 7312 181.84
110 2012-06-11 6664 6500 164.39
111 2012-06-20 6211 6244 -32.85
112 2012-06-26 7442 6989 453.43
113 2012-06-29 5463 5797 -334.07
114 2012-07-04 7403 5172 2230.86
115 2012-07-11 7264 7181 82.86
116 2012-07-13 7499 7513 -13.89
117 2012-07-22 7410 6212 1198.03
118 2012-07-23 6966 6820 145.94
119 2012-07-26 6861 6310 551.18
120 2012-08-01 7580 6910 669.83
121 2012-08-03 7175 6090 1085.44
122 2012-08-18 7865 7339 526.24
123 2012-08-20 6530 6418 112.26
124 2012-08-24 7582 7232 350.11
125 2012-08-25 6053 6488 -435.36
126 2012-08-28 7040 7101 -60.93
127 2012-08-29 7697 7241 455.71
128 2012-08-30 7713 7287 425.85
129 2012-09-16 7333 7350 -16.69
130 2012-09-21 8167 7771 396.26
131 2012-09-24 7436 7609 -172.87
132 2012-09-25 7538 7702 -164.34
133 2012-10-05 8156 7832 323.83
134 2012-10-12 7282 7113 168.73
135 2012-10-29 22 3514 -3491.84
136 2012-11-06 5686 4806 879.7
137 2012-11-09 5992 5555 436.88
138 2012-11-14 5495 4837 657.66
139 2012-11-21 5146 5562 -416.47
140 2012-11-28 5260 4875 385.29
141 2012-11-30 5668 5264 404.17
142 2012-12-04 6606 6580 26.22
143 2012-12-12 5319 5046 272.6
144 2012-12-18 5557 5442 115.19
145 2012-12-19 5267 4985 281.86
146 2012-12-27 2114 1858 255.82
147 2012-12-28 3095 2515 579.82
148 2012-12-30 1796 1942 -145.6