Signature:
lgb.LGBMRegressor.fit(
self,
X,
y,
sample_weight=None,
init_score=None,
eval_set=None,
eval_names=None,
eval_sample_weight=None,
eval_init_score=None,
eval_metric=None,
early_stopping_rounds=None,
verbose=‘warn’,
feature_name=‘auto’,
categorical_feature=‘auto’,
callbacks=None,
init_model=None,
)
Docstring:
Build a gradient boosting model from the training set (X, y).

Parameters

X : array-like or sparse matrix of shape = [n_samples, n_features]
Input feature matrix.
y : array-like of shape = [n_samples]
The target values (class labels in classification, real numbers in regression).
sample_weight : array-like of shape = [n_samples] or None, optional (default=None)
Weights of training data.
init_score : array-like of shape = [n_samples] or shape = [n_samples * n_classes] (for multi-class task) or shape = [n_samples, n_classes] (for multi-class task) or None, optional (default=None)
Init score of training data.
eval_set : list or None, optional (default=None)
A list of (X, y) tuple pairs to use as validation sets.
eval_names : list of str, or None, optional (default=None)
Names of eval_set.
eval_sample_weight : list of array, or None, optional (default=None)
Weights of eval data.
eval_init_score : list of array, or None, optional (default=None)
Init score of eval data.
eval_metric : str, callable, list or None, optional (default=None)
If str, it should be a built-in evaluation metric to use.
If callable, it should be a custom evaluation metric, see note below for more details.
If list, it can be a list of built-in metrics, a list of custom evaluation metrics, or a mix of both.
In either case, the metric from the model parameters will be evaluated and used as well.
Default: ‘l2’ for LGBMRegressor, ‘logloss’ for LGBMClassifier, ‘ndcg’ for LGBMRanker.
early_stopping_rounds : int or None, optional (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.
To check only the first metric, set the first_metric_only parameter to True
in additional parameters **kwargs of the model constructor.
verbose : bool or int, optional (default=True)
Requires at least one evaluation data.
If True, the eval metric on the eval set is printed at each boosting stage.
If int, the eval metric on the eval set is printed at every verbose boosting stage.
The last boosting stage or the boosting stage found by using early_stopping_rounds is also printed.

.. rubric:: ExampleWith ``verbose`` = 4 and at least one item in ``eval_set``,
an evaluation metric is printed every 4 (instead of 1) boosting stages.

feature_name : list of str, or ‘auto’, optional (default=‘auto’)
Feature names.
If ‘auto’ and data is pandas DataFrame, data columns names are used.
categorical_feature : list of str or int, or ‘auto’, optional (default=‘auto’)
Categorical features.
If list of int, interpreted as indices.
If list of str, interpreted as feature names (need to specify feature_name as well).
If ‘auto’ and data is pandas DataFrame, pandas unordered categorical columns are used.
All values in categorical features should be less than int32 max value (2147483647).
Large values could be memory consuming. Consider using consecutive integers starting from zero.
All negative values in categorical features will be treated as missing values.
The output cannot be monotonically constrained with respect to a categorical feature.
callbacks : list of callable, or None, optional (default=None)
List of callback functions that are applied at each iteration.
See Callbacks in Python API for more information.
init_model : str, pathlib.Path, Booster, LGBMModel or None, optional (default=None)
Filename of LightGBM model, Booster instance or LGBMModel instance used for continue training.

Returns

self : object
Returns self.

Note

Custom eval function expects a callable with following signatures:
func(y_true, y_pred), func(y_true, y_pred, weight) or
func(y_true, y_pred, weight, group)
and returns (eval_name, eval_result, is_higher_better) or
list of (eval_name, eval_result, is_higher_better):

y_true : array-like of shape = [n_samples]The target values.
y_pred : array-like of shape = [n_samples] or shape = [n_samples * n_classes] (for multi-class task)The predicted values.In case of custom ``objective``, predicted values are returned before any transformation,e.g. they are raw margin instead of probability of positive class for binary task in this case.
weight : array-like of shape = [n_samples]The weight of samples.
group : array-likeGroup/query data.Only used in the learning-to-rank task.sum(group) = n_samples.For example, if you have a 100-document dataset with ``group = [10, 20, 40, 10, 10, 10]``, that means that you have 6 groups,where the first 10 records are in the first group, records 11-30 are in the second group, records 31-70 are in the third group, etc.
eval_name : strThe name of evaluation function (without whitespace).
eval_result : floatThe eval result.
is_higher_better : boolIs eval result higher better, e.g. AUC is ``is_higher_better``.

For multi-class task, the y_pred is group by class_id first, then group by row_id.
If you want to get i-th row y_pred in j-th class, the access way is y_pred[j * num_data + i].
File: e:\anaconda3\lib\site-packages\lightgbm\sklearn.py
Type: function

LGBMRegressor拟合函数官方文档相关推荐

  1. php trader bbands,PHP - Manual: Trader 函数 (官方文档)

    trader_acos - Vector Trigonometric ACos trader_ad - Chaikin A/D Line trader_add - Vector Arithmetic ...

  2. TensorFlow官方文档中的sub 和mul中的函数已经在API中改名了

    照着tensorflow 官方文档学习tensorflow时,出现问题: 第一,执行程序 #进入一个交互式Tensorflow会话 import tensorflow as tf sess = tf. ...

  3. python文档整理,Python官方文档内置函数整理Word版

    <Python官方文档内置函数整理Word版>由会员分享,可在线阅读,更多相关<Python官方文档内置函数整理Word版(6页珍藏版)>请在人人文库网上搜索. 1.传播优秀W ...

  4. excel函数从0到掌握(官方文档+自我解析)

    excel函数从0到掌握 我写到一半,发觉网上的资料还不如,wps自带的视频讲解,在这里提醒你们一下!(不是打广告,视频免费) 四大运算符 算术运算符 比较运算符 文本运算符 引用运算符 优先级 1. ...

  5. python各库的官方文档(涉及各函数、参数的使用)(pandas、numpy、sklearn)

    对于常用的python函数,我们要找他的参数的意义的基本使用的方法,碎片化的一个一个在csdn或者别的地方找它的具体用法,很多时候效率很低,在这里推荐给大家几个常用的官方文档,里面包含了该库下的所有函 ...

  6. 微信小程序如何实现支付功能?看官方文档头疼(使用云函数的方式操作)

    先来个效果图  ^_^ 微信支付功能,个人公众号是没有办法进行开发支付功能的,需要是使用非个人公众号进行注册(如:营业执照等,可以去淘宝购买一个也行 大概500左右) 公众平台的配置可以参考文档,这里 ...

  7. Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?...

    官方文档:https://developer.android.com/reference/android/widget/AutoCompleteTextView.html#setText(java.l ...

  8. 详解train_test_split()函数(官方文档有点不说人话)

    1.完整用法 sklearn.model_selection.train_test_split(*arrays, test_size=None, train_size=None, random_sta ...

  9. Sklearn官方文档中文整理4——随机梯度下降和最近邻篇

    Sklearn官方文档中文整理4--随机梯度下降和最近邻篇 1. 监督学习 1.5. 随机梯度下降 1.5.1. 分类[linear_model.SGDClassifier] 1.5.2. 回归[li ...

最新文章

  1. 自定义Quartz超实用工具类
  2. SpringCloud之声明式服务调用 Feign(三)
  3. plsql存储过程修改后怎么保存_Solidity变量存储位置与gas成本详解
  4. IT接口——Micro USB带来的市场影响力
  5. 如何在Windows 8中更改登录屏幕的颜色
  6. 一种替代的多生产者方法
  7. Tensorflow初入门
  8. 怎样用计算机进行文字采集,怎么将照片上的文字自动录入电脑
  9. STC1_FULLSCREEN_TABLE_CONTROL
  10. 小黑与Vista试用手记
  11. H5热门游戏模板案例解读:贪吃蛇玩法的新高度
  12. 777后无效 执行chmod_执行chmod -R 777 / 补救
  13. oracle01004,Oracle goldengate的OGG-01004 OGG-1296错误
  14. android自定义View之气球碰撞效果
  15. asp.net paypal信用卡支付功能
  16. 深圳中学高考2021成绩查询,2020深圳高中高考数据对比,明年考多少分能上好高中?...
  17. Makefile3、书写规则(文件搜寻、伪目标、多目标、静态模式、自动生成依赖性)
  18. 点击按钮没有反应,onclick函数点击无反应的原因
  19. 手电筒安卓_iPhone手电筒只能照明?这两个隐藏技巧一定要会,事半功倍!
  20. 公司要倒闭的6大征兆——集齐任意5个,兑换一次破产清算

热门文章

  1. 类加载过程与双亲委派机制
  2. CRM定制要注意哪些
  3. 数值的整数次方 和开根号
  4. 计算机无法连接网络的原因主要有哪几种,电脑连不上网常见的几种处理方法
  5. 分布式计算的八大谬论
  6. 【软件安全实验2022】验证码——1
  7. 通达信l2接口Type-C功能
  8. 【恢复案例】国内某公司服务器感染.[ideapad@privatemail.com].mkp新型勒索病毒
  9. 【贪心】FatMouse‘s Trade
  10. Rax SSR 完成6倍 React 渲染性能提升