701 questions
1
vote
1
answer
66
views
How to handle unstable best_iteration in LightGBM when using Optuna for hyperparameter optimization?
I'm using Optuna to optimize LightGBM hyperparameters, and I'm running into an issue with the variability of best_iteration across different random seeds.
Current Setup
I train multiple models with ...
0
votes
0
answers
81
views
tidymodels lightgbm hyperparameters training issue
I have an issue with training lightgbm models through tidymodels.
There seems to be some sort of issues in how the hyperparameters are translated between tidymodels and lightgbm.
This is my code:
...
1
vote
1
answer
52
views
Lightgbm early_stopping: min_delta doesn't work
I was using lightgbm with early_stopping and min_delta, but according to the result, min_delta seems to have no effect.
final_model = lgb.train(
params,
train_data,
...
0
votes
0
answers
75
views
How to use GPU to train LGBM model from SynapseML
I have gone through the entire docs on SynapseML LightGBMRanker module. There was no attribute I could pass to tell the model to use CUDA GPU for training.
For e.g. for the plain LightGBM library, ...
5
votes
1
answer
152
views
Darts and LightGBM: original column names cannot be retrieved for feature importance
Problem
I am running a LightGBMModel via Darts with some (future) covariates. I want to understand the relevance of the different (lagged) features.
In particular, I would like to retrieve the feature ...
6
votes
1
answer
484
views
Constructing custom loss function in lightgbm
I have a pandas dataframe that records the outcome of F1 races:
data = {
"Race_ID": [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
"Racer_Number": [1, 2, 3, ...
1
vote
0
answers
31
views
Cannot reappearance mse in lightgbm custom objective when set feature_fraction
import numpy as np
import lightgbm as lgb
def custom_mse_objective(preds, train_data):
labels = train_data.get_label()
grad = (preds - labels)
hess = np.ones_like(labels)
return grad, ...
3
votes
1
answer
405
views
lightgbm force variables to be in splits
Im trying to find a way to train a lightgbm model forcing to have some features to be in the splits, i.e.: "to be in the feature importance", then the predictions are afected by these ...
1
vote
1
answer
174
views
What is max_evals in hyperopt fmin function?
I'm trying to run a multi-classification problem. I have run a baseline lightGBM model with around 80% accuracy rate. I'm trying to further fine-tuning its hyperparameter using Hyperopt. However, when ...
0
votes
0
answers
41
views
Light GBM with Collaborate Google
I have some app developing in Google Colaborate and need some model with BigData learning, I'm using Light GBM and need to setup GPU / CUDA.
But when I trying to install such dependencies I have ...
3
votes
1
answer
67
views
Reproduce LGBMRegressor predictions by manually aggregate the values
I am trying to reproduce by myself the LGBMRegressor predictions so when I succeed I will switch mean with median. But for now it seems that I am not able to.
Here is a simple script that I created ...
-1
votes
1
answer
95
views
Why lightgbm .predict function has probabilities not between 0 and 1? [closed]
I wanna understand why in this code, I get the following results:
# Import necessary libraries
import pandas as pd
from sklearn.metrics import f1_score
from sklearn.model_selection import ...
2
votes
1
answer
134
views
lightgbm.cv: cvbooster.best_iteration always returns -1
I am migrating from XGBoost to LightGBM (since I need it's exact handling of interaction constraints) and I am struggling to understand the result of LightGBM CV. In the example below, the minimum log-...
1
vote
2
answers
122
views
Why can't I wrap LGBM?
I'm using LGBM to forecast the relative change of a numerical quantity. I'm using the MSLE (Mean Squared Log Error) loss function to optimize my model and to get the correct scaling of errors. Since ...
1
vote
0
answers
108
views
Custom Labelling in Multi-Class Classification in XGBoost/ LightGBM
I have the following dataframe which records the IQ, Hours (number of hours of studying) and Score (past exam score for student 1,2,3,4 in different classes (Class_ID) and I would like to use these ...
3
votes
1
answer
635
views
XGBoost/ XGBRanker to produce probabilities instead of ranking scores
I have a dataset of the performance of students in exams which looks like:
Class_ID Class_size Student_Number IQ Hours_Studied Score
1 3 3 101 10 ...
0
votes
0
answers
139
views
XGBoost and LGBM models size depends on training data size for a given set of params whereas Catboost doesnt
I am comparing models in a walk forward cross validation setup, under python 3.11. For a given set of hyperparameters, xgboost and LGBM models size (when pickled or saved using the library saving ...
1
vote
0
answers
158
views
FLAML automl prediction probabilities do not match the prediction
i am using flaml automl on fabric for a classification exercise.
In order to leverage spark, i must use to_pandas_on_spark.
the features are already assembled in a vector.
from flaml.automl.spark....
0
votes
1
answer
211
views
How to install LightGBM on Ubuntu 20.04 with CUDA support [closed]
I followed the instructions in the docs, but also tried many other variations. All ended up in the same place, with this:
LightGBM] [Fatal] Check failed: (split_indices_block_size_data_partition) > ...
2
votes
1
answer
351
views
Python in Excel: How to install other Anaconda packages
Python in Excel includes some packages in the Anaconda distribution. +info, anaconda distribution packages.
However, is it possible to install additional packages that are still in the Anaconda ...
1
vote
1
answer
262
views
LightGBM Error When Trying to Continue Training
I have an existing LightGBM model. I'm trying to continue training on. It has 9 features. I'm trying to add a 10th. I don't have the source materials for the original file, only the 9Models.txt file ...
1
vote
0
answers
120
views
How to Include LightGBM 4.5 to Visual C++ Project?
I want to use C API LightGBM in My Visual C++ Project? How do I do it? I attach My code ??
DatasetHandle dataset_handle;
// load dataset
int result;
result = LGBM_DatasetCreateFromFile("D:\\...
5
votes
0
answers
185
views
Suppress warning messages when lightgbm is used in optuna?
I want to suppress the warnings, however I am unable to do so.
This issue is happening only when I am using a custom objective function instead of a regular one. I have tried multiple things to ...
0
votes
0
answers
226
views
how can i resolve this error : "LightGBMError: Label 754 is not less than the number of label mappings (31)"
I see the following using lightgbm (the LightGBM Python package):
LightGBMError: Label 754 is not less than the number of label mappings (31).
I am training LAMBDA MART in listwise dataset of Letor ...
1
vote
0
answers
45
views
How to handle 3d input data with tree boosting models for multi-output regression?
I have data of the form 32 commodities x 27 features x 3000 time steps for stock forecasting. For some reason, I must use a variety of tree boosting models (lightgbm, xgboost, adaboost) to compare ...
0
votes
1
answer
104
views
Passing categorical features to LightGBM in C API
I use Java wrapper of LightGBM C API to make predictions. Namely, methods LGBM_BoosterPredictForMatSingleRowFastInit and LGBM_BoosterPredictForMatSingleRowFast. The method ...
0
votes
0
answers
354
views
Unable to train SynapseML LightGBMClassifier on Spark
I have a 10 node Spark cluster and my job does the following,
Read parquet files from GCS bucket
Perform feature engineering, train/test split on the data
Use SynapseML LightGBMClassifier to train ...
1
vote
0
answers
96
views
Error in sklearn’s cross_val_score with ‘f1’ scoring for categorical target in LightGBM
My code receives a dataset and runs a classification on it with lightgbm. The problem is when I try to do fine-tuning with sklearn's cross_val_score, the target column contains categorical values, not ...
0
votes
1
answer
396
views
Error loading LightGBM library in PySpark with Python 3.10.0
Description:
I'm encountering an issue with a LightGBM regressor and classifier when using PySpark in Python 3.10.0.
Environment:
PySpark version: 3.2.1
Python version: 3.10.0
Py4j version: 0.10.9.5
...
1
vote
0
answers
212
views
AIC function for lightgbm, xgboost and randomforest regression
I'm trying to evaluate regression models created using LightGBM, XGBoost, and randomforest, with aic. My approach is to order features in terms of feature importance, fit, predict, and calculate aic, ...
0
votes
1
answer
1k
views
How many trees do I actually have in my LightGBM model?
I have code that looks like this
clf = lgb.LGBMClassifier(max_depth=3, verbosity=-1, n_estimators=3)
clf.fit(train_data[features], train_data['y'], sample_weight=train_data['weight'])
print (f"I ...
1
vote
1
answer
211
views
In lightgbm why do the train and the cv APIs accept categorical_feature argument when it is already present in the dataset construction
The Following are the .cv APIs of lightgbm
lightgbm.cv(params, train_set, num_boost_round=100, folds=None, nfold=5, stratified=True, shuffle=True, metrics=None, feval=None, init_model=None, ...
0
votes
0
answers
85
views
Computation time for lightGBM training/ testing goes to infinity if data set contains more than 36000 data points
I'm using lightgbm with the Tidymodels environment and I have a problem with training the model. After the final parameter selection using a gridsearch, I want to apply the model to the training ...
-1
votes
1
answer
157
views
Streaming LightGBM Dataset construction freezes on training
I've been trying to construct a LightGBM Dataset in Python using a reference Dataset (called ref_dataset) in a streaming manner. I'm not sure how it's done, and it involves calling what appear to be ...
2
votes
0
answers
270
views
How to use CGo properly to avoid memory leaks? Working with LightGbm C Api from Microsoft
I am using the LightGBM C Api in our ML model hosting service, written in Golang. I've written a CGO wrapper around the C Api. I am using the “lib_lightgbm.so” library file provided on Github.
I am on ...
-1
votes
1
answer
629
views
LightGBM with Multi-Output Regression and Custom Loss Function
Can I use LightGBM with Multi-Output Regression and also a custom Loss Function?
Problem is I have to use LightGBM.
I know that i can use MultiOutputRegression by sklearn to wrap LightGBM but this ...
2
votes
2
answers
515
views
lightgbm classifier: predictions are all 1
I have a lightGBM classifier model that I want to train on un_balanced data. In the training set there are 32500 1's and 2898 0's . The no of features are 30 and 17 of them are categorical data. This ...
0
votes
1
answer
821
views
Constant predicted values in LightGBM
I am trying to predict a variable (Y) using LightGBM Regression. However my predicted values are all the same (i.e. constant). Can someone help out in detecting the problem.
data_x = [[2021,5,368.92],[...
0
votes
1
answer
333
views
Sagemaker:Failed to parse HyperParameter during LightGBM training
I am trying to train a LightGBM model in sagemaker. I think I am missing how to set the hyperparameters. The model fails in the training process with this error
2024-04-01 01:36:47,011 sagemaker-...
1
vote
1
answer
314
views
L1 Regularization for "lightgbm" engine in tidymodels
How can I insert a regularization parameter in tidymodels for boost_tree()? In the normal lightgbm package there is the tuning parameter lambda_l1. I would like to use this in tidymodels as well.
I ...
0
votes
0
answers
124
views
How do I train a DaskLGBMClassifier using dask-cudf dataframe
I have a dask_cudf dataframe on which I have applied train test split to obtain the respective train, test data.
I am using DaskLGBMClassifier to train a classifier model & I can use dask ...
1
vote
1
answer
156
views
callbacks in sklearn.multiclass.OneVsRestClassifier
I want use callbacks and eval_set etc.
but i have a problem:
from sklearn.multiclass import OneVsRestClassifier
import lightgbm
verbose = 100
params = {
"objective": "binary",
...
-2
votes
1
answer
273
views
lightbgm sklearn n_estimators and n_estimators_ [closed]
I set n_estimators to 50 in lightgbm sklearn interface. When fitting stopped, n_estimators_ is 100. Why is this the case?
regressor = lightgbm.LGBMRegressor(n_estimators=50)
n_estimators (int, ...
0
votes
1
answer
437
views
Importing lightgbm library on M3 Macbook returns OSError
I use M3 MacBook and pycharm, and I get an error when running import lightgbm. I searched for information and executed the following command:
brew install open-mpi
brew install libomp
However, the ...
1
vote
1
answer
1k
views
turn off debug log output of lightgbm sklearn interface
How do I turn off debug log output of lightgbm sklearn interface? Tried
regressor = lightgbm.LGBMRegressor(verbose=-1)
does not work.
regressor.fit(verbose=-1)
is not accepted.
What I found is ...
1
vote
0
answers
155
views
How to use LightGbm Training Model for Value Prediction?
I'm using ML.NET for a value prediction application. Everything works, except I can't get it to use the LightGbm trainer algorithm. If I select all available trainers, it never tries LGBM. If I only ...
1
vote
1
answer
995
views
Custom L1 loss objective in LGBMRegressor
I'm trying to replicate the behaviour of "l1" objective in LGBMRegressor using a custom objective function.
I define the L1 loss function and compare the regression with the "l1" ...
0
votes
2
answers
235
views
Custom class that inherits LGBMClassifier doesn't work: KeyError: 'random_state'
I create a random dataset to train a LGBM model:
from sklearn.datasets import make_classification
X, y = make_classification()
Then I train and predict the original LGBM model with no issues:
from ...
1
vote
1
answer
255
views
System.DllNotFoundException: 'Unable to load DLL 'lib_lightgbm': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'
I'm trying to create a categorial model. I have a boolean type which I want to predict using multiple features (floats) in c#. I've tried many different codes from online, but I thought that this one ...
0
votes
1
answer
252
views
Problems encountered when installing the gpu version of lightgbm in ubuntu system on wsl2
I followed the steps provided by this link (install lightgbm GPU in a WSL conda env) to install lightgbm, but encountered a problem.
LightGBMError: No OpenCL device found
I have tried this command ...