jundongl / scikit-feature

open-source feature selection repository in python
GNU General Public License v2.0
1.51k stars 447 forks source link

Dimension mismatch #48

Open ejoel-garcia opened 5 years ago

ejoel-garcia commented 5 years ago

Hello there ! hope you're doing fine.

I was just trying to use the SPEC and Laplacian Score modules to de-noise a BoW (489 docs, 7895 terms) and got the following errors:

SPEC: **File "", line 2, in spectral_fs.spec(x)

File "C:\Users\Erick Garciaoliva\Anaconda3\lib\site-packages\skfeature\function\similarity_based\SPEC.py", line 74, in spec l = LA.norm(F_hat)

File "C:\Users\Erick Garciaoliva\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 2450, in norm sqnorm = dot(x, x)

File "C:\Users\Erick Garciaoliva\Anaconda3\lib\site-packages\scipy\sparse\base.py", line 481, in mul raise ValueError('dimension mismatch')

ValueError: dimension mismatch**

LP-Score: **File "", line 1, in lapscore = LaplacianScore(x)

File "", line 35, in LaplacianScore t=np.matmul(np.matmul(Xt,D.toarray()),I)/np.matmul(np.matmul(np.transpose(I),D.toarray()),I)

ValueError: matmul: Input operand 0 does not have enough dimensions (has 0, gufunc core with signature (n?,k),(k,m?)->(n?,m?) requires 1)**

Maybe this has to do with the data type of the BoW ?