LIGHTGBM参数

loadlibrary('lib_lightgbm.dll','c_api.h')

主要是dll的参数

否则没法搞定

结果展示

tree
num_class=1
label_index=0
max_feature_idx=27
objective=regression
sigmoid=-1
feature_names=Column_0 Column_1 Column_2 Column_3 Column_4 Column_5 Column_6 Column_7 Column_8 Column_9 Column_10 Column_11 Column_12 Column_13 Column_14 Column_15 Column_16 Column_17 Column_18 Column_19 Column_20 Column_21 Column_22 Column_23 Column_24 Column_25 Column_26 Column_27
feature_infos=[0.27500000596046448:6.695000171661377] [-2.4170000553131104:2.4300000667572021] [-1.7430000305175781:1.7430000305175781] [0.018999999389052391:5.6999998092651367] [-1.7430000305175781:1.7430000305175781] [0.15899999439716339:4.190000057220459] [-2.9409999847412109:2.9700000286102295] [-1.7410000562667847:1.7410000562667847] [0:2.1730000972747803] [0.18999999761581421:5.1929998397827148] [-2.9040000438690186:2.9089999198913574] [-1.7419999837875366:1.7430000305175781] [0:2.2149999141693115] [0.26399999856948853:6.5229997634887695] [-2.7279999256134033:2.7269999980926514] [-1.7419999837875366:1.7419999837875366] [0:2.5480000972747803] [0.36500000953674316:6.0679998397827148] [-2.494999885559082:2.4960000514984131] [-1.7400000095367432:1.7430000305175781] [0:3.1019999980926514] [0.17200000584125519:13.097999572753906] [0.41899999976158142:7.3920001983642578] [0.460999995470047:3.6819999217987061] [0.38400000333786011:6.5830001831054688] [0.093000002205371857:7.8600001335144043] [0.38899999856948853:4.5430002212524414] [0.48899999260902405:4.3159999847412109]

Tree=0
num_leaves=31
split_feature=25 26 27 22 24 26 25 25 5 25 25 27 27 24 25 25 27 25 22 22 0 9 26 25 9 24 10 3 9 21
split_gain=65.906192444293765 36.81652851250692 41.141378241676875 16.167880395466568 20.114588708538889 16.101277110155706 12.910188663418012 8.5556430955589349 8.1950669024424485 7.5406063193639739 10.270080808080706 6.809920634920644 5.8219495422063972 6.2591269501725506 5.4890204274487644 5.541727439737258 5.4323308270676876 5.0921522921523206 3.741615037378736 3.5583347246988524 3.2901964402643014 3.2086725199959147 3.1001908978052626 3.0819781470451346 2.9251918142054478 2.6899316314146304 2.5232839818241999 2.2917626422183019 2.0963229309753189 1.8499125747100607
threshold=1.281499981880188 0.77449998259544373 0.90449997782707214 1.0485000014305115 1.0264999866485596 0.87350001931190491 0.94549998641014099 0.53150001168251038 0.70049998164176941 0.67849999666213989 1.0024999976158142 0.726500004529953 0.89550000429153442 1.0845000147819519 0.62350001931190491 0.9895000159740448 0.79649999737739563 0.65449997782707214 1.0285000205039978 0.94650000333786011 1.2935000061988831 0.87450000643730164 0.976500004529953 1.8475000262260437 1.1165000200271606 0.70949998497962952 -0.055500000715255737 1.3945000171661377 0.70949998497962952 1.0034999847412109
decision_type=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
left_child=1 8 5 4 20 6 7 -3 25 -7 29 21 19 18 -6 27 -9 -5 -14 -2 -4 -10 -12 26 28 -1 -15 -16 -19 -11
right_child=12 2 3 17 14 9 -8 16 11 10 22 -13 13 23 15 -17 -18 24 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31
leaf_parent=25 19 7 20 17 14 9 6 16 21 29 22 11 18 26 27 15 16 28 18 19 20 21 22 23 24 25 26 27 28 29
leaf_value=0.020876288659793817 0.015748031496062992 0.021559633027522937 0.014485981308411215 0.02230769230769231 0.016509433962264151 0.030188679245283019 0.018750000000000003 0.040131578947368428 0.025634517766497462 0.045807453416149072 0.027819548872180452 0.017499999999999998 0.0050200803212851405 0.026754385964912281 0.036813186813186814 0.02215909090909091 0.028947368421052635 0.035909090909090911 0.014935064935064935 0.027407407407407408 0.0035000000000000005 0.035826771653543303 0.03925233644859813 0.012420382165605096 0.037398373983739838 0.013355048859934854 0.016037735849056604 0.027450980392156866 0.027510917030567683 0.038679245283018873
leaf_count=194 127 109 214 130 106 159 168 380 197 644 133 180 249 114 182 176 152 110 154 135 100 127 107 157 246 307 106 102 229 106
internal_value=0 0.58490566037735847 0.63270475654376579 0.51347962382445145 0.42272727272727273 0.72982635342185909 0.6217552533992583 0.6864274570982839 0.41592039800995023 0.80591818973020013 0.83838383838383834 0.50595238095238093 0.30614203454894434 0.26282051282051283 0.53533568904593642 0.58260869565217388 0.73872180451127822 0.62517482517482514 0.17617866004962779 0.4351145038167939 0.21974522292993631 0.59259259259259256 0.65833333333333333 0.35543766578249336 0.66495726495726493 0.32534930139720558 0.43181818181818182 0.66901408450704225 0.60471976401179939 0.89600000000000002
internal_count=5600 4558 3553 1595 880 1958 809 641 1005 1149 990 504 1042 780 566 460 532 715 403 262 314 324 240 377 585 501 220 284 339 750
shrinkage=0.05


