title: How to retrain logistic regression model in sklearn with new data
body: <p>How do I retrain my existing machine learning model in sklearn python?</p>
  
  <p>I have thousands of records using which I have trained my model and dumped as <code>.pkl</code> file using <code>pickle</code>.
  While training the model for the first time, I have used the <code>warmStart = True</code> parameter while creating the logistic regression object.</p>
  
  <p>Sample Code:</p>
  
  <pre><code> log_regression_model =  linear_model.LogisticRegression(warm_start = True)
   log_regression_model.fit(X, Y)
   # Saved this model as .pkl file on filesystem like pickle.dump(model,open('model.pkl', wb))
  </code></pre>
  
  <p>I want to keep this up to date with the new data I will getting daily.
  For that I am opening the existing model file and get the new data of last 24 hours and train it again./</p>
  
  <p>Sample Code:</p>
  
  <pre><code>#open the model from filesystem
  log_regression_model = pickle.load(open('model.pkl','rb'))
  log_regression_model.fit(X, Y) # New X, Y here is data of last 24 hours only. Few hundreds records only.
  </code></pre>
  
  <p>But, when I retrain model by loading it from filesystem, it seems to erase the existing model which is created with <strong>thousands</strong> of records, and create the new one with few <strong>hundreds</strong> of records from last 24 hours (model with thousands records is 3MB in size on filesystem, while new retrained model is only 67KB)</p>
  
  <p>I have tried using warmStart option.
  How do I retrain my LogisticRegression model?</p>