Unable to allocate 19.6 GiB for an array with shape (39999, 65739) and data type int64

Unable to allocate 19.6 GiB for an array with shape (39999, 65739) and data type int64.sir this error is coming after converting my text data to array using CountVectorizer.now what should i do

hey @tanujvats0002_111433f919bfdb0c,
just don’t perform the .toarray() function.

use it without that.

then how will i pass my sparse matrix to naive bayed model

try directly passing that variable without converting to array