Questions tagged [xgboost]
XGBoost is a library for constructing boosted tree models in R, Python, Java, Scala, and C++. Use this tag for issues specific to the package (i.e., input/output, installation, functionality).
2,798
questions
1
vote
1
answer
12
views
changing early_stopping_rounds on xgboost doesn't effect the performance. what's wrong?
I have a binary classification dataset. I use xgboost. I changed early_stopping_rounds value and fit. it gave same results every time. I shared screenshots below. what is the reason of same results?
...
0
votes
0
answers
18
views
dtreeviz showing the same feature / split in all nodes of a xgboost decision tree
Problem description
I'm trying to visualize xgboost decision trees using dtreeviz. However, the visualized trees show the same feature name ('ROI: 74; Feature: spkt_welch_density' in my example) and ...
0
votes
0
answers
20
views
XGBoost model running out of memory in Databricks/PySpark
I am facing a problem for which I am unable to find a solution - whenever an xgboost model is used for relativelly small dataset inside Databricks environment with PySpark integration via xgboost....
0
votes
0
answers
30
views
Converting [samples, time-steps, features] into 2D input shape
I have a 3D input sequence prepared for LSTM, i.e., (samples, time-steps, features) or (100,20,5) for instance. And I want to compare the LSTM results with XGBoost which can only take 2D input.
The ...
0
votes
0
answers
13
views
With the last update of the xgboost function I got an annoying error related to the internal function xgb.iter.update
This is the code I am implementing:
## 7.1) Working only with the PCA components from 1 to 5 (Set 1) ----
## |¬ Defining a extreme gradient boosting model of classification (only PC 1-5)
xgb....
-2
votes
1
answer
22
views
Why my XGBoost model for time series forecasting is delayed in its predictions? [closed]
I am trying to forecast 24h ahead the price of electricity of a country.
I tried MLR and XGBoost, the XGBoost model seems to get better the patterns and tendencies but always too late leading to huge ...
0
votes
0
answers
53
views
Defining the Time variable correctly
I have temperature data collected at certain times for 3 years. I'm trying to estimate these over time using Xgboost. But I guess I can't define the time variable correctly because when I look at my ...
0
votes
1
answer
57
views
Save and load a lightGBM model in R
I am trying to save and later load a lightGBM model, but I cannot do it.
I have already tried saveRDS() and readRDS functions, but when I predict, i get this error:
Error in predictor$predict(data = ...
-2
votes
0
answers
23
views
Xgboost model produces garbage after training
So, I wanna to fit xgboost model on dataset "House Prices - Advanced Regression Techniques" from kaggle competition (https://www.kaggle.com/competitions/house-prices-advanced-regression-...
0
votes
1
answer
10
views
Different MAE values from XGBoost.regressor between a GPU and a CPU notebooks, why?
I'm looking for better XGBoost.regressor options using optune. I have one instance of the laptop running on a local computer (on the processor, my video card does not support machine learning), one on ...
-1
votes
0
answers
12
views
ML Metric selection
Is there any metrix to optmize where i can tolerate larger % deviation in low scale and lower % on larger scale. For example: i have a time taken to reach a detination. the range varies from 1 min to ...
2
votes
0
answers
22
views
Tidymodels xgboost using step_dummy(one_hot =T) - set mtry as proportion instead of range when creating custom grid and tuning with tune_race_anova
My train data has 32 columns, but since I am incorporating step_dummy(all_nomical_predictors), one_hot = T) in my recipe, I end up with more than 32 columns when modeling. Therefore, just running ...
0
votes
0
answers
17
views
How to obtain a dataframe of trees from a CatBoost model similar to XGBoost's model.get_booster().trees_to_dataframe()
I'm working with CatBoost and I need to extract information about the trees generated by a trained CatBoost model in the form of a dataframe, similar to how it can be done with XGBoost using model....
1
vote
0
answers
24
views
using sklearn pipeline with xgboost and onehotencoder
I have a pipeline in sklearn like this:
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import OneHotEncoder
import xgboost as xgb
pipe = make_pipeline(OneHotEncoder(drop='first'...
-1
votes
0
answers
29
views
XGBoostError: bad allocation
there was another question regarding this but it had no responses
When loading an XGBoost model and running it I get the following error:
XGBoostError: bad allocation
code:
from sklearn.metrics ...
0
votes
0
answers
22
views
Replicating gradient boosting model using scikit-learn's classifier in xgboost and LightGBM
I have a small dataset (28 entries) in which I have been doing a churn analysis using a gradient-boosting model with Python's Scikit-Learn with great results apparently: I have 100% accuracy in the ...
1
vote
1
answer
85
views
Calculation of expected_value in SHAP explanations of XGBoost Classifier
How do we make sense of SHAP explainer.expected_value? Why is it not the same with y_train.mean() after sigmoid transformation?
Below is a summary of the code for quick reference. Full code available ...
0
votes
1
answer
27
views
Installing xgboost on Arch Linux through cmake
I am trying to install xgboost through the git repositorty, using the following commands
cd xgboost
mkdir build
cd build
cmake ..
When I run the last command cmake.. I get the following error ...
0
votes
0
answers
8
views
how can you make hyper parameters? in orange3
I don't see any tools about this. do i have to download other tools?
and 'test and score' how can i get f1 score? mine one only mse, mae comes out
i've searched on internet about orange3 on hyper ...
0
votes
0
answers
30
views
XGBOOST: Job aborted due to stage failure: Could not recover from a failed barrier ResultStage
Running the SparkXGBClassifier on Databricks i3.2xlarge (61gb memory, 8 cores)
Currently training 100+ models using a for loop like the following:
import os
os.environ["PYSPARK_PIN_THREAD"] =...
0
votes
1
answer
33
views
Error in names(res$trainingData) %in% as.character(form[[2]]) : argument "form" is missing, with no default
When trying to tune the hyperparameters of an XGBoost model:
library(caret)
ctrl <- trainControl(
method = "cv",
number = 2,
verboseIter = TRUE,
search = "grid"...
-2
votes
0
answers
47
views
AssertionError: Must have at least 1 validation dataset for early stopping in xgboost
I was developing a xgboost model for kaggle competition and got this error:
AssertionError: Must have at least 1 validation dataset for early stopping.
I think the problem is not in the validation ...
-1
votes
0
answers
14
views
I use H2OXGBoostModel to train some data and get this error
val hc: H2OContext = H2OContext.getOrCreate()
val spark: SparkSession = SparkSession
.builder()
.master("local[*]")
.appName("xgb")
...
-1
votes
1
answer
40
views
What does lags mean exactly in XGBoost?
I'm trying to make a time series forecast using XGBoost, I didn't understood very well the meaning of lags:
What does it do and meaning of it?
what is the best way to choose the more efficient lag ...
0
votes
0
answers
19
views
How to match features to xgboost feature importance
I have used xgboost feature importance to get feature importance scores using the floowing code:
from xgboost import XGBRegressor
from xgboost import plot_importance
from matplotlib import pyplot
...
0
votes
0
answers
32
views
error when using SKforecast : None of [Int64Index([48, ...],\n dtype='int64', name='date_time')] are in the [index]
i have the dataset that i used the groupby(based on date and group) and the result is like this Dataframe:
| date | group | value |
|:---- |:------:| -----:|
| 2022-01-01 | 12 | 25....
0
votes
0
answers
16
views
Residual standard deviation out of Caret Cross validation
I am using the folowing codes to train a xgboost model:
caret::trainControl(
method = "repeatedcv", # cross-validation
number = 5, # with n foldsÂ
repeats = 1,
p = 0....
0
votes
0
answers
14
views
How to use Xgboost.DMatrix.set_info in combination with randomizedsearchcv?
I am training an xgboost.Classifier, and I want to specify feature importance manually by using the feature_weights setting of the xgboost.DMatrix option. However, I am not sure how to integrate this ...
1
vote
1
answer
35
views
Hyperparameter Optimization with Hyperopt (Baysian Hyperparamter Optimization) yields hyperparamter outside defined search space
I implemented a hyperparameter optimization with hyperopt for a XGBoostClassifier.
Therefore, I defined a certain search space, e.g. "n_estimators": hp.choice("n_estimators",np....
0
votes
2
answers
68
views
XGBOOST Model predicting, with nan Input values
I am facing a weird behavior in the xgboost classifier. Reproducing the code from a response to this post
import xgboost as xgb
import numpy as np
from sklearn.datasets import make_moons
from sklearn....
0
votes
0
answers
26
views
Ray Tune Hyperparamter Optimization with XGBoost - TuneNoNextExecutorEventError| RayActorError
I simply would like to tune my XGBoost with Ray Tune locally. However, my "actor" always dies unexpectedly before the ray trail could even start.
I tried different code variants and also ...
0
votes
0
answers
28
views
Issue with using XGBoost Regressor
I'm using XGBRegressor algorithm in Jupyter Notebook. Here is my script:
from xgboost import XGBRegressor #xgb regressor module
xgb = XGBRegressor(n_estimators = 3000,learning_rate=0.01)
xgb.fit(...
0
votes
1
answer
38
views
Port XGBoost model with m2cgen: presence of nan
I got into the same situation as the OP of this post. I would definitely prefer just to see the doc on how to extract the data from the xgb model and how exactly to code up its forward propagation, ...
0
votes
0
answers
11
views
How to implement the federated XGBoost by getting the Gi and Hi values from nodes, saving them in a file, aggregate them and pass them to XGBoost?
I need to get some results for federated XGBoost but I just want to simply get the hi and gi from each node and same them, then aggregate it and pass the new Hi and Gi to the nodes to use it and test ...
0
votes
0
answers
49
views
TerminatedWorkerError in GridSearch
When I try to run grid search for XGBClassifier() or sklearn GradientBoostingClassifier I have an error approximately in a 2 minutes after running.
if we talk about memory - its about 60% free memory ...
0
votes
0
answers
35
views
AttributeError: module 'xgboost' has no attribute '__version__'
I'm receving this error (AttributeError: module 'xgboost' has no attribute 'version')
while trying to build AutoML model using pycaret
import pandas as pd
import streamlit as st
from ydata_profiling ...
0
votes
1
answer
32
views
Why is HpBandSterSearchCV (hpbandster-sklearn) returning Nan scores on future iterations?
I am using the hpbandster-sklearn package to apply hyperband tuning to an xgboost.
In some cases the first iteration will see a score and the parameters move on. Only for the next iteration to produce ...
1
vote
1
answer
29
views
Native xgb and XGBRegressor same predictions but not the same metric
I don't understand why the metric are not the same between xgb.train and xgb.XGBRegressor. I do have the same prediction values. Do you have an idea ?
Here below a little example on simulated data.
...
1
vote
0
answers
45
views
Enable_categorical is not working with categorical data
I have several categorical features in my dataset and I have set their data type to "category".
cols = ['A','B', 'C']
for i in cols:
data[i] = data[i].astype('category')
and I have ...
0
votes
0
answers
22
views
When trying to reproduce optuna optimization results the precision score is different than optimization with XGBoost
After hyperparameter optimization yields best parameters when i try and reproduce the result there is a significant difference in results based on the same dataset and seed value:
My optimization code ...
0
votes
2
answers
46
views
Negative R2 values
While generating accuracy metrics for a model I'm returning negative R2 values. The model is taking Principal compnents and train/test (80/20) in an XGboost model. I cant tell if I'm using an ...
0
votes
1
answer
29
views
XGBoost Hyperopt hyperparameter optimization type error
I am using Hyperopt to optimize the hyperparameters of my XGBRegressor model and I am getting the error:
reg_alpha = int(space['reg_alpha'],min_child_weight=space['min_child_weight'],
TypeError: int() ...
0
votes
0
answers
15
views
XGBoost built-in best cut off calculation method (Youden's J Statistic or Euclidean Distance)
How does the XGBoost classifier model calculate the best cutoff and return the predicted class?
I found out that there are 2 ways to calculate it.
Is it Youden's J Statistic or is it Euclidean ...
0
votes
2
answers
36
views
How to train a model with kfold cv
I want to train an xgboost binary classifier. My training data with labels is in a txt file that has libsvms in it. I am working with an extremely imbalanced dataset, roughly 200 of one class and 66,...
0
votes
0
answers
68
views
GPU not used when running XGBoost
I'm quite new in ML world, for my project done with XGBoost model I tried to use my GPU for GridSearch and parameter tuning. Unfortunatelly I have feeling that my GPU is not used, as info displayed ...
0
votes
0
answers
31
views
Centos7 R xgboost package install error : can't install package ‘xgboost’ up to 1.1.1.1
I got an following error message while installing xgboost package on R :
C++ compiler cannot create executables
To solve this problem, updating gcc & cmake :
gcc : 4.8.5 → 8.5.0
g++ : 4.8.5 → 8.5....
1
vote
1
answer
36
views
How does XGBoost use MAE as objective function?
XGBoost did not allow to use absolute error as objective function in the past since it is a non-differentiable function and its Hessian is equal to 0. However, it does allow to use it now (https://...
0
votes
0
answers
19
views
Negative MAE value in XGBRegressor [duplicate]
Background: I have a tabular dataset and I am trying to predict price values. Two type of features are available where some columns are categorical variables(as dummy) and other features where the ...
0
votes
0
answers
13
views
Additively updating model parameters (not fine-tuning) in DNNs and XGBoost
I need a regression model to train on tabular data daily, that cannot take more than 5 minutes to train during the week, but can take up to an hour at the weekend. Hardware upgrades are out of scope ...
0
votes
1
answer
62
views
convert XGBRegressor( booster='gblinear', objective='reg:squarederror') to ONNX returns error
i was working on a simple 3d regressor model and i used the following parameters
#my code extract:
from mlprodict.onnxrt import OnnxInference
import numpy
import onnxruntime as onnx_RT
from sklearn....