用于模型的训练

1.说明:

lightgbm.train(paramstrain_setnum_boost_round=100valid_sets=Nonevalid_names=Nonefobj=Nonefeval=Noneinit_model=Nonefeature_name='auto'categorical_feature='auto'early_stopping_rounds=Noneevals_result=Noneverbose_eval=Truelearning_rates=Nonekeep_training_booster=Falsecallbacks=None)

Parameters:
  • params (dict) – Parameters for training.
  • train_set (Dataset) – Data to be trained.
  • num_boost_round (intoptional (default=100)) – Number of boosting iterations.
  • valid_sets (list of Datasets or Noneoptional (default=None)) – List of data to be evaluated during training.
  • valid_names (list of string or Noneoptional (default=None)) – Names of valid_sets.
  • fobj (callable or Noneoptional (default=None)) – Customized objective function.
  • feval (callable or Noneoptional (default=None)) – Customized evaluation function. Should accept two parameters: preds, train_data. For multi-class task, the preds is group by class_id first, then group by row_id. If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i]. Note: should return (eval_name, eval_result, is_higher_better) or list of such tuples. To ignore the default metric corresponding to the used objective, set the metricparameter to the string "None" in params.
  • init_model (stringBooster or Noneoptional (default=None)) – Filename of LightGBM model or Booster instance used for continue training.
  • feature_name (list of strings or 'auto'optional (default="auto")) – Feature names. If ‘auto’ and data is pandas DataFrame, data columns names are used.
  • categorical_feature (list of strings or int, or 'auto'optional (default="auto")) – Categorical features. If list of int, interpreted as indices. If list of strings, interpreted as feature names (need to specify feature_name as well). If ‘auto’ and data is pandas DataFrame, pandas categorical columns are used. All values in categorical features should be less than int32 max value (2147483647). All negative values in categorical features will be treated as missing values.
  • early_stopping_rounds (int or Noneoptional (default=None)) – Activates early stopping. The model will train until the validation score stops improving. Validation score needs to improve at least every early_stopping_rounds round(s) to continue training. Requires at least one validation data and one metric. If there’s more than one, will check all of them. But the training data is ignored anyway. If early stopping occurs, the model will add best_iteration field.
  • evals_result (dict or Noneoptional (default=None)) –

    This dictionary used to store all evaluation results of all the items in valid_sets.

    Example

    With a valid_sets = [valid_set, train_set], valid_names = [‘eval’, ‘train’] and a params = (‘metric’:’logloss’) returns: {‘train’: {‘logloss’: [‘0.48253’, ‘0.35953’, …]}, ‘eval’: {‘logloss’: [‘0.480385’, ‘0.357756’, …]}}.

  • verbose_eval (bool or intoptional (default=True)) –

    Requires at least one validation data. If True, the eval metric on the valid set is printed at each boosting stage. If int, the eval metric on the valid set is printed at every verbose_eval boosting stage. The last boosting stage or the boosting stage found by using early_stopping_rounds is also printed.

    Example

    With verbose_eval = 4 and at least one item in evals, an evaluation metric is printed every 4 (instead of 1) boosting stages.

  • learning_rates (listcallable or Noneoptional (default=None)) – List of learning rates for each boosting round or a customized function that calculates learning_rate in terms of current number of round (e.g. yields learning rate decay).
  • keep_training_booster (booloptional (default=False)) – Whether the returned Booster will be used to keep training. If False, the returned value will be converted into _InnerPredictor before returning. You can still use _InnerPredictor as init_model for future continue training.
  • callbacks (list of callables or Noneoptional (default=None)) – List of callback functions that are applied at each iteration. See Callbacks in Python API for more information.
Returns:

booster – The trained Booster model.

Return type:

Booster

2.操作:

  用于训练你的模型,返回的是一个训练好的Booster模型

