最近使用了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. linux -- ubuntu搭建nodejs环境

    需求:在web端做一个实时性功能比较强的模块, 客户端:用websocket 服务端:node.js node.js介绍:node.js天生就是一个高效的服务端语言,可以直接使用 javascript ...

  2. 奇葩问题:ListView中Item与Item中的Button不能单击问题

    android中ListView是一个经常要用到的一个组件,用到该组件时经常会碰到ListView的Item和Item中的Button不能单击的问题. 本人在使用时同样也遇到过这样的情况,共有三种情况 ...

  3. Asp.Net之后台载入JS和CSS

    在Asp.Net开发时,用到的JS库.通用的CSS等,在很多页面都会用到,而每次都须要手动引入.相当麻烦.并且有时一旦忘了引用,还得找半天才干找到问题.那有没有什么办法可以一劳永逸的呢?答案是有的. ...

  4. 使用_snscanf_s转换十六进制时引起的内存越界

    //将Hex编码转换为指定编码格式的字符串 string Encoding::DecodeHexString(const string &strSrc, UINT code_page ) { ...

  5. 【Java面试题】30 子线程循环10次,接着主线程循环100,接着又回到子线程循环10次,接着再回到主线程又循环100,如此循环50次,请写出程序。

    题目如下: 子线程循环10次,接着主线程循环100,接着又回到子线程循环10次, 接着再回到主线程又循环100,如此循环50次 思路如下: 子线程语主线程为互斥,可用SYNCHRONIZED.很容易想 ...

  6. logging.xml file setfile(null,true) call failed

    定义目录三个方法:一:${catalina.base}或${catalina.home}相对路径配置方法.catalina.home是你配置服务器时自动在环境变量中加的路径,默认是指向tomcat服务 ...

  7. vc 找到一个或多个多重定义的符号

    vc 找到一个或多个多重定义的符号, 这个问题还是不能很好的解决. 最根本的是: 把所有有关定义的部分都放在.cpp文件中,对应的.h文件中只放声明.这样在#include ""的 ...

  8. Loadrunner 9.5_webservice(SOAP)性能测试

    WebService定义:Webservice是一种新的使用基于XML标准和协议来交换信息的WEB应用程序.是基于SOAP(简单对象访问协议)消息的应该协议,只是为WEB页面或可执行程序提供编程接口. ...

  9. android 开发者资源下载地址记录(转+补充)

    https如果无法下载的话将下面的:https://dl-ssl 部分改为 http://dl (1)Android SDK (Android SDK主安装包,包含SDK Manager.AVD Ma ...

  10. mysql中" ' "和 " ` "的区别

    http://blog.csdn.net/yang3290325/article/details/3349907