title: how to instantiate a Python class: meaning of ()
body: <p>What's the difference between  instantiate a class with () and without () ?</p>
  
  <p>Here is the code I am working with:</p>
  
  <pre><code>import numpy as np
  
  from sklearn.datasets.samples_generator import make_regression
  from sklearn.model_selection import train_test_split
  
  from sklearn.linear_model import LinearRegression
  
  X, y = make_regression(n_samples=100, n_features=10, n_informative=2, 
                     noise=3.0, random_state=1)
  
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25)
  </code></pre>
  
  <p>Here comes my question. I need to instantiate the class LinearRegression and when I do it like it follows, everything works fine.</p>
  
  <pre><code>model = LinearRegression()
  model.fit(X_train, y_train)
  </code></pre>
  
  <p>Instead if I do it in this other way:</p>
  
  <pre><code>model = LinearRegression
  model.fit(X_train, y_train)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>TypeError: fit() missing 1 required positional argument: 'y'
  </code></pre>
  
  <p>So I guess the problem is the missing (). What's happening exactly when I omit the () ? Is it equivalent to what follows ?</p>
  
  <pre><code>from sklearn.linear_model import LinearRegression as model 
  </code></pre>