LightBGM之train的更多相关文章

  1. hdu1032 Train Problem II (卡特兰数)

    题意: 给你一个数n,表示有n辆火车,编号从1到n,入站,问你有多少种出站的可能.    (题于文末) 知识点: ps:百度百科的卡特兰数讲的不错,注意看其参考的博客. 卡特兰数(Catalan):前 ...

  2. 清华学堂 列车调度(Train)

    列车调度(Train) Description Figure 1 shows the structure of a station for train dispatching. Figure 1 In ...

  3. Organize Your Train part II-POJ3007模拟

    Organize Your Train part II Time Limit: 1000MS Memory Limit: 65536K Description RJ Freight, a Japane ...

  4. (转) How to Train a GAN? Tips and tricks to make GANs work

    How to Train a GAN? Tips and tricks to make GANs work 转自:https://github.com/soumith/ganhacks While r ...

  5. HDU 1022 Train Problem I

    A - Train Problem I Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u ...

  6. HDU 1022 Train Problem I(栈模拟)

    传送门 Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of st ...

  7. ACM/ICPC 之 用双向链表 or 模拟栈 解“栈混洗”问题-火车调度(TSH OJ - Train)

    本篇用双向链表和模拟栈混洗过程两种解答方式具体解答“栈混洗”的应用问题 有关栈混洗的定义和解释在此篇:手记-栈与队列相关 列车调度(Train) 描述 某列车调度站的铁道联接结构如Figure 1所示 ...

  8. GDC2016 Epic Games【Bullet Train】 新风格的VR-FPS的制作方法

    追求“舒适”和“快感”的VR游戏设计方法   http://game.watch.impress.co.jp/docs/news/20160318_749016.html     [Bullet Tr ...

  9. ADF_Controller系列5_通过绑定TasksFlow创建Train

    2015-02-14 Created By BaoXinjian

随机推荐

  1. mysql驱动(github上的)

    https://github.com/Eonblast/Emysql https://github.com/denglf/erlang-db-driver https://github.com/diz ...

  2. 【转载】关于quartus ii软件中注释乱码问题的解决方法

    最近在看Verilog代码,由于我的quartus版本打开他们的文件注释会全部乱码,痛苦万分!从网上找了下原因,解决方法基本没有,不过看到有人提出是编码的问题,立马我就想到一个解决方法,经过实验果然有 ...

  3. ActiveMQ-5.13.0集群

    ActiveMQ集群介绍 ActiveMQ具有强大和灵活的集群功能,但在使用的过程中会发现很多的缺点,ActiveMQ的集群方式主要由两种:Master-Slave(ActiveMQ5.8版本已不可用 ...

  4. 利用JQuery直接调用asp.net后台的简单方法

    利用JQuery的$.ajax()可以很方便的调用asp.net的后台方法. [WebMethod]   命名空间 1.无参数的方法调用, 注意:1.方法一定要静态方法,而且要有[WebMethod] ...

  5. 拼凑sql语句另外一个方法

    经常拼凑sql语句,经常是手工拼写 也可以利用字典另外一个模式拼凑 这里采用的是Dictionary中的Aggregate方法. 代码如下: static void Main(string[] arg ...

  6. MBR和GPT分区表

    https://www.reneelab.com.cn/m/mbr-gpt-difference.html

  7. day08<面向对象+>

    面向对象(代码块的概述和分类) 面向对象(代码块的面试题) 面向对象(继承案例演示) 面向对象(继承的好处和弊端) 面向对象(Java中类的继承特点) 面向对象(继承的注意事项和什么时候使用继承) 面 ...

  8. docker中文、手册、教程

    Docker资源 Docker官方英文资源: docker官网:http://www.docker.com Docker windows入门:https://docs.docker.com/windo ...

  9. NUC970设备驱动

    安装完WinUSB4NuVCOM_NUC970.exe后      USB0要配置成DEVICE 才可以在设备管理器中显示.

  10. oracle数据库sql比较日期

    select * from cc_random_check_info t where check_time > to_date('2016-09-09','yyyy-MM--dd')