You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I use ngboost and sklearn, ngboost return a error:
AttributeError: 'NGBClassifier' object has no attribute 'classes_'
I have checked the lightGBM, it has the 'classes_', so I dont know how can I solve this problem, I need some help.
my code is as follows:
Can you include what version you are using and provide a full example code with imports and loading a sample data like the Boston data?
Thanks for your reply! I have rewritten a function to replace cross validation in sklearn using the 'roc_auc' to train my model, I have achieved the expected results.
when I use ngboost and sklearn, ngboost return a error:
AttributeError: 'NGBClassifier' object has no attribute 'classes_'
I have checked the lightGBM, it has the 'classes_', so I dont know how can I solve this problem, I need some help.
my code is as follows:
model = NGBClassifier(n_estimators=int(params['n_estimators'])
, learning_rate=params['learning_rate']
, minibatch_frac=params['minibatch_frac']
, col_sample=params['col_sample']
, Dist=Bernoulli
, verbose=False
, random_state=42)
cv = StratifiedKFold(n_splits=10, shuffle=True, random_state=42)
score = -cross_val_score(model, X_train, y_train.ravel(), cv=cv, scoring='roc_auc_ovo_weighted', error_score='raise').mean()### ###
The text was updated successfully, but these errors were encountered: