Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何为xgboost设置lambda参数_Python_Xgboost - Fatal编程技术网

Python 如何为xgboost设置lambda参数

Python 如何为xgboost设置lambda参数,python,xgboost,Python,Xgboost,我有一个有趣的小问题:在xgboost中有一个lambda正则化参数。好。。他们称之为。。兰姆达。。在尝试实际使用该参数时出现问题: models["xgboost"] = XGBRegressor(lambda=Lambda,n_estimators=NTrees learning_rate=LearningRate, max_depth=MaxDepth, max_features=MaxFeatures,rate_drop=0, loss="huber",eta=Eta,

我有一个有趣的小问题:在
xgboost
中有一个
lambda
正则化参数。好。。他们称之为。。兰姆达。。在尝试实际使用该参数时出现问题:

models["xgboost"] = XGBRegressor(lambda=Lambda,n_estimators=NTrees 
   learning_rate=LearningRate, max_depth=MaxDepth, 
   max_features=MaxFeatures,rate_drop=0, loss="huber",eta=Eta, 
   gamma=Gamma,subsample=Subsample,colsample_bytree=Colsample_bytree,
                                  eval_metric=eval_metric)
lambda
是我们所知道的python关键字。所以我们还没有制作编译器。。很高兴


我研究了
python
是否支持转义变量名。afaict不受支持。所以如何设置此参数(不使用位置…)

您正在查找的XGBRegressionor参数是
reg_lambda
,因为您正在使用xgboost的

然后,您可能想知道为什么
xgb
有一个名为
lambda
的参数,它可以正常工作。原因是变量范围是
train
方法的局部变量

    lambda=Lambda)
          ^
SyntaxError: invalid syntax