Questions tagged [xgbclassifier]
112 questions
0
votes
1 answer
multiclass CV in XGboost (python) - some classes not in train/validation sub-groups
I am working with an XGboost model in python, with a large dataset comprised of embeddings (x) and corresponding labels (y), I have about 30000 samples.
The data is very imbalanced, with 8 different classes of labels.
I am attempting to perform…

orly064
- 11
- 4
0
votes
1 answer
XGBoost: How to calculate leaf weights in multi-class classification
I have trouble understanding how XGBoost calculates the leaf weights in multi-class classification.
I generated a simple example with two features and 3 classes.
The training data looks like this:
feature 0
feature 1
label…

Johanna
- 1
- 2
0
votes
1 answer
Invalid Parameter XGB For Estimator
I am performing a GridSearch on the parameters below for an XGB Classifier. It's simple enough, but when I run grid_search.fit(X_train, y_train) it returns ValueError: Invalid parameter xgb for estimator
I completed a xgb.get_params() to confirm the…
0
votes
0 answers
Proper way to use 'class_weight' for Multiclass Classification in XGBoostClassifier( ) in a Pipeline
I am working on a heavily imbalanced Multi-Class data for classification. I want to use the class_weight as given in many scikit-learn models. What is the best and proper way to do that inside a pipeline.
As I have seen in Documentation,…

Deshwal
- 3,436
- 4
- 35
- 94
0
votes
0 answers
Describe or display the relationship between variables and the labels xgboost?
I have a model:
model<-xgboost(data=as.matrix(data[,-1]),label=data$Ethnicity, num_class=8, nrounds=50,objective="multi:softmax",lambda=1, eval_metric="merror")
data is a matrix of 94 variables of random survey question and the label is Ethnicity…
user16596066
0
votes
0 answers
Cross validation returning 0 for train-merror and test-merror
Here is a sample from my data:
data
## q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 q16 q17 q18 q19 q20 q21 q22 q23 w
## 1 1.73 54.43 2 5 5 1 1 1 1 1 1 2 3 2 2 2 2 2 0
## 2 1.50 51.26 2 5 1 1 1 1 …
user16596066
0
votes
1 answer
How to set SageMaker xgboost's eval_metric to f1?
I tried SageMaker's AutoPilot to solve a binary classification problem and I found it is using f1 as the evaluation metric. But when I tried to write some code without tuning like this:
xgb.set_hyperparameters(max_depth=5,
…

kee
- 10,969
- 24
- 107
- 168
0
votes
1 answer
How to solve XGBoost error for traceback and unknown objective function?
I was trying to build an XGBoost Binary Classification model. I set up my training and test data and performed the following action to fit the data into the model.
clf_xgb = xgb.XGBClassifier(objective = 'binary: logistic', missing = None, seed =…

Mohd. Hamim
- 3
- 2
0
votes
1 answer
XGBoost for python is not accepting the shapes of my target
I have been struggling to get python's xgboost to accept targets due to their shape (I have tried shapes of (-1,1) vs (-1,), format of pandas vs numpy, and LabelBinarizing vs One-hot-encoding the target). Any advice to get this going?
import numpy…

Anthony M
- 109
- 8
0
votes
0 answers
TypeError with Sklear XGBoost and Sklearn Calibrated Classifier CV
I'm trying to calibrate the output probabilities from a XGBClassifier.
I've provided the sample code,
x_train, x_test, y_train, y_test = train_test_split(x_var, y_var, test_size = 0.2, shuffle = False)
new_mod2 = xgb.XGBClassifier(scale_pos_weight =…

Redratz
- 136
- 7
0
votes
1 answer
Titanic Dataset overfitting: can it be that much?
I am a bit confused as I am training a model that yields circa 88% CV score on the train data while the same model performs poorly on the test data after I submit it ( score of 0.75).
This drop of 12 points in accuracy can't be all due to…

sidhom slim
- 3
- 1
0
votes
0 answers
use of base_score parameter in R for XGBoost multiclass problem
Im trying to understand how a xgboost works for a multiclass problem. I have used the IRIS dataset to predict which species an input belongs to based on its characteristics and computed results in R.
The code is below
test <-…

akshay
- 1
- 1
0
votes
1 answer
printing out Best Parameter with Max/Best AUC Score
I am doing hyperparameter tuning and I am unable to print out max AUC score together with best parameter. see my below code. It only print 'Best params: None, AUC: inf' instead of 'Best params: 5, AUC: 87.1'
#HyperParameter Tuning
gridsearch_params…

Tumi Sebela
- 51
- 1
- 6
0
votes
0 answers
Predict function giving error for XGBoost but running for GBM in H2O
I am making a classification model using H2O in python. I am able to build a GBM model and make predictions on training and test dataset whereas when I build an XGBoost model and try to make predictions.
Below is the GBM code: (Runs perfectly…

Vishal Gupta
- 3
- 2
0
votes
1 answer
why the value of fscore is greater than 1?
I used XGBClassifier to fit the dataset and got feature_score using codes below:
feature_score = clf.get_booster().get_score()
The fscores i got all greater than 1 but how can that possible?

bulala
- 45
- 1
- 7