使用SciPy/Numpy在Python中连接稀疏矩阵的最有效方法是什么?
我在这里使用了以下内容:
>>> 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)
Run Code Online (Sandbox Code Playgroud)
我想在回归中使用两个预测变量,但目前的格式显然不是我想要的.是否有可能获得以下内容:
<49998x1400000 sparse matrix of type '<class 'numpy.float64'>'
with 2271040 stored elements in Compressed Sparse Row format>
Run Code Online (Sandbox Code Playgroud)
它太大而无法转换为深层格式.