IndexError Traceback (most recent call last)
Cell In [12], line 9
2 import ngboost as ng
3 model = ng.NGBClassifier(n_estimators=1000,
4 learning_rate=0.01,
5 verbose=True,
6 verbose_eval=200
7 )
----> 9 model.fit(x_train_ngb, y_train_ngb)
11 y_valid_predict_ngb = model.predict_proba(x_valid_ngb)[:,1]
12 y_valid_predict_ngb = pd.Series(y_valid_predict_ngb)
File D:\py\Anaconda3\lib\site-packages\ngboost\ngboost.py:310, in NGBoost.fit(self, X, Y, X_val, Y_val, sample_weight, val_sample_weight, train_loss_monitor, val_loss_monitor, early_stopping_rounds)
306 self.col_idxs.append(col_idx)
308 D = self.Manifold(P_batch.T)
--> 310 loss_list += [train_loss_monitor(D, Y_batch, weight_batch)]
311 loss = loss_list[-1]
312 grads = D.grad(Y_batch, natural=self.natural_gradient)
File D:\py\Anaconda3\lib\site-packages\ngboost\ngboost.py:293, in NGBoost.fit..(D, Y, W)
290 best_val_loss = np.inf
292 if not train_loss_monitor:
--> 293 train_loss_monitor = lambda D, Y, W: D.total_score( # NOQA
294 Y, sample_weight=W
295 )
297 if not val_loss_monitor:
298 val_loss_monitor = lambda D, Y: D.total_score( # NOQA
299 Y, sample_weight=val_sample_weight
300 ) # NOQA
File D:\py\Anaconda3\lib\site-packages\ngboost\scores.py:6, in Score.total_score(self, Y, sample_weight)
5 def total_score(self, Y, sample_weight=None):
----> 6 return np.average(self.score(Y), weights=sample_weight)
File D:\py\Anaconda3\lib\site-packages\ngboost\distns\categorical.py:12, in CategoricalLogScore.score(self, Y)
11 def score(self, Y):
---> 12 return -np.log(self.probs[Y, range(len(Y))])
IndexError: arrays used as indices must be of integer (or boolean) type