2014-01-29 3 views
0

나는 scikit-learn training의 특징으로 나중에 사용하기 위해 빠르고 효율적인 방법으로 1xN 행렬을 기반으로 행렬을 만들려고합니다. 내가 지금까지 노력했습니다 많은 것들 중 하나입니다작은 행렬을 기반으로 행렬을 만들려면 어떻게해야합니까?

matrix([[ <1x188796 sparse matrix of type '<type 'numpy.float64'>' 
    with 10921 stored elements in Compressed Sparse Row format>, 
     <1x188796 sparse matrix of type '<type 'numpy.float64'>' 
    with 17651 stored elements in Compressed Sparse Row format>, 
     <1x188796 sparse matrix of type '<type 'numpy.float64'>' 
    with 28180 stored elements in Compressed Sparse Row format>,... 

정말없는 내가 분명히, 무엇을 찾고 있어요 :이 같은 행렬의 행렬을 생성

np.matrix(list(func(text) for text in data_test.data)) 

. 어떻게 같은 더 적절한 매트릭스에이를 수 있습니다 : 그것은 너무 느린 경우, 여기에서 빠른 경로를 거치게하는 방법에 대한 http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.sparse.vstack.html

<76002x108800 sparse matrix of type '<type 'numpy.float64'>' 
with 807960 stored elements in Compressed Sparse Row format> 
+0

func의 정의는 무엇입니까? –

+0

@AndyHayden '1x188796' "형식의 희소 행렬을 반환하는 사용자 지정 함수입니다. 제가 결합하고자하는 행렬입니다. –

답변

관련 문제