如何在Python中使用SciPy/Numpy最有效地连接稀疏矩阵?
这里我使用了以下方法:
>>> np.hstack((X, X2))
array([ <49998x70000 sparse matrix of type '<class 'numpy.float64'>'
with 1135520 stored elements in Compressed Sparse Row format>,
<49998x70000 sparse matrix of type '<class 'numpy.int64'>'
with 1135520 stored elements in Compressed Sparse Row format>],
dtype=object)
我希望在回归中使用这两个预测变量,但目前的格式显然不符合我的要求。请问是否可以得到以下格式:
<49998x1400000 sparse matrix of type '<class 'numpy.float64'>'
with 2271040 stored elements in Compressed Sparse Row format>
它太大了,无法转换为深度格式。