title: How to improve accuracy of naive bayes
body: <p>I am using below code </p>
  
  <pre><code>import pandas as pd
  from sklearn.model_selection import train_test_split
  import numpy as np
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.feature_extraction.text import TfidfTransformer
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.pipeline import Pipeline
  
  data = pd.read_csv("severeinjury.csv",error_bad_lines=False)
  numpy_array = data.as_matrix()
  X = numpy_array[:,15]
  Y = numpy_array[:,17]
  
  X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=.2, random_state=67)
  ##print(list(X_train))
  text_clf = Pipeline([('vect', CountVectorizer(stop_words='english')), ('tfidf', TfidfTransformer()), ('clf', MultinomialNB()),])
  #text_clf = text_clf.fit(list(X_train),list(Y_train))
  text_clf = text_clf.fit(X_train,Y_train)
  predicted = text_clf.predict(X_test)
  accuracy=np.mean(predicted == Y_test)
  print(accuracy)
  </code></pre>
  
  <p>And getting the accurecy .55 i have tried tuning it with changing parameter as well but no luck data is like:</p>
  
  <pre><code>X =[ "Three correctional facility guards were escorting a restrained federal prison inmate when he became disruptive, requiring the use of force. \nTwo guards and the inmate fell onto the Lieutenant's right leg, fracturing his fibula. He was transported to the hospital and released the following day."
   'Employee in the Machine Shop received second degree burns to the back of his legs after the torch he was using exploded.'
   'A truck driver fell approximately 4 feet while descending a tanker trailer ladder.  The employee was kept overnight awaiting test results.'
   ...,
   "An employee was walking down a flight of three stairs from the client's home into their garage when she missed the last step and fell. She was hospitalized for a fractured tibia and fibula."
   'An employee was hospitalized for carbon monoxide poisoning while working at a construction site.'
   "An employee was cutting the strapping on a bundle of steel square tubing. The bundle was approximately waste high and stacked on top of other material cribbed by 4'x 4' lumber. The bundle fell onto the employee when the last retaining band was cut breaking the employee's right leg."]
  </code></pre>
  
  <p>And</p>
  
  <pre><code>Y is :['Fractures' 'Second degree heat (thermal) burns'
       'Traumatic injuries and disorders, unspecified' ..., 'Fractures'
       'Poisoning, including poisoning-related asphyxia' 'Fractures']
  </code></pre>
  
  <p>Original data can be found on internet <a href="https://www.osha.gov/severeinjury/index.html" rel="nofollow noreferrer">https://www.osha.gov/severeinjury/index.html</a>
  I am a new bee in text analytics so any example will be more helpful in order to improve accuracy.</p>