Tree=1
num_leaves=31
split_feature=25 26 25 25 3 5 22 26 5 26 5 24 25 24 26 3 26 13 9 22 26 24 14 5 26 3 18 18 19 19
split_gain=59.48033614210749 33.316074069894057 18.489365522867274 27.414053758945329 9.6952366042174845 7.1757841736403805 6.1602904461760488 5.9579520350990833 5.0484982098220144 5.0179353796913944 4.3484348866338962 4.1919671517779591 4.0682481780155086 3.687752899768455 3.5808373536760882 3.3877995917711985 3.2356414151668531 3.1202828606315478 2.951497678574416 2.9195780250013392 2.9142862201040032 2.7312183016917686 2.6895211851379202 2.6838990428020395 2.3078021418835633 2.2129057850489176 1.9752706072008976 1.9330239197586252 1.7969880598809453 1.96872130489756
threshold=1.281499981880188 0.78849998116493225 0.67849999666213989 0.98450002074241638 1.6175000071525574 0.85249999165534973 1.0354999899864197 1.0534999966621399 0.8815000057220459 0.98249998688697815 0.8815000057220459 1.2484999895095825 0.58149999380111694 0.71349999308586121 0.85349997878074646 1.512499988079071 1.1315000057220459 0.90349999070167542 0.91850000619888306 0.96950000524520874 0.63049998879432678 0.77050000429153442 0.37649999558925629 1.2754999995231628 1.3345000147819519 1.2635000348091125 0.059499999508261681 0.10649999976158142 -0.72550001740455627 0.17249999940395355
decision_type=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
left_child=1 5 15 4 7 13 10 8 14 -2 18 19 -7 20 -4 21 27 -6 -5 -11 -1 -3 -8 -9 -21 -13 -23 -12 -15 -30
right_child=9 2 3 6 17 12 22 23 -10 11 16 25 -14 28 -16 -17 -18 -19 -20 24 -22 26 -24 -25 -26 -27 -28 -29 29 -31
leaf_parent=20 9 21 14 18 17 12 22 23 8 19 27 25 12 28 14 15 16 17 18 24 20 26 22 23 24 25 26 27 29 29
leaf_value=0.014930104605308823 0.021961012463219826 0.031690220886217903 0.029567004146715162 0.012651860866492663 0.03200259905429792 0.020224933401082779 0.033898156246298231 0.028964007588136678 0.041993808518124398 0.0068034852336405233 0.033671655429102353 0.021546219361800994 0.031239383047669319 0.019329013648230638 0.037957695843376105 0.016780123043890028 0.018497580941323016 0.020668531400564641 0.023557727886318658 0.017748492729744155 0.025158662174878818 0.019876820758284619 0.024110454857723666 0.03790145396293762 0.0085204034177749823 0.012749319463968279 0.026572317213568591 0.024197009647739867 0.0066620591585524391 0.015192436086209982
leaf_count=106 187 118 179 156 119 154 204 280 590 282 114 167 184 136 439 165 105 124 103 167 203 227 107 120 114 125 214 102 100 209
internal_value=0 0.55566037186816208 0.60364882920092677 0.64117915053151542 0.71055184251280135 0.40334535985775699 0.49706147055692479 0.73868614233119778 0.77371306694035624 0.29083493298309321 0.4361739989410251 0.25838106848648068 0.52441930322709474 0.34907083351977802 0.71054764457942143 0.46151051278038269 0.51395076023838326 0.52437919186267223 0.33977886235240745 0.20795407145222911 0.43299673201703137 0.49867478570332735 0.61061366842580522 0.63290483001153919 0.28009425448353181 0.35560846345320546 0.46251765060472955 0.58395034286917913 0.29079419838348297 0.24863592607593074
internal_count=5600 4558 3466 2742 1851 1092 891 1608 1208 1042 580 855 338 754 618 724 321 243 259 563 309 559 311 400 281 292 441 216 445 309
shrinkage=0.05

feature importances:
Column_25=31
Column_26=19
Column_27=17
Column_22=16
Column_24=15
Column_5=13
Column_3=8
Column_9=8
Column_19=5
Column_0=4
Column_18=3
Column_21=3
Column_13=2
Column_14=2
Column_4=1
Column_10=1
Column_11=1
Column_15=1
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
LightGBM是一种高效的梯度提升框架,常用于解决分类和回归问题。在Python中,我们可以使用LightGBM库进行参数优化。以下是一些常用的LightGBM参数优化方法: 1. 学习率(learning_rate):控制每次迭代中模型权重的更新速度。较小的学习率可以使模型更加稳定,但可能需要更多的迭代次数才能达到最佳性能。 2. 树的数量(num_iterations):指定要构建的决策树的数量。较大的值可以提高模型的性能,但也会增加训练时间。 3. 树的深度(max_depth):限制每棵树的最大深度。较小的值可以减少过拟合的风险,但可能会导致欠拟合。 4. 叶子节点数(num_leaves):限制每棵树的叶子节点数。较大的值可以提高模型的性能,但也会增加内存消耗。 5. 特征子抽样(feature_fraction):控制每棵树在训练时使用的特征比例。较小的值可以减少过拟合的风险。 6. 数据子抽样(bagging_fraction):控制每棵树在训练时使用的数据比例。较小的值可以减少过拟合的风险。 7. 正则化参数(lambda_l1、lambda_l2):通过正则化项来控制模型的复杂度。较大的值可以减少过拟合的风险。 8. 提升类型(boosting_type):指定使用的提升类型,如梯度提升(gbdt)、随机森林(rf)等。 以上只是一些常用的参数,你可以根据具体问题和数据集进行调整。在进行参数优化时,可以使用交叉验证等技术来评估不同参数组合的性能,并选择最佳的参数组合。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值