title: Value error when running sklearn classifier model
body: <p>I'm quite new to sklearn , and I'm trying to build a simple text classifier using scikit , but running into ValueError . It shows the error at <code>fit()</code> , but other tutorials are using it as it is and it runs fine.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>from sklearn.datasets import fetch_20newsgroups
  from sklearn.cross_validation import train_test_split
  from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.pipeline import Pipeline
  from sklearn.naive_bayes import MultinomialNB
  
  news = fetch_20newsgroups(subset='all')
  print len(news.data)
  
  
  
  def train(classifier , X , y):
          X_train , y_train , X_test , y_test = train_test_split(X,y,test_size =            0.20, random_state = 33)
          classifier.fit(X_train ,y_train)
          print "Accuracy %s" % classifier.score(X_test , y_test)
          return classifier
  
  model1 = Pipeline([('vectorizer' , TfidfVectorizer()),('classifier' , MultinomialNB()),])
  
  train(model1 , news.data , news.target)
  </code></pre>
  
  <p>When running it , I'm getting a value error</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/padam/Documents/git/ticketClassifier/news.py", line 30, in &lt;module&gt;
      train(model1 , news.data , news.target)
    File "/home/padam/Documents/git/ticketClassifier/news.py", line 24, in train
      classifier.fit(X_train ,y_train)
    File "/usr/lib/python2.7/dist-packages/sklearn/pipeline.py", line 165, in fit
      self.steps[-1][-1].fit(Xt, y, **fit_params)
    File "/usr/lib/python2.7/dist-packages/sklearn/naive_bayes.py", line 527, in fit
      X, y = check_X_y(X, y, 'csr')
    File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 520, in check_X_y
      check_consistent_length(X, y)
    File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 176, in check_consistent_length
      "%s" % str(uniques))
  ValueError: Found arrays with inconsistent numbers of samples: [ 3770 15076]
  </code></pre>
  
  <p>What does it mean by inconsistent number of samples . Other stackoverflow solutions suggest rearranging the matrix for numpy matrix . But I did not use numpy.
  Thanks!</p>