code :
import numpy
from matplotlib.mlab import PCA
file_name = "store1_pca_matrix.txt"
ori_data = numpy.loadtxt(file_name,dtype='float', comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0)
result = PCA(ori_data)
this is my code. though my input matrix is devoid of the nan and inf, i do get the error stated below.
raise LinAlgError("SVD did not converge") LinAlgError: SVD did not converge
what's the problem?
This can happen when there are inf or nan values in the data.
Use this to remove nan values:
ori_data.dropna(inplace=True)