我的模型实现如下:
','grow_policy':“ lossguide','subsample':1.0,'alpha':3,“客观”:'binary:logistic','max_depth':8,'eval_metric':'logloss':'logloss','nthread'': 8,'Random_State':99,'scale_pos_weight':250,'lambda':5}
我在下面收到警告,我搜索了一些参考,我已经应用了此 link 和链接。
但是警告持续如下:
core.py:528:<代码>未来沃宁:通过 evals 作为关键字args。将这些作为位置参数通过,将被视为未来版本中的错误。格式(“,” .join(args_msg)),FutureWarning
/home/spark/.local/lib/python3.7/site-packages/xgboost/core.py:528: FutureWarning: Pass `evals` as keyword args. Passing these as positional arguments will be considered as error in future releases. format(", ".join(args_msg)), FutureWarning
我完全理解,我发送的某些参数值在以后的版本中不会支持,但我不清楚哪些参数会引起警告。
从参考链接中,我猜测: eval_metric 并试图更改,但错误没有更改。
谁能帮助我了解哪个参数引起了触发警告,以及我需要做出的更改?
My model implementation is as follows :

Parameter that are passed : {'eta': 0.01, 'tree_method': 'hist', 'grow_policy': 'lossguide', 'subsample': 1.0, 'alpha': 3, 'objective': 'binary:logistic', 'max_depth': 8, 'eval_metric': 'logloss', 'nthread': 8, 'random_state': 99, 'scale_pos_weight': 250, 'lambda': 5}
I am getting a warning as below, I have searched some references and I have applied this link and links.
But warning persists as below :
core.py:528: FutureWarning: Pass
evals as keyword args. Passing these as positional arguments will be considered an error in future releases. format(", ".join(args_msg)), FutureWarning
/home/spark/.local/lib/python3.7/site-packages/xgboost/core.py:528: FutureWarning: Pass `evals` as keyword args. Passing these as positional arguments will be considered as error in future releases. format(", ".join(args_msg)), FutureWarning
I completely understand that some parameters value I am sending is not going to support in a future release but I am not clear which parameter is causing triggers that warning.
From the reference link, I was guessing that: eval_metric and tried to change but the error has not changed.
Can anyone help me to understand which parameter is causing to trigger that warning and what are the possible changes that I need to make?
发布评论
评论(1)
我认为问题在于您的行:
您的“ Evals”论点是“监视列表”,您将其作为位置论点所传递。位置参数并未命名为参数(例如evals =守望列表),而只是在函数调用中的位置。目前,您有一些位置参数(前四个)和一些关键字参数(最后三个)。
通常,使用关键字参数定义尽可能多的东西是最安全的。 替换线路,则警告应消失:
如果您用以下方式
I think the problem is with your line:
Your 'evals' argument is 'watchlist', which you're passing as a positional argument. A positional argument isn't named as an argument (e.g. evals=watchlist), but just by it's position in the function call. At the moment you have some positional arguments (the first four) and some keyword arguments (the last three).
It's usually safest to define as many things as you can using keyword arguments. The warning should go away if you replace your line with:
(Note that this is still passing params, dtrain, and 500 as positional arguments)