我有两个数组:
所有的预言都是(1200,6565)
。
预测是(6565,)
在predictions_all
中,我拥有随机林中每棵树的所有预测,在predictions
中,每个预测的聚合平均值(即predictions_all
中第一列的平均值是predictions
中的第一个值)。你知道吗
这是我的密码:
from sklearn.metrics import mean_squared_error
MSE_i_1 = []
for i in range(len(predictions_all)):
x = mean_squared_error([predictions_all[i,0]],[predictions[0]])
MSE_i_1.append(x)
MSE_i_1 = np.asarray(MSE_i_1)
MSE_i_1
是(1200,)
数组。有所有的MSE为每个树在所有。你知道吗
问题是我只对第一列做了,我想对所有6565列进行迭代。因此,我希望有一个(1200,6565)
的数组,但我不知道如何循环每个列以及如何确保我有一个(1200,6565)
数组而不是一个列表。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