title: How do I implement Naive Bayes on the following data?
body: <p>My data is in a csv file in the following form:</p>
  
  <pre><code>45,45,34,34,34,56,52,88,50,46,46,1
  
  28,26,23,22,32,36,21,18,8,28,40,0
  
  28,46,57,42,46,51,48,48,40,46,34,1
  
  11,11,11,34,17,13,11,46,11,33,40,0
  
  42,36,46,32,28,51,48,56,38,46,40,1
  </code></pre>
  
  <p>and so on. </p>
  
  <p>I am trying to use a binary classifier where it can classify the data given as input as shown in the first 11 columns and the 12th column represents an acceptance(1) or rejection(0). I am using the pandas, numpy modules of python. How can I implement a Naive Bayes on the data? </p>
  
  <p>I am getting a data conversion error:</p>
  
  <pre><code> ValueError: could not convert string to float
  </code></pre>
  
  <p>Here is my code so far:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from sklearn.cross_validation import train_test_split
  from sklearn.naive_bayes import GaussianNB
  from sklearn.metrics import accuracy_score
  
  df = pd.read_csv(r'file.csv')
  features=df.values[:,:11]
  target=df.values[:,12]
  
  features_train, features_test, target_train, target_test = 
  train_test_split(features, target, test_size = 0.33, random_state = 10)
  
  clf=GaussianNB()
  clf.fit(features_train, target_train)
  target_pred = clf.predict(features_test)
  </code></pre>