"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "16004228e75dce0a577979875506eec772dc7ba5"
Unverified Commit c53ac33b authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[python][sklearn] Simplify params handling in `predict()` with `_choose_param_value()` (#5308)

Simplify params handling in `predict()` with `_choose_param_value()`
parent 64f4a9fd
...@@ -849,11 +849,8 @@ class LGBMModel(_LGBMModelBase): ...@@ -849,11 +849,8 @@ class LGBMModel(_LGBMModelBase):
# number of threads can have values with special meaning which is only applied # number of threads can have values with special meaning which is only applied
# in the scikit-learn interface, these should not reach the c++ side as-is # in the scikit-learn interface, these should not reach the c++ side as-is
n_jobs = self.n_jobs predict_params = _choose_param_value("num_threads", predict_params, self.n_jobs)
for alias in _ConfigAliases.get("num_threads"): predict_params["num_threads"] = self._process_n_jobs(predict_params["num_threads"])
if alias in predict_params:
n_jobs = predict_params.pop(alias)
predict_params["num_threads"] = self._process_n_jobs(n_jobs)
return self._Booster.predict(X, raw_score=raw_score, start_iteration=start_iteration, num_iteration=num_iteration, return self._Booster.predict(X, raw_score=raw_score, start_iteration=start_iteration, num_iteration=num_iteration,
pred_leaf=pred_leaf, pred_contrib=pred_contrib, **predict_params) pred_leaf=pred_leaf, pred_contrib=pred_contrib, **predict_params)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment