【发布时间】:2021-05-24 02:57:03
【问题描述】:
当我尝试使用标准缩放器缩放数据时,模型给出了错误的预测:
from sklearn.preprocessing import StandardScaler
st=StandardScaler()
x_train=st.fit_transform(x_train)
x_test=st.transform(x_test)
arry = [51,1,0,140,261,0,186,1,0,2,0,2]
tes = np.asarray(arry)
se = tes.reshape(1,-1)
svc_load.predict(se)
输出:数组([0],dtype=int64)
但输入相同但没有缩放数据:
arry = [51,1,0,140,261,0,186,1,0,2,0,2]
tes = np.asarray(arry)
se = tes.reshape(1,-1)
svc_load.predict(se)
输出:数组([1],dtype=int64) 哪个是对的。 我是机器学习的新手。谁能帮我解决这个问题?
我正在使用 GaussianNB 分类器。
【问题讨论】:
-
模型是如何训练的?在哪里扩展功能?两者的
predict_proba(se)是什么。事实上,你无法知道真正的答案是否是纯粹的幸运猜测。
标签: python