Questions tagged [lightgbm]

LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed and efficient with the following advantages: ... Support of parallel and GPU learning. Capable of handling large-scale data.

LightGBM is a high performance gradient boosting (GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks. It is under the umbrella of the DMTK(http://github.com/microsoft/dmtk) project of Microsoft.

Resources:

676 questions
10
votes
3 answers

Lightgbm classifier with gpu

model = lgbm.LGBMClassifier(n_estimators=1250, num_leaves=128,learning_rate=0.009,verbose=1)`enter code here` using the LGBM classifier is there way to use this with gpu this days?
user11173832
10
votes
1 answer

High AUC but bad predictions with imbalanced data

I am trying to build a classifier with LightGBM on a very imbalanced dataset. Imbalance is in the ratio 97:3, i.e.: Class 0 0.970691 1 0.029309 Params I used and the code for training is as shown below. lgb_params = { …
Sreeram TP
  • 11,346
  • 7
  • 54
  • 108
10
votes
2 answers

f1_score metric in lightgbm

I want to train a lgb model with custom metric : f1_score with weighted average. I went through the advanced examples of lightgbm over here and found the implementation of custom binary error function. I implemented as similar function to return…
Sreeram TP
  • 11,346
  • 7
  • 54
  • 108
10
votes
4 answers

LightGBM: continue training a model

I am training a model using cross validation like so: classifier = lgb.Booster( params=params, train_set=lgb_train_set, ) result = lgb.cv( init_model=classifier, params=params, train_set=lgb_train_set, …
William Entriken
  • 37,208
  • 23
  • 149
  • 195
9
votes
1 answer

Lightgbm ranking example

Can anyone share a minimal example with data for how to train a ranking model with lightgbm? Preferably with the Scikit-Lean api? What I am struggling with is how to pass the label data. My data are page impressions and look like this: X: user1,…
Toby
  • 2,174
  • 4
  • 22
  • 32
9
votes
3 answers

LightGBMError: Do not support special JSON characters in feature name - The same code is working in jupyter but doesn't work in Spyder

I have the following code: most_important = features_importance_chi(importance_score_tresh, df_user.drop(columns = 'CHURN'),churn) X = df_user.drop(columns = 'CHURN') churn[churn==2] = 1 y = churn # handle undersample…
zdz
  • 307
  • 1
  • 2
  • 9
9
votes
2 answers

Why does `categorical_feature` of lightgbm not work?

I want to use LightGBM to predict the tradeMoney of house, but I get troubles when I have specified categorical_feature in the lgb.Dataset of LightGBM. I get data.dtypes as follows: type(train) pandas.core.frame.DataFrame train.dtypes area …
Bowen Peng
  • 1,635
  • 4
  • 21
  • 39
9
votes
3 answers

Access trees and nodes from LightGBM model

In sci-kit learn, it's possible to access the entire tree structure, that is, each node of the tree. This allows to explore the attributes used at each split of the tree and which values are used for the test The binary tree structure has 5 nodes…
Titus Pullo
  • 3,751
  • 15
  • 45
  • 65
9
votes
1 answer

light gbm - python API vs Scikit-learn API

I am trying to apply LightGBM and have gone through the Python API documentation. Is there any difference between Training API and Scikit-learn API? Can we use both the APIs to achieve same result for the same problem?
9
votes
7 answers

Why ImportError: No module named lightgbm

My OS is Ubuntu, and I've followed the official installation guide to install lightgbm. However, when I import it, this error is raised: ImportError: No module named lightgbm How can I solve this? Do I also need to go to /python-package folder to…
dlwlrma
  • 808
  • 2
  • 10
  • 21
8
votes
1 answer

How to use RFE with xgboost Booster?

I'm currently using xgb.train(...) which returns a booster but I'd like to use RFE to select the best 100 features. The returned booster cannot be used in RFE as it's not a sklearn estimator. XGBClassifier is the sklearn api into the xgboost…
pmdaly
  • 1,142
  • 2
  • 21
  • 35
8
votes
2 answers

lightgbm || ValueError: Series.dtypes must be int, float or bool

Dataframe has filled na values . Schema of dataset has no object dtype as specified in documentation. df.info() output: Int64Index: 429 entries, 351 to 559 Data columns (total 11 columns): # Column …
Gokul Y
  • 115
  • 2
  • 6
8
votes
2 answers

what does lightgbm python Dataset reference parameter mean?

I am trying to figure out how to train a gbdt classifier with lightgbm in python, but getting confused with the example provided on the official website. Following the steps listed, I find that the validation_data comes from nowhere and there is…
kuixiong
  • 505
  • 1
  • 4
  • 16
8
votes
3 answers

shap.force_plot() raises Exeption: In v0.20 force_plot now requires the base value as the first parameter

I'm using Catboost and would like to visualize shap_values: from catboost import CatBoostClassifier model = CatBoostClassifier(iterations=300) model.fit(X, y,cat_features=cat_features) pool1 = Pool(data=X, label=y,…
8
votes
1 answer

How Bagging in LightGBM works

In the lightGBM model, there are 2 parameters related to bagging bagging_fraction bagging_freq (frequency for bagging 0 means disable bagging; k means perform bagging at every k iteration Note: to enable…
Kid
  • 413
  • 4
  • 11
1
2
3
44 45