2

I'm building ensemble such as Voting using SKlearn and Stacking using brew. However, I Keras wrapper doesn't work correctly.

Building the Voting classifier I receive when one of the elements if KerasClassifier gives me folowing error:

TypeError: cannot create 'sys.flags' instances

Building Stacking classifier I'm getting:

AttributeError: 'Sequential' object has no attribute 'classes_'

How could I use Keras with ensembles? Do I have to change framework?

4

1 回答 1

0

尝试KerasClassifierCalibratedClassifierCV这样的对象包装对象:

from sklearn.calibration import CalibratedClassifierCV
model = CalibratedClassifierCV(KerasClassifier(...))

从此答案中引用。

于 2019-11-14T16:50:54.813 回答