title: SciKit Learn: TypeError: fit() missing 1 required positional argument: 'y' while initializing constructor properly with ()
body: <p>I'm trying to use SciKit Learn's linear regression to analyze a dataset. My dataset is a csv file with data and a row of labels. My code is as follows:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  from sklearn import linear_model
  
  data = pd.read_csv('temp.csv')
  
  reg = linear_model.LinearRegression()
  reg.fit(data)
  </code></pre>
  
  <p>When I run this code, I get the error: <code>TypeError: fit() missing 1 required positional argument: 'y'</code></p>
  
  <p>Other programmers with this error seem to have generally not properly initialized the model (by leaving out the parentheses for the default constructor) however I have the parentheses and I pulled my initialization statement directly from an sklearn example. Thus, I'm not really sure what's wrong. </p>
  
  <p>While I have done a reasonable amount of machine learning model work in the past, I exclusively used TensorFlow. I'm now working with a group that uses SciKit learn, but my low experience with it means that this could be a very simple error that I'm overlooking!</p>