tsterbak / kernel_eca

Scikit-learn compatible Kernel Entropy Component Analysis in Python
BSD 3-Clause "New" or "Revised" License
13 stars 9 forks source link

NotFittedError: This KernelCenterer instance is not fitted yet #2

Open indrajitsg opened 5 years ago

indrajitsg commented 5 years ago

I am trying to run this simple code to perform Kernel ECA on a numpy array:

import numpy as np
from kernel_eca import KernelECA

x1 = np.random.rand(100, 60)
x2 = np.random.rand(100, 60)

kr_eca = KernelECA(n_components=20, kernel='poly', degree=3, 
                   eigen_solver='auto', random_state=74292)

x1_keca = kr_eca.fit_transform(x1)
x2_keca = kr_eca.transform(x2)

The last step of applying the transform throws this error: NotFittedError: This KernelCenterer instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.

Please let me know what could be causing this.

Regards, Indrajit