title: Why is my logistic regression model predicting 0s only? /small sample size?
body: <p>I am building a churn prediction model with logistic regression in python. My model accuracy is 0.47 and only predicts 0s. The realized y variable is actually 81 zeros and 92 ones.</p>
  
  <p>The data set I have is only a few features and 220 users(records). If I set a reference time, it is even less(about 123 records for the training set and 173 for the testing set). So I think the sample size is too small to use logistic regression. But I still tried because this is just a sample test so I only got this small data set. (Theoretically there is more data)</p>
  
  <pre><code>from sklearn.linear_model import LogisticRegression
  
  logreg = LogisticRegression()
  logreg.fit(x_train, y_train)
  
  y_pred = logreg.predict(x_test)
  print('Accuracy: {:.2f}'.format(logreg.score(x_test, y_test)))
  </code></pre>
  
  <p>Even if I don't test the model, meaning I use the whole data set to build the model, when I predict the future churn it still returns only 0s.
  is it that my sample size is too small, or because the accuracy is less than 0.5 so it just returns one value(0 here) ? Or I did something wrong in the code?</p>
  
  <p>Thanks very much!</p>