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

I am using Python to do cosine similarity.similarity_matrix = cosine_similarity(tfidf_matrix)The probl

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745631440a4637134.html

相关推荐

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

    I am using Python to do cosine similarity.similarity_matrix = cosine_similarity(tfidf_matrix)The probl

    9小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信