I am new in python and currently trying to develop a content based recommender system. I am reading a csv file with about 60,000 rows and using TfidfVectorizer.fit_transform which makes a matrix size (63098, 9081) and then apply linear_kernel that then crashes and returns the error RuntimeError: nnz of the result is too large.
tf = TfidfVectorizer(analyzer='word', ngram_range=(1, 3), min_df=100, stop_words='english')
tfidf_matrix = tf.fit_transform(ds['description'])
result = linear_kernel(tfidf_matrix, tfidf_matrix)
Logs shows the supposed result would be 20gb in size. Is there a way to chunk the data and how to apply that in my current structure? Thanks in advance.