title: Always Probability of Hundred Percent: predict_proba, sklearn
body: <p>I'm using Python's <strong>sklearn</strong> to classify texts.</p>
  
  <p>I call the function <code>predict_proba</code> and it looks like this:</p>
  
  <pre><code>[[  6.74918834e-53   1.59981248e-51   2.74934762e-26   1.24948745e-43
      2.93801753e-48   3.43788315e-18   1.00000000e+00   2.96818867e-20]]
  </code></pre>
  
  <p>And even if I try to put in ambiguity data, it looks always like this.
  It doesn't seem probable to me that the classfier is always hundred percent sure, so what's the problem there?</p>
  
  <p>At the moment I'm using the <strong>MultinomialNB</strong> classifier and it's about <strong>text classification</strong>. I'm using <strong>news paper articles</strong> with classes like <strong>sports</strong>, <strong>economy</strong> etc. to train my model. The size of training examples is 175, distributed like this:</p>
  
  <pre><code>    {'business': 27,
       'economy': 20,
       'lifestyle': 22,
       'opinion': 11,
       'politics': 30,
       'science': 21,
       'sport': 21,
       'tech': 23}
  </code></pre>
  
  <p>My pipeline looks like this and my features are mainly <strong>bag-of-words</strong> and some linguistic key figures like text length.</p>
  
  <pre><code>cv = CountVectorizer(min_df=1, ngram_range=(1,1), max_features=1000)
  tt = TfidfTransformer()
  lv = LinguisticVectorizer() # custom class
  clf = MultinomialNB()
  
  pipeline = Pipeline([
  ('features', FeatureUnion([
    ('ngram_tf_idf', Pipeline([
      ('counts', cv),
      ('tf_idf', tt),
    ])),
  ('linguistic', lv),
  ])),
   ('scaler', StandardScaler(with_mean=False)),
   ('classifier', clf)
  ])
  </code></pre>
  
  <p>If you want to take a look at my training examples, I've uploaded it there: <a href="https://wetransfer.com/downloads/b17db309de53a565282e111f524b06dd20161122185544/5d690042d67665666492c8d4433a8b4f20161122185544/88249b" rel="nofollow noreferrer">wetransfer.com</a></p>
  
  <p><strong>UPDATE:</strong> Maybe it is worth mentioning that the current setup scores 0.67 on the test samples. But before using the <code>StandardScaler</code>, the probabilities was distributed more realistic (i.e. not always 100 percent) – but it scored only 0.2. </p>
  
  <p><strong>UPDATE:</strong> After adding a <code>MaxAbsScaler</code> in the pipeline, it seems to work correctly. Can someone explain this weird behaviour? </p>