title: Predicted values Machine Learning Python, how do I join them back to the set?
body: <p>I am using Python for a machine learning model. I am trying to predict whether or not people will convert a membership. I Tried several models and now, one of them seems to be working well.</p>
  
  <p>Next step: I want to make predicitions with my model. The problem I encounter is that I want to see which prediction is for which person. I tried to set the PersonID as the index. I use logistic regression in this case. </p>
  
  <p>Problem is: I am not able to join the output I get from the logreg.predict method on PersonID. So I don't know what predicted value belongs to PersonID 1 and so on.</p>
  
  <p>As you might conclude from my question, I am relatively new to the subject. So any help would be great! (preferably with example using personID). In demo's I see a lot of predictions based on manual input of for example 3 values, which is not helpful for my problem. </p>
  
  <p>OK, my attempt to add code. Quite difficult, since I can not include actual data. </p>
  
  <p>I have my Logistic Regression model. I fit the model and it works. </p>
  
  <pre><code>from sklearn.linear_model import LogisticRegression
  logreg = LogisticRegression()
  logreg_scores = cross_val_score(logreg, X2, y2, cv=10, scoring='accuracy')
  print(logreg_scores)
  [ 0.99561917  0.99679079  0.99617951  0.99567011  0.99709628  0.98298523
    0.99668857  0.99556778  0.9959244   0.99347904]
  
  logreg_score = logreg_scores.mean()
  print (logreg_score)
  
  dataset2 = 
  pd.read_csv('Predict.csv', 
  index_col = 'PersonID')
  
  Outcome = logreg.predict(dataset2)
  
  csv file looks like this:
  PersonID;A;B;C;D;E;F;G;H;I;J;K;L
  153;2;4;0;38;2;2;0;1;1;1;1;0
  154;1;0;0;5;1;2;1;0;0;1;2;1
  155;1;1;0;6;2;2;1;0;0;1;22;1
  156;1;4;0;7;3;2;1;0;0;2;25;1
  157;1;4;0;64;4;2;1;1;1;3;132;0
  158;1;2;0;72;2;2;1;1;1;1;1;0
  159;1;1;0;49;2;2;1;1;1;1;56;1
  160;1;0;1;13;2;2;1;1;0;1;56;1
  161;1;0;0;67;2;2;1;1;1;1;33;0
  162;1;0;0;66;2;2;1;1;1;1;33;0
  </code></pre>