最近使用了LightBGM的Dataset,记录一下:

1.说明:  classlightgbm.Dataset(datalabel=Nonereference=Noneweight=Nonegroup=Noneinit_score=Nonesilent=Falsefeature_name='auto'categorical_feature='auto'params=Nonefree_raw_data=True)

Bases: object

Dataset in LightGBM.

Constract Dataset.

Parameters:
  • data (stringnumpy arraypandas DataFramescipy.sparse or list of numpy arrays) – Data source of Dataset. If string, it represents the path to txt file.
  • label (listnumpy 1-D arraypandas one-column DataFrame/Series or Noneoptional (default=None)) – Label of the data.
  • reference (Dataset or Noneoptional (default=None)) – If this is Dataset for validation, training data should be used as reference.
  • weight (listnumpy 1-D arraypandas Series or Noneoptional (default=None)) – Weight for each instance.
  • group (listnumpy 1-D arraypandas Series or Noneoptional (default=None)) – Group/query size for Dataset.
  • init_score (listnumpy 1-D arraypandas Series or Noneoptional (default=None)) – Init score for Dataset.
  • silent (booloptional (default=False)) – Whether to print messages during construction.
  • 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.
  • params (dict or Noneoptional (default=None)) – Other parameters.
  • free_raw_data (booloptional (default=True)) – If True, raw data is freed after constructing inner Dataset.

  输出是一个dataset对象

2.使用:

  根据说明使用自己的数据,我这里data和label都用了DataFrame格式的

LightBGM之Dataset的更多相关文章

  1. HTML5 数据集属性dataset

    有时候在HTML元素上绑定一些额外信息,特别是JS选取操作这些元素时特别有帮助.通常我们会使用getAttribute()和setAttribute()来读和写非标题属性的值.但为此付出的代价是文档将 ...

  2. C#读取Excel,或者多个excel表,返回dataset

    把excel 表作为一个数据源进行读取 /// <summary> /// 读取Excel单个Sheet /// </summary> /// <param name=& ...

  3. DataTable DataRow DataColumn DataSet

    1.DataTable 数据表(内存) 2.DataRow DataTable 的行 3.DataColumn DataTable 的列 4.DataSet 内存中的缓存

  4. C# DataSet装换为泛型集合

    1.DataSet装换为泛型集合(注意T实体的属性其字段类型与dataset字段类型一一对应) #region DataSet装换为泛型集合 /// <summary> /// 利用反射和 ...

  5. 读取Simulink中Dataset类型的数据

    http://files.cnblogs.com/files/pursuiting/%E5%80%92%E7%AB%8B%E6%91%86%E6%8E%A7%E5%88%B6%E7%B3%BB%E7% ...

  6. RDD/Dataset/DataFrame互转

    1.RDD -> Dataset val ds = rdd.toDS() 2.RDD -> DataFrame val df = spark.read.json(rdd) 3.Datase ...

  7. asp.net dataset 判断是否为空 ?

    1,if(ds == null) 这是判断内存中的数据集是否为空,说明DATASET为空,行和列都不存在!! 2,if(ds.Tables.Count == 0) 这应该是在内存中存在一个DATASE ...

  8. C#遍历DataSet中数据的几种方法总结

    //多表多行多列的情况foreach (DataTable dt in YourDataset.Tables) //遍历所有的datatable{foreach (DataRow dr in dt.R ...

  9. c#解析XML到DATASET及dataset转为xml文件函数

    //将xml对象内容字符串转换为DataSet         public static DataSet ConvertXMLToDataSet(string xmlData)         { ...

随机推荐

  1. struct iphdr中的__LITTLE_ENDIAN_BITFIELD和__BIG_ENDIAN_BITFIELD

    __LITTLE_ENDIAN_BITFIELD表示小端序,__BIG_ENDIAN_BITFIELD表示大端序. /usr/include/linux/ip.h中有一段代码定义了ip首部的结构体,例 ...

  2. Mysql中Innodb大量插入数据时SQL语句的优化

    innodb优化后,29小时入库1300万条数据 参考:http://blog.51yip.com/mysql/1369.html 对于Myisam类型的表,可以通过以下方式快速的导入大量的数据: A ...

  3. 演示-JQuery属性选择器

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. VMware Host Agent服务不能正常启动

    VMware Host Agent服务不能正常启动 原因及解决方法 一直都在用VMWare Server 2.0,其他都还好,就是隔三差五的会有些小问题,比如VMware Host Agent服务不能 ...

  5. myeclipse配置Hadoop插件

    每个版本的 hadoop 都有相应版本的 MyEclipse 插件,官网并没有提供插件的jar包下载.在hadoop/src/contrib 目录下有一个 eclipse-plugin 项目,此项目就 ...

  6. tiny4412 ubuntudesktop更新源(old)

    1.报错:404  Not Found [IP: 91.189.88.151 80] 2. deb http://old-releases.ubuntu.com/ubuntu/ raring main ...

  7. IM软件业务知识—导航

    ----------------------------------------------------欢迎查看IM软件业务知识<专栏>-------------------------- ...

  8. MVC--布局--razor

    ASP.NET MVC Razor视图引擎攻略 转自:http://www.cnblogs.com/John-Connor/archive/2012/05/08/2487200.html --引子 看 ...

  9. 在linux中添加环境变量

    首先用命令查看配置了哪些环境变量 env命令查看 编辑环境变量命令  vim ~/.bash_profile Counter_HOME=/home/test/Counterexport Counter ...

  10. jQuery中如何解决多库冲突问题

    方法一:使用noConflict():舍弃$,$用jQuery代替jQuery.noConflict(); 方法二:自定义变量:舍弃$,新定义一个$y变量来代替$var $y = jQuery.noC ...