变量名称如下:
Index(['KNN_derta_V', 'MOID', 'e', 'a', 'q', 'i', 'node', 'peri', 'M', 'tp',
'period', 'n', 'Type_B', 'Type_C', 'Type_Cb', 'Type_Cg', 'Type_Cgh',
'Type_Ch', 'Type_D', 'Type_K', 'Type_L', 'Type_M', 'Type_O', 'Type_P',
'Type_Q', 'Type_T', 'Type_X', 'Type_Xc', 'Type_Xe'],
dtype='object')
预测变量名称如下:
295.91
lasso1,y的预测值= [ 7.51212510e+07 3.15450040e+07 1.01931139e+08 6.95005416e+07
7.31045966e+07 6.50121874e+07 -1.96956462e+07 9.44745120e+07
7.85729342e+07 8.72294793e+07 7.75270626e+07 1.19508943e+08
8.04466043e+07 -3.94766592e+07 8.47924110e+07 -3.16167124e+06
6.96060288e+07 8.50867930e+07 4.45459034e+06 5.80504092e+07
6.15693648e+07 1.85542901e+07 -3.81215036e+06 5.68453011e+07
9.61466512e+07 6.66604599e+07 8.01954660e+07 3.35388749e+07
1.12569789e+08 2.13830424e+07 8.48351447e+07 8.27586642e+07
8.91256577e+07 2.33224596e+07 7.45329226e+07 2.95685211e+07
9.28833966e+07 6.95492100e+07 1.47830430e+07 8.54967945e+07
8.17686422e+07 9.02642140e+07 1.04508703e+08 3.07044416e+07
8.01069339e+07 8.92223535e+07 6.28944229e+07 5.61986174e+07
6.45200625e+07 1.02029882e+08 6.81211300e+07 6.63308863e+07
8.47550732e+07 1.03994414e+08 6.03534132e+07 8.15811207e+07
1.03157355e+07 6.47327693e+07 2.34842883e+07 9.69179652e+06
2.20869817e+07 8.46996419e+07 1.19834339e+07 8.46150212e+07
9.62268523e+07 8.47592021e+07 5.75633821e+07 7.55299760e+07
1.51279533e+07 9.63640889e+07 -6.80360913e+06 5.67062539e+07
7.13332887e+07 5.88725571e+07 9.23732134e+07 7.62913781e+07
8.23485742e+07 7.61927107e+07 1.78575371e+07 2.60913584e+07
6.80537164e+07 4.56685481e+06 4.66721700e+07 8.52745588e+07
9.18768261e+07 -2.17892166e+07 5.83539935e+07 7.71213351e+07
1.00846081e+08 1.02986179e+08 7.72410678e+07 9.19770360e+07
5.35998695e+07 1.01306424e+08 8.12693686e+07 7.20249118e+07
2.22946843e+07]
平均绝对误差MAE= 25500547.102912106
均方误差MSE= 1040098985837186.8
R平方值= 0.5187861477729059
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 1.3284776220953914e+17, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 1.2925479441835674e+17, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 1.2496492492612803e+17, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 9.719772228758227e+16, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 7.380472889270266e+16, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 6716390478915040.0, tolerance: 62589665401482.8
positive)
C:\Users\galax\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\linear_model\_coordinate_descent.py:532: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 105383101921024.0, tolerance: 62589665401482.8
positive)
调参后,,lasso2,y的预测值2= [ 7.51006276e+07 3.15740946e+07 1.01908158e+08 6.94932364e+07
7.30475101e+07 6.49749127e+07 -1.97033085e+07 9.44609193e+07
7.86282631e+07 8.72098730e+07 7.75504969e+07 1.19320217e+08
8.04415209e+07 -3.95028380e+07 8.47575762e+07 -3.10101136e+06
6.96218813e+07 8.50762906e+07 4.62444197e+06 5.80574915e+07
6.16049550e+07 1.84085300e+07 -3.85662145e+06 5.68514420e+07
9.61236653e+07 6.66755963e+07 8.01978664e+07 3.34890859e+07
1.12556634e+08 2.14689804e+07 8.48112095e+07 8.27737972e+07
8.91068611e+07 2.34099148e+07 7.44712994e+07 2.95595810e+07
9.28545118e+07 6.95297712e+07 1.47481359e+07 8.54851546e+07
8.17737255e+07 9.02318908e+07 1.04486187e+08 3.08108695e+07
8.01068708e+07 8.92241798e+07 6.28625204e+07 5.62756473e+07
6.45298647e+07 1.02018289e+08 6.80743555e+07 6.63463538e+07
8.47038787e+07 1.03989710e+08 6.03440191e+07 8.16014179e+07
1.03800808e+07 6.47225346e+07 2.35771013e+07 9.72579733e+06
2.22176772e+07 8.46900538e+07 1.19856532e+07 8.46070872e+07
9.61651668e+07 8.47384982e+07 5.75579016e+07 7.55373978e+07
1.50545995e+07 9.63172536e+07 -6.67335409e+06 5.66963237e+07
7.12995636e+07 5.88731916e+07 9.23400711e+07 7.63151692e+07
8.23146096e+07 7.62119205e+07 1.80186727e+07 2.61937240e+07
6.80553667e+07 4.62416678e+06 4.68016288e+07 8.52327108e+07
9.18199608e+07 -2.16232016e+07 5.83053594e+07 7.70769919e+07
1.00800537e+08 1.02937924e+08 7.72763384e+07 9.19776094e+07
5.36282465e+07 1.01268019e+08 8.12501273e+07 7.19977759e+07
2.21252107e+07]
平均绝对误差MAE2= 25502171.508369464
均方误差MSE2= 1039904613737113.1
R平方值2= 0.518876076278092
最佳的alpha= {'alpha': 1000}
lasso3.intercept_= 61995999.706599586
lasso3.coef_= [ 4786995.84417464 51207110.8071119 -31437411.35377316
57903088.70525547 -82268974.49067199 -6115809.05826347
3482131.83281162 1102009.75039451 -1828506.64193543
3680114.38832004 -32526780.6149993 -6811562.8173601
1140119.05171839 7619700.07969424 106859.21075576
2451217.70655214 2515071.76684185 878205.9300067
-15712695.59915219 2940614.18367926 443194.52519862
-554246.33367832 1334232.69876321 1349600.66789231
-626396.8327207 -8098780.60253634 2789212.73450331
-863230.26226967 -2126086.34030199]
属性名称(xi) Coef
0 KNN_derta_V 4.786996e+06
1 MOID 5.120711e+07
2 e -3.143741e+07
3 a 5.790309e+07
4 q -8.226897e+07
5 i -6.115809e+06
6 node 3.482132e+06
7 peri 1.102010e+06
8 M -1.828507e+06
9 tp 3.680114e+06
10 period -3.252678e+07
11 n -6.811563e+06
12 Type_B 1.140119e+06
13 Type_C 7.619700e+06
14 Type_Cb 1.068592e+05
15 Type_Cg 2.451218e+06
16 Type_Cgh 2.515072e+06
17 Type_Ch 8.782059e+05
18 Type_D -1.571270e+07
19 Type_K 2.940614e+06
20 Type_L 4.431945e+05
21 Type_M -5.542463e+05
22 Type_O 1.334233e+06
23 Type_P 1.349601e+06
24 Type_Q -6.263968e+05
25 Type_T -8.098781e+06
26 Type_X 2.789213e+06
27 Type_Xc -8.632303e+05
28 Type_Xe -2.126086e+06
Process finished with exit code 0
LASSO——运行结果
最新推荐文章于 2024-08-08 14:28:23 发布