Questions tagged [xgbclassifier]

112 questions
1
vote
0 answers

XGBoostClassifier isn't accelerated by GPU

I'm trying to speed ud my XGBClassifier using the GPU. I've tried this code but it takes the same time for both GPU and CPU: import xgboost as xgb from sklearn.datasets import fetch_covtype from sklearn.model_selection import train_test_split import…
ianux22
  • 405
  • 4
  • 16
1
vote
0 answers

ValueError: Classification metrics can't handle a mix of continuous and multiclass targets (XGBoost)

for a project I'm using a classifier, with XGBoost. Here is a part of the code: import ... tab = 'tab.csv' datasset = read_csv(tab, decimal=".") target_attribute = dataset['AVG'] a = random.randrange(1, 1000) seed = a test_size = 0.33 X_train,…
FChris
  • 11
  • 2
1
vote
1 answer

XGB - Feature shape mismatch

the function failed at prediction with the error: f"Feature shape mismatch, expected: {self.num_features()}, " ValueError: Feature shape mismatch, expected: 395, got 395 testX - 1 X 395 (Dataframe) trainX - n X 395 (Dataframe) def…
efrat
  • 13
  • 1
  • 4
1
vote
0 answers

How to add extra 5k trees in xgb classification

I have run XGBClassification where I have used 5k trees - model =…
Adrish Ray
  • 33
  • 3
1
vote
1 answer

WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.3.0/src/learner.cc:541: Parameters: { xgb_model } might not be used

I want to do Incremental Learning using XGBClassifier. I found xgb_model parameter of XGB can achieve this. As a 1st Step, I trained XGB Classifier on 1st Data Set. It trained well & Predictions were also made. code is as follows: from xgboost…
1
vote
1 answer

Xgboost - Decision Tree - Only one leaf

I'm try to plot a decision trees of Xgboost models from different datasets. Which worked fine for most of them, but for one dataset the plot_tree just shows only one leaf. It's weird for me, once the max_depth of that model is 5. Could anyone give…
ErickV
  • 51
  • 6
1
vote
1 answer

Check the SHAP feature importance for a subset of features

I`m trying to check the feature importance of an model I build using SHAP. It works fine using the following, but I would like to have a graph with only a subset of features. Could this be possible? shap.summary_plot(shap_values, features=X_train2,…
onr
  • 296
  • 4
  • 18
1
vote
1 answer

XGBoost, XGBClassifier : Unknown Objective Function Error

I am trying to train an XGBClassifier, but I am getting this error. I am using xgboost version 1.1.0. I used pip install xgboost for installing xgboost, and I also upgraded it. param_dict = {'n_estimators':i, 'max_depth':j,…
1
vote
1 answer

XGBoostError: value 0 for Parameter num_class should be greater equal to 1

I'm trying to compare two different feature sets for classifying customers into high-value, mid-value, and low-value. This is the code I used: ltv_xgb_model = xgb.XGBClassifier(max_depth=5,…
Life is Good
  • 106
  • 9
1
vote
1 answer

Hyperparameters tuning using GridSearchCV

I'm new to machine learning and I'm trying to predict the topic of an article given a labeled datasets that each contains all the words in one article. There are 11 different topics total and each article only has single topic. I have built a…
SuShiS
  • 73
  • 1
  • 3
  • 13
1
vote
0 answers

xgb.cv's auc score is not matching with cross_val_score when `colsample_bytree` is other than 1

I am working on highly imbalanced dataset. During hyperparameter tuning, I found that if colssample_bytree is set to value other than 1, then cross_val_score from sklearn package is not matching with the auc score obtained from xgb.cv. xgb.cv…
1
vote
1 answer

How to handle weighted average for AUC and selecting the right threshold for building the confusion matrix?

I have a binary classification task, where I fit the model using XGBClassifier classifier and try to predict ’1’ and ‘0’ using the test set. In this task I have a very unbalanced data majority ‘0‘ and minority ‘1’ at training data (of coarse the…
1
vote
3 answers

Changes to model performance by changing random_state of XGBClassifier

I trained a XGBClassifier for my classification problem and did Hyper-parameter tuning over huge grid(probably tuned every possible parameter) using optuna. While testing, change of random_state changes model performance metrics…
dgomzi
  • 106
  • 1
  • 14
1
vote
3 answers

how to create a confusion matrix for xgboost in R

I have already created my XGBoost classifier in R as in below code #importing the dataset XGBoostDataSet_Hr_Admin_8 <- read.csv("CompletedDataImputed_HR_Admin.csv") #Use factor function to convert categorical data to numerical…
ibocus
  • 45
  • 1
  • 9
1
vote
1 answer

H2O-3 Flow(UI) and XGBoost

I get the error below when I select to run XGBOOST via the menu in H2O-3 flow UI or when I include it when running all architectures (also via the "AutoML" options in H2O-3 flow). I only select the train + validation frames + response column and the…
PabloDK
  • 2,181
  • 2
  • 19
  • 42