I have 4 sparse matrixes with following dimensional:
X_train_content_sparse.shape
(62313, 100000)
X_train_title_sparse.shape
(62313, 100000)
X_train_author_sparse.shape
(62313,31540)
X_train_time_features_sparse.shape
(62313, 7)
And then I stack arrays in sequence horizontally.
X_train_sparse = hstack([X_train_content_sparse, X_train_title_sparse,
X_train_author_sparse, X_train_time_features_sparse])
After that I transform this array of sparse matrixes into a sparse matrix.
I apply csr_matrix(X_train_sparse)
and I receive such error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
>X_train_sparse
array([ <62313x100000 sparse matrix of type '<class 'numpy.float64'>'
with 68519885 stored elements in Compressed Sparse Row format>,
<62313x100000 sparse matrix of type '<class 'numpy.float64'>'
with 795892 stored elements in Compressed Sparse Row format>,
<62313x31540 sparse matrix of type '<class 'numpy.uint8'>'
with 62313 stored elements in Compressed Sparse Row format>,
<62313x7 sparse matrix of type '<class 'numpy.int64'>'
with 176241 stored elements in Compressed Sparse Row format>], dtype=object)