代码苦手,在使用sklearn中LinearRegression时,若直接使用
LinearRegression().fit(x_train,y_train)
则会报错This LinearRegression instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
若是先行将LinearRegression()定义为其他,如
houselr = LinearRegression()
houselr.fit(x_train,y_train)
则不会出现该状况,这是为什么呢?