title: Python/Scikit-learn - How to actually predict?
body: <p>I have the following DataFrame, which I call main_frame:</p>
  
  <pre><code>               Value     Value      1lag      2lag      3lag      4lag 
  Date                                                                     
  2005-04-01  0.824427  0.892308  1.000000  0.000000  0.000000  0.000000   
  2005-05-01  0.778626  0.953846  0.892308  1.000000  0.000000  0.000000   
  2005-06-01  0.717557  1.000000  0.953846  0.892308  1.000000  0.000000   
  2005-07-01  0.725191  0.000000  1.000000  0.953846  0.892308  1.000000   
  2005-08-01  0.717557  1.000000  0.000000  1.000000  0.953846  0.892308   
  2005-09-01  0.740458  0.861538  1.000000  0.000000  1.000000  0.953846   
  2005-10-01  0.732824  0.877193  0.861538  1.000000  0.000000  1.000000   
  2005-11-01  0.732824  1.000000  0.877193  0.861538  1.000000  0.000000   
  2005-12-01  0.641221  1.000000  1.000000  0.877193  0.861538  1.000000   
  2006-01-01  0.709924  0.614035  1.000000  1.000000  0.877193  0.861538   
  2006-02-01  0.770992  0.649123  0.614035  1.000000  1.000000  0.877193   
  </code></pre>
  
  <p>I've built the following model:</p>
  
  <pre><code>predictor=main_frame.iloc[:,1:]
  target=main_frame.iloc[:,0]
  
  model=LinearRegression()
  model.fit(X=predictor,y=target)
  </code></pre>
  
  <p>I know that to predict, I should use now model.predict(), however I'm having a hard time to understand how does the arguments of the predict function work. I'm trying to use:</p>
  
  <pre><code>prediction=model.predict(target)
  print predict
  </code></pre>
  
  <p>But that keeps getting me an error, I believe that I'm misunderstanding something related to the argument.</p>
  
  <p>How do I set up the command for the prediction to work?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm adding the Traceback</p>
  
  <pre><code>/Library/Python/2.7/site-packages/sklearn/utils/validation.py:386:     DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and willraise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.
  DeprecationWarning)
  Traceback (most recent call last):
  File "/Users/file.py", line 61, in &lt;module&gt;
  prediction=model.predict(target)
  File "/Library/Python/2.7/site-packages/sklearn/linear_model/base.py", line 200, in predict
  return self._decision_function(X)
  File "/Library/Python/2.7/site-packages/sklearn/linear_model/base.py", line 185, in _decision_function
  dense_output=True) + self.intercept_
  File "/Library/Python/2.7/site-packages/sklearn/utils/extmath.py", line 184, in safe_sparse_dot
  return fast_dot(a, b)
  ValueError: shapes (1,127) and (144,) not aligned: 127 (dim 1) != 144 (dim 0)
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Trying to put my question in other words so it gets better to be answered:</p>
  
  <blockquote>
    <p>Considering the above model, how do I find out what is going to be the predicted value for the next period for the target variable?</p>
  </blockquote>