人工智能项目遇到的错误汇总(持续更新)
-
/anaconda3/envs/mlenvment/lib/python3.7/site-packages/sklearn/model_selection/_split.py:2069: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.
FutureWarning)
解决办法:加入test_size参数 x_train,x_test,y_train,y_test = train_test_split(X,Y,train_size= 0.8,test_size=0.2,random_state=28) -
aconda3/envs/mlenvment/lib/python3.7/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp ????? -
/anaconda3/envs/mlenvment/lib/python3.7/site-packages/sklearn/preprocessing/data.py:617: DataConversionWarning: Data with input dtype int64 were all converted to float64 by StandardScaler.
return self.partial_fit(X, y)
/anaconda3/envs/mlenvment/lib/python3.7/site-packages/sklearn/base.py:462: DataConversionWarning: Data with input dtype int64 were all converted to float64 by StandardScaler.
return self.fit(X, **fit_params).transform(X)
/Users/long/Desktop/ml_worksapce/test_pythonprj/机器学习_回归算法/线性回归(时间跟功率).py:81: DataConversionWarning: Data with input dtype int64 were all converted to float64 by StandardScaler.
X_test = ss.transform(X_test) ## 直接使用在模型构建数据上进行一个数据标准化操作 (测试集)
解决办法 :需要指定数据类型
X_train = X_train.astype(np.float64)
X_test = X_test.astype(np.float64) -
matplotlib python3.7运行报错
A41241D3-94EB-48C3-B3F9-9DB4E985C03F.png
解决办法:
import matplotlib
# matplotlib.use("TkAgg")
import matplotlib.pyplot as plt