最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to reduce the size of Numpy data type - Stack Overflow

programmeradmin1浏览0评论

I am using Python to do cosine similarity.

similarity_matrix = cosine_similarity(tfidf_matrix)

The problem is that I am getting this error

MemoryError: Unable to allocate 44.8 GiB for an array with shape (6011226750,) and data type float64

I don't think I need float64 for this operation as 2 digits after the decimal point should be enough.

Is there a way I can change the cosine_similarity data type to a smaller one?

发布评论

评论列表(0)

  1. 暂无评论