Diagnose and Fix StandardScaler Memory Growth on Sparse Matrices
StandardScaler(with_mean=True) can break sparsity in CSR/CSC matrices and cause sudden memory growth. Use with_mean=False and verify output type.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
StandardScaler(with_mean=True) can break sparsity in CSR/CSC matrices and cause sudden memory growth. Use with_mean=False and verify output type.
Context A directed graph with ~100k nodes and ~500k weighted edges must run PageRank (or HITS, spectral clustering) dozens of times per day. The graph lives in a NetworkX DiGraph (dict-of-dicts adjacency). Memory budget is ~2 GB. Between computation batches, a few thousand new edges are appended. Trade-off Native dict-of-dicts : each nx.pagerank(G, weight='w