title: How to give Word2Vec vector to classifier in python?
body: <p>my code in python is for multi-label classifying; using TF-IDF vectorizer for a bunch of tweets. i just put the corresponding part of the code below. my vocab is a 14182 words lexicon and the train_array.shape is (6838,14182). also the train_labels.shape is (6838, 11):</p>
  
  <pre><code>#Vectorizing
  vector_maker = TfidfVectorizer(stop_words= set(stopwords.words('english')), vocabulary= vocab) #Vectorizer
  train_array = vector_maker.fit_transform(train_tweets).toarray() #Making vector for train tweets
  test_array = vector_maker.fit_transform(test_tweets).toarray() #Making vector for test tweets
  
  clf = tree.DecisionTreeClassifier()
  clf.fit(train_array,train_labels)
  predicted= clf.predict(test_array)
  print("Accuracy = ",accuracy_score(test_gold_labels,predicted))
  </code></pre>
  
  <p>the code works well. now i want to use Word2Vec as vectorizer. i changed the code to:</p>
  
  <pre><code>#Vectorizing 
  vector_maker = Word2Vec(vocab, size=50, window=5, min_count=1, workers=8) #Vectorizer
  train_array = vector_maker.train(train_tweets, total_examples=vector_maker.corpus_count, epochs=15) #Making vector for train tweets
  test_array = vector_maker.train(test_tweets, total_examples=vector_maker.corpus_count, epochs=15) #Making vector for test tweets
  
  clf = tree.DecisionTreeClassifier()
  clf.fit(train_array,train_labels)
  predicted= clf.predict(test_array)
  print("Accuracy = ",accuracy_score(test_gold_labels,predicted))
  </code></pre>
  
  <p>then i get this error:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-8-3977a56bf1df&gt; in &lt;module&gt;
       71 #clf = RandomForestClassifier()
       72 clf = tree.DecisionTreeClassifier()
  ---&gt; 73 clf.fit(train_array,train_labels)
       74 predicted= clf.predict(test_array)
       75 print("Accuracy = ",accuracy_score(test_gold_labels,predicted))
  
  ~\Anaconda3\lib\site-packages\sklearn\tree\tree.py in fit(self, X, y, sample_weight, check_input, X_idx_sorted)
      814             sample_weight=sample_weight,
      815             check_input=check_input,
  --&gt; 816             X_idx_sorted=X_idx_sorted)
      817         return self
      818 
  
  ~\Anaconda3\lib\site-packages\sklearn\tree\tree.py in fit(self, X, y, sample_weight, check_input, X_idx_sorted)
      128         random_state = check_random_state(self.random_state)
      129         if check_input:
  --&gt; 130             X = check_array(X, dtype=DTYPE, accept_sparse="csc")
      131             y = check_array(y, ensure_2d=False, dtype=None)
      132             if issparse(X):
  
  ~\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
      519                     "Reshape your data either using array.reshape(-1, 1) if "
      520                     "your data has a single feature or array.reshape(1, -1) "
  --&gt; 521                     "if it contains a single sample.".format(array))
      522 
      523         # in the future np.flexible dtypes will be handled like object dtypes
  
  ValueError: Expected 2D array, got 1D array instead:
  array=[1249397. 9119055.].
  Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
  </code></pre>
  
  <p>then i find out that train_array isn't a array. i mean i find out that for getting trained vectors of Word2Vec you should use vector_maker.wv.vectors. but first i tried this to see the vectors dimension:</p>
  
  <pre><code>print(vector_maker.wv.vectors.shape)
  </code></pre>
  
  <p>but i get (30, 50). shouldn't i get (6838,50)? or what? actually i don't know so much about how Word2Vec works. i read many but didn't get so much. 
  can you guys tell me what should i do to use created vectors for classifying?</p>