(Since the question is almost inexperienced, there may be some inadequacies in the way you ask ...
〇 Question content In Python, for example rgs=linear_model.LinearRegression() Is the understanding that declares an object called rgs. What does the last () mean?
〇 Background
from sklearn import linear_model rgs=linear_model.LinearRegression rgs.fit(train_X, train_Y) print(rgs.coef_) print(rgs.intercept_)
I wrote the code, and the following error occurred.
TypeError Traceback (most recent call last)
TypeError: fit() missing 1 required positional argument: 'y'
In conclusion, the second line of code rgs=linear_model.LinearRegression() If so, no error occurred and the correct result was obtained, but I'm not sure why it happened ... I'm sorry that the question is hard to see, but I would appreciate it if you could answer! Thank you.
Recommended Posts