FutureWarning: np.matrix usage is deprecated in 1.0 and will raise a TypeError in 1.2. Please convert to a numpy array with np.asarray. For more information see
用sklearn库写了最小二乘,但是python报了上述提示性错误
这是由于sklearn调用了numpy,此错误可以忽略
from sklearn import linear_model
model = linear_model.LinearRegression()
model.fit(X, y)
**用这个来关掉报错**
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)