viisar / brew

⛔️ DEPRECATED brew: Python Ensemble Learning API
MIT License
301 stars 70 forks source link

fixed IndexError that arises by using c.classes_ as np index in base.py #28

Open whitmera opened 7 years ago

whitmera commented 7 years ago

Brew threw an Index Error at line 189 in base.py. 187 if mode == 'probs': 188 probas = np.zeros((X.shape[0], nclasses)) --> 189 probas[:, list(c.classes)] = c.predict_proba(X) 190 out[:, :, i] = probas 191

IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

It looks like it i trying to use floats as column indices for probas. this could be resolved by making change list(c.classes_) to list(c.classes.astype(int)) but I don't see the need to pre-create probas.