title: Different predictive models giving identical results? Python 2.x to 3.x issue?
body: <p>I'm working on an online course and used the provided code to create two different predictive models. I played around with them a bit to see if I can get different results, which went fine.</p>
  
  <p>My concern is why they are giving me identical accuracy and cross validation scores.</p>
  
  <p>Logit Regression:
  <a href="https://i.stack.imgur.com/CAOjf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CAOjf.png" alt="Logit Regression"></a></p>
  
  <p>Decision Tree:
  <a href="https://i.stack.imgur.com/TnZQc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TnZQc.png" alt="Decision Tree"></a>
  I've provided a snippet of code below, as well as the function for classification that I took from python 2.x code. Currently, I am working with python 3.x and 0.17.1 of scikit-learn.</p>
  
  <pre><code># import models from scikit-learn 
  from sklearn.linear_model import LogisticRegression
  from sklearn.cross_validation import KFold # for K-fold cross validation
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.tree import DecisionTreeClassifier, export_graphviz
  from sklearn import metrics
  
  # generic fxn for making classification model and processing accessing performance
  def classification_model(model, data, predictors, outcome):
      model.fit(data[predictors], data[outcome]) # fit model
      predictions = model.predict(data[predictors]) # make predictions on training set
  
      # print accuracy
      accuracy = metrics.accuracy_score(predictions, data[outcome])
      print("Accuracy: %s" % "{0:.3%}".format(accuracy))
  
      # k-fold cross validatiom, 5 folds
      kf = KFold(data.shape[0], n_folds = 5)
      error = []
      for train, test in kf:
          train_predictors = (data[predictors].iloc[train,:]) # filter training data
          train_target = data[outcome].iloc[train]
          model.fit(train_predictors, train_target)
  
          # record error from each run
          error.append(model.score(data[predictors].iloc[test,:], data[outcome].iloc[test]))
  
          print("Cross-Validation Score: %s" % "{0:.3%}".format(np.mean(error)))
  
          # fit model (again) so it can be referred to outside fxn
          model.fit(data[predictors], data[outcome])
  </code></pre>
  
  <p>Am I using outdated parameter names? Or is there something wrong with the classifier function?</p>
  
  <p>I currently am not getting any errors from the code that I'm running but getting the exact same accuracy and cross validation scores is concerning.</p>