title: Accuracy issue with TF.Learn DNNClassifier and LinearClassifier
body: <p>I coded a little piece of code to find the best classifiers to fit a CDC dataset. First I tried the various scikit-learn classifiers then I decided to add the TF.Learn ones (DNNClassifier and LinearClassifier) as the API is nearly the same.</p>
  
  <p>Then when I compare the results, all scikit-learn models easily reach a 60-70% accuracy and with TF.learn DNNClassifiers and LinearClassifier I cannot do more than 38% and takes a lot of time (or even hangs if I don't set the number of steps while fitting the model).</p>
  
  <p>I probably made a mistake but I don't see it...</p>
  
  <p>Here is the code extract:</p>
  
  <pre><code>X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2)    
  
  for classifier in classifiers:
      if classifier == "TF Deep Neural Network":
          feature_columns = learn.infer_real_valued_columns_from_input(X_train)   
          clf = DNNClassifier(feature_columns=feature_columns, 
                             hidden_units=[10,10,10], 
                             n_classes=2, enable_centered_bias=None);
          clf.fit(X_train, Y_train, steps=200)
      elif classifier == "TF Linear Classifier":
          feature_columns = learn.infer_real_valued_columns_from_input(X_train)   
          clf = LinearClassifier(n_classes=2, feature_columns=feature_columns)     
          clf.fit(X_train, Y_train, steps=200)
      else:
          clf = getInstance(classifiers[classifier][0], classifiers[classifier][1], classifiers[classifier][2])
          clf.fit(X_train, Y_train)
  
  
      # predict on test data
      prediction = clf.predict(X_test)
  
      # compute accuracy and sum it to the previous ones
      accuracy = accuracy_score(Y_test, prediction)
  </code></pre>
  
  <p>Results extract:</p>
  
  <pre><code>classifier Gaussian Naive Bayes accuracy 0.85
  classifier K-Nearest Neighbors accuracy 0.87
  classifier TF Deep Neural Network accuracy 0.4
  classifier Random Forest accuracy 0.85
  classifier TF Linear Classifier accuracy 0.4
  classifier Decision Tree accuracy 0.87
  classifier Neural Network accuracy 0.4
  classifier AdaBoost accuracy 0.86
  classifier Linear Support Vector Machine accuracy 0.88
  classifier Radial Basic Function Support Vector Machine accuracy 0.74
  </code></pre>
  
  <p>Full code here: <a href="https://github.com/shazz/gender_classification_challenge/blob/master/demo_with_BRFSS_and_TF.py" rel="nofollow">https://github.com/shazz/gender_classification_challenge/blob/master/demo_with_BRFSS_and_TF.py</a></p>
  
  <p>So, any insights on why the accuracy is so low (and takes a lot of time to fit) with TF.Learn will be appreciated !</p>
  
  <p><strong>UPDATE based on Kumara's answer</strong></p>
  
  <p>I modified the labels to be 0 or 1 (and not 1 and 2 as in the original CDC dataset) and I ran the classifiers tests again. The new results are :</p>
  
  <pre><code>classifier AdaBoost accuracy 0.87 
  classifier Linear Support Vector Machine accuracy 0.86
  classifier K-Nearest Neighbors accuracy 0.86
  classifier Gaussian Naive Bayes accuracy 0.85 
  classifier Random Forest accuracy 0.85
  classifier Radial Basic Function Support Vector Machine accuracy 0.83
  classifier Decision Tree accuracy 0.83
  classifier Neural Network accuracy 0.64 
  classifier TF Deep Neural Network accuracy 0.63 
  classifier TF Linear Classifier accuracy 0.62
  </code></pre>
  
  <p>So still fairly behind the scikit learn classifiers.
  What may make sense is that the DNNClassifier is as "bad" as the scikit learn Multi-layer Perceptron classifier.</p>
  
  <p>Do you think that considering the kind of data and the classifiers, that's normal that the TF.Learn DNNClassifier and LinearClassifier don't have a good accuracy ?</p>