Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use XGBRegressor? #95

Open
hanzigs opened this issue Nov 23, 2022 · 5 comments
Open

Can we use XGBRegressor? #95

hanzigs opened this issue Nov 23, 2022 · 5 comments
Labels
question Further information is requested

Comments

@hanzigs
Copy link

hanzigs commented Nov 23, 2022

Hi,
The scorecard function param says "model: A LogisticRegression model object."
image

can we use any regression model. like XGBRegressor with 'gblinear' booster?

@ShichenXie
Copy link
Owner

Support sklearn lr model object only.

@hanzigs
Copy link
Author

hanzigs commented Nov 23, 2022

Thanks for the reply,

Actually any linear model with coefficient attribute is working including xgb linear, like

model.coef_

I have tried these

from xgboost import XGBRegressor
xgb_fit = XGBRegressor(booster='gblinear')
xgb_model = xgb_fit.fit(X_train, y_train)
xgb_model.coef_

from sklearn.linear_model import LogisticRegression
lr_fit = LogisticRegression()
lr_model = lr_fit.fit(X_train, y_train)
lr_model.coef_

from sklearn.linear_model import SGDRegressor
SGD_fit = SGDRegressor()
SGD_model = SGD_fit.fit(X_train, y_train)
SGD_model.coef_

All these models can generate scorecard using scorecard function

card = scorecard(train_bins, lr_model, training_fields)

Thanks

@autogluonisgod
Copy link

'TabularPredictor' object has no attribute 'coef_', I want t ues autogluon to remould this scordcard,but this error is happen. So how should I do to solve this ?

@autogluonisgod
Copy link

'TabularPredictor' object has no attribute 'coef_', I want t ues autogluon to remould this scordcard,but this error is happen. So how should I do to solve this ?

@ShichenXie
Copy link
Owner

A new function scorecard2 is introduced, which requires binning from woebin function and x variable only.

@ShichenXie ShichenXie added the question Further information is requested label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants