%%time train_feature_vector = vectorizer.fit_transform(df_train['content_preprocessed']) train_feature_vector.shape
실행 결과
CPU times: user 12.7 s, sys: 1.22 s, total: 13.9 s Wall time: 13.9 s (3576, 2000)
시험 데이터에는 .transform() 함수를 쓴다는 점에 주의하자.
%%time test_feature_vector = vectorizer.transform(df_test['content_preprocessed']) test_feature_vector.shape
실행 결과
CPU times: user 6.38 s, sys: 135 ms, total: 6.52 s Wall time: 6.52 s (1533, 2000)