title: Use attribute and target matrices for TensorFlow Linear Regression Python
body: <p>I'm trying to follow <a href="http://www.tensorflow.org/tutorials/mnist/beginners/index.md" rel="noreferrer">this tutorial</a>.</p>
  
  <p>TensorFlow just came out and I'm really trying to understand it.  I'm familiar with <em>penalized linear regression</em> like Lasso, Ridge, and ElasticNet and its usage in <code>scikit-learn</code>.  </p>
  
  <p>For <code>scikit-learn</code> Lasso regression, all I need to input into the regression algorithm is <code>DF_X</code> [an M x N dimensional attribute matrix (pd.DataFrame)] and <code>SR_y</code> [an M dimensional target vector (pd.Series)].  The <code>Variable</code> structure in TensorFlow is a bit new to me and I'm not sure how to structure my input data into what it wants. </p>
  
  <p>It seems as if softmax regression is for classification.  <strong>How can I restructure my <code>DF_X</code> (M x N attribute matrix) and <code>SR_y</code> (M dimensional target vector) to input into <code>tensorflow</code> for linear regression?</strong> </p>
  
  <p>My current method for doing a Linear Regression uses pandas, numpy, and sklearn and it's shown below. I think this question will be really helpful for people getting familiar with TensorFlow:</p>
  
  <pre><code>#!/usr/bin/python
  import pandas as pd
  import numpy as np
  import tensorflow as tf
  from sklearn.linear_model import LassoCV
  
  #Create DataFrames for attribute and target matrices
  DF_X = pd.DataFrame(np.array([[0,0,1],[2,3,1],[4,5,1],[3,4,1]]),columns=["att1","att2","att3"],index=["s1","s2","s3","s4"])
  SR_y = pd.Series(np.array([3,2,5,8]),index=["s1","s2","s3","s4"],name="target")
  
  print DF_X
  #att1  att2  att3
  #s1     0     0     1
  #s2     2     3     1
  #s3     4     5     1
  #s4     3     4     1
  
  print SR_y
  #s1    3
  #s2    2
  #s3    5
  #s4    8
  #Name: target, dtype: int64
  
  #Create Linear Model (Lasso Regression)
  model = LassoCV()
  model.fit(DF_X,SR_y)
  
  print model
  #LassoCV(alphas=None, copy_X=True, cv=None, eps=0.001, fit_intercept=True,
  #max_iter=1000, n_alphas=100, n_jobs=1, normalize=False, positive=False,
  #precompute='auto', random_state=None, selection='cyclic', tol=0.0001,
  #verbose=False)
  
  print model.coef_
  #[ 0.         0.3833346  0.       ]
  </code></pre>