最近使用了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 安装apache后,修改默认路径

    默认由apt方式安装的Apache,指定网页主目录位于:/var/www 而系统/var所分到的空间太少,所以要换路径 1.修改默认网站目录 ubuntu8.10下修改apache2的默认文档目录 默 ...

  2. ojdbc14.jar 放在kettle那个目录下面

    \libext\edtftpj-1.4.5.jar \libext\firebirdsql-full.jar \libext\firebirdsql.jar \libext\gis-shape.jar ...

  3. orcale_proceduie_function_两三栗

    --获取部门树 procedure: create or replace procedure P_UTIL_TREE_ALL(P_APPL_NAME in VARCHAR2, P_HIERARCHY_ ...

  4. Effective C++ Item 17 Store newed objects in smart pointer in standalone statements

    If you trying to do multiple things in one statement, you should think carefully abnormal behavior e ...

  5. swift开发之 -- ? 和 ! 的作用

    记录下这个知识点: 一般我们在一下两种情况会遇到 ? 和 !的使用 1,声明变量时 var number:Int? var str:String? 2,在对变量进行操作时 number?.hasVal ...

  6. Windows 端口占用

    1.netstat -ano | findstr "80"( 80为提示被占用的端口): 2.tasklist | findstr "5584"(5584是从上 ...

  7. 使用命令wsimport构建WebService客户端

    原文:http://www.cnblogs.com/ningvsban/p/3760085.html wsimport命令介绍 在JDK的bin文件夹中,有一个wsimport.exe,这个工具依据w ...

  8. IOS实例方法和类方法的区别

    类方法和实例方法   实例方法是— 类开头是+ 实例方法是用实例对象访问,类方法的对象是类而不是实例,通常创建对象或者工具类. 在实例方法里,根据继承原理发送消息给self和super其实都是发送给s ...

  9. MUI ajax数据请求(list)

    服务器返回格式 { "code": "1001", "message": "查询成功", "data" ...

  10. Delphi的保存文件对话框-TsaveDialog

    TsaveDialog继承于TOpenDialog,只介绍以下几个内容: 1.TsaveDialog如何设定为保存的默认路径是当前程序所在的文件夹: 默认目录是当前程序所在目录应设置属性Initial ...