Questions tagged [xgbclassifier]
112 questions
1
vote
0 answers
Why the output of cross_validate differ from the hardcode loop when using XGBClassifier?
Code #1 Pass pipeline with PCA, XGBClassifier steps to scikit-learn cross_validate function
from xgboost import XGBClassifier
from sklearn.model_selection import cross_validate, LeaveOneOut
from sklearn.pipeline import Pipeline
from…

MGH
- 169
- 4
- 10
1
vote
1 answer
Get individual features importance with XGBoost
I have trained an XGBoost binary classifier and I would like to extract features importance for each observation I give to the model (I already have global features importance).
More specifically, I am looking for a way to determine, for each…

Ismalyt
- 59
- 8
1
vote
3 answers
How to pass XGBoost fit parameters when using OneVsRestClassifier?
I want to pass the fit's parameters of xgboost through OneVsRestClassifier's fit method.
clf = OneVsRestClassifier( XGBClassifier(objective='binary:logistic', seed=0))
# Want to pass `eval_set` and 'eval_metric' to xgboost model.
clf.fit(X_train,…

Animesh Kumar Paul
- 2,241
- 4
- 26
- 37
1
vote
1 answer
xgboost module is not recognized
Though there is another question on the same issue, the solution stated there does not work for me. Hence this is not a duplicate or re-post. And I am posting my issue and implementation specifics here.
I am currently working on PyCharm on a simple…

Nayantara Jeyaraj
- 2,624
- 7
- 34
- 63
0
votes
0 answers
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 during request processing
logistic regression,…

net_95
- 1
- 2
0
votes
0 answers
How to resolve "Unable to find a shape calculator for type ''"
I have trained a XGB classifier and want to convert it into onnx model. I am using skl2onnx for this and getting below error:
Unable to find a shape calculator for type ''
Tried it resolving it after finding a…

Abhishek Gangwar
- 1,697
- 3
- 17
- 29
0
votes
2 answers
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,000 of the other class. Due to that, an advisor…

sshen
- 1
- 1
0
votes
1 answer
Using smoothed labels from 0 to 1 to train a XGB classifier
I want to train a XGB classifier using smoothed labels between 0 and 1 instead of binary labels.
The native XGB model seems to be able to accept smoothed labels for a binary classifier.
from xgboost import XGBClassifier
import numpy as np
import…

Allen Qin
- 19,507
- 8
- 51
- 67
0
votes
1 answer
xgboost with categorical data - parser error
I'm trying to train an XGBoost model which has also categorical variable. I'd like to avoid onehot encoding and I saw it is now possible using enable_categorical=True. I formatted my dataframe but when I try to generate the DMatrix I get the error…

Lu_Ste
- 21
- 6
0
votes
0 answers
XGBoost Training Logloss dropping but Validation staying steady
Im currently hyper parameter tuning my model and returning the model with the least amount of error. Before I start the hyper parameter tuning process I ensure my validation and test data is is weighted correctly by removing columns they may occur…

paddockson
- 33
- 7
0
votes
1 answer
How to solve Feature name error while converting an XGBClassifier model to ONNX?
I trained an XGBClassifier model, and now I want to convert it to an ONNX format. it should be straight forward using this code:
import onnxmltools
from skl2onnx.common.data_types import FloatTensorType
initial_types = [('float_input',…

nechi
- 92
- 10
0
votes
0 answers
xgboost feature importance for classification
I am using XGBClassifier with
GridSearchCV(cv=KFold(n_splits=5, random_state=42, shuffle=True))
I want to explore variable importance.
Why does
model.best_estimator_.feature_importances_
give different values compared to the values returned…

Vicky
- 33
- 5
0
votes
0 answers
type of feature importance in XGBoost classifier
I am using XGBClassifier with GridSearchCV(cv=KFold(n_splits=5, random_state=42, shuffle=True)). I want to explore variable importance, so I am getting it from the model.best estimator: model.best_estimator_.feature_importances_.
However, it is not…

Vicky
- 33
- 5
0
votes
0 answers
How to solve this issues "AssertionError: Must have at least 1 validation dataset for early stopping"
I am developing a propensity scorecard model in xgboost in 1.6.2 version and while running below code it gives me errors. I searched lots of relevant question on stack overflow but wasn't able to find best solution. how to change it in my code?
from…

SHESADEV SHA
- 9
- 3
0
votes
0 answers
How to structure sequential data for XGBoost Classifier model?
I want to train xgb classifier model to be able to make class predictions given specific variables entries. Nothing difficult by now. But I do want to train the model such that it observes the evolution of variables (here appears the sequential/…

Vice_99
- 1