KPCA fails in SUOD model
gwgcirco opened this issue · comments
Gio Circo commented
I am trying to ensamble multiple KPCA models under the SUOD framework. Fitting a single model works as expected:
import numpy as np
from pyod.models.kpca import KPCA
from pyod.models.suod import SUOD
data = np.load('/14_glass.npz')
X, y = data['X'], data['y']
clf = KPCA()
clf.fit(X)
However, wrapping two or more models in SUOD results in an error:
model_list = [KPCA(gamma=.1), KPCA(gamma = .5)]
clf2 = SUOD(base_estimators=model_list, combination='average')
clf2.fit(X)
ValueError: Unknown kernel None
Akira Tamamori commented
Hi,
Thank you for reporting the problem.
I could also reproduce it on my environment.
Recently I sent the pull-req to resolve this problem.
I hope this fix will work on your environment.
https://github.com/tam17aki/pyod/blob/development/pyod/models/kpca.py
Best regards,
Akira