 # Understanding fit() method in LinearRegression function

Hey everyone. Im not fully understand the puprose of `.fit()` method in LinearRegression function:
" You can first create a `LinearRegression` model, and then fit it to your `x` and `y` data:

``````line_fitter = LinearRegression()
line_fitter.fit(X, y)
``````

The `.fit()` method gives the model two variables that are useful to us:

1. the `line_fitter.coef_` , which contains the slope
2. the `line_fitter.intercept_` , which contains the intercept"

Also why do we use Uppercase “X” and lowercase “y” ?

as far i know you can assign your X as you want you can make it small x as well basically in any model X represent our data that we will feed to the model (input / independent variable of data ) and y is our dependent data on x .
like . – I want to predict price of bike so (price is my y) and rest of data will be my X(bike_model, Horse_power , Petrol_capacity ,bike_speed) becouse these things will affect the price of bike so price is dependent on these factor .
i hope it helps .
Thanks

the most important question what does `.fit()` do?