title: ValueError: Expected 2D array, got 1D array instead. Training model
body: <p>i want to train 12 models for my sentiment analysis since i have 4 aspects and 3 polarities (positive, neutral, negative). but i got error like this</p>
  
  <pre><code>ValueError: Expected 2D array, got 1D array instead:
  array=[].
  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>i updated my code in here to make it more clear,
  here is my code:</p>
  
  <pre><code>fix = []
  for review in dump:
      review['text'] = prep(review['text'])
      temp = {}
      temp['text'] = review['text']
  fix.append(temp)
  
  count_vec = []
  def count_ngram(index, numb, wrd):
  if numb&gt;ngram:
      return
  new_word= ""
  for elem in word_list[index]:
      if len(wrd)&gt;0:
          new_word = elem+" "+wrd
      else:
          new_word = elem
      if index&gt;0 and numb&lt;ngram:
          count_ngram(index-1, numb+1, new_word)
      if new_word in vec_index:
          count_vec[vec_index[new_word]]+= 1
  
  for elem in fix:
      count_vec = [0]*features
      words = elem['text'].split()
      word_list = []
      for word in words:
          word_set = set()
          length = len(word)
          word_set.add(word)
          word_list.append(word_set)
      l = len(word_list)
      for i in range(l):
          count_ngram(i, 1, "")
      elem['vec'] = count_vec
  
  x_data=[[],[],[],[],[],[],[],[],[],[],[],[],[]]
  y_data=[[],[],[],[],[],[],[],[],[],[],[],[],[]]
  
  def check(a):
      x_data[a].append(elem['vec'])
      if elem[str(a)]&gt;0:
          x_data[4+a].append(elem['vec'])
          if elem[str(a)]&gt;1:
             y_data[4+a].append(1)
          else:
             y_data[4+a].append(0)
          y_data[a].append(1)
      else:
        y_data[a].append(0)
  for elem in fix:
      for i in range(4):
          check(i+1)
  
  for i in range(12):
      model=svm.SVC(kernel='linear')
      print("training",i+1)
      model.fit(x_data[i+1],y_data[i+1])
  </code></pre>
  
  <p>is there anything wrong with the way i make the model? originally this code was made for making 8 models. so, instead of </p>