轻型gbm-python API vs Scikit-learn API [英] light gbm - python API vs Scikit-learn API

查看:150
本文介绍了轻型gbm-python API vs Scikit-learn API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的问题之一中应用lgbm。为此,我正在经历 http://lightgbm.readthedocs.io/en /latest/Python-API.html
但是,我有一个基本问题。 Training API和Scikit-learn API有什么区别?我们可以同时使用两个API来解决同一问题吗?

I was trying to apply lgbm in one of my problems. For that I was going through "http://lightgbm.readthedocs.io/en/latest/Python-API.html". However, I have a basic question. Is there any difference between Training API and Scikit-learn API? Can we use both the APIs to achieve same result for the same problem?

感谢
Dipanjan。

Thanks, Dipanjan.

推荐答案

简短的答案:是的,如果您以相同的方式配置它们,它们将提供相同的结果。

The short answer: yes, they will provide identical results if you will configure them in identical ways.

原因就是sklearn API只是本机培训 API的包装,而后者又是后端C ++库的包装。最后,这是您的选择。我个人会建议使用sklearn API。 2个主要优点是:

The reason is that sklearn API is just a wrapper around the "native training" API, which in turn is a wrapper around the backend C++ library. At the end, this is your choice to make. I personally would advice in favour of the sklearn API. The 2 major advantages are:


  • 您可以使用完整的sklearn工具包(具有数据预处理,超参数优化,模型评估等功能的管道)

  • 您可以轻松地在不同模型之间切换,即您输入的数据具有相同的格式( pd.DataFrame np.ndarray ),trainign接口是相同的,您可以在sklearn模型,lightgbm,xgboost,catboost或vowpal wabbit之间进行切换,只需实例化不同的对象并将它们通过相同的过程传递即可。

  • you can make use of full sklearn toolkit (pipelines with data preprocessing, hyperparameter optimisation, model evalueation, etc)
  • you can switch between different model in a painless way, i.e. your input data has the same format (pd.DataFrame or np.ndarray), trainign interface is the same and you can switch between sklearn models, lightgbm, xgboost, catboost or vowpal wabbit by simply instantiating different objects and passing them through the same procedure.

这篇关于轻型gbm-python API vs Scikit-learn API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