# Scaling sparse data for PCA

Not sure how I should interpret the scaling. Is it correct to convert the sparse matrix to a dense matrix by padding with 0's and scale normally?

• What are you trying to do? – mathreadler Mar 13 '19 at 7:13

Assuming you are doing feature scaling: method to limit the range of variables so that they can be compared on common grounds. I'm not sure about what you are looking here. If the matrix is small, you can densify it with X.toarray(). If the matrix is large, then this will probably blow your RAM. Remember that: PCA(X) is SVD(X-mean(X)). Even If X is a sparse matrix, X-mean(X) is always a dense matrix.