1 回答
TA贡献1866条经验 获得超5个赞
那这个呢?(我不认为最后的四舍五入是必要的,但为了安全起见,我把它留在那里。)
import numpy as np
for _gbrCount in np.arange(0, 1.0, 0.1):
for _xgbCount in np.arange(0, 1.0, 0.1):
gbrCount = np.round(_gbrCounr, decimals=1)
xgbCount = np.round(_cgbCount, decimals=1)
regCount = np.round(1 - gbrCount - xgbCount, decimals=1)
y_p = (xgbCount*xgb.predict(testset)+ gbrCount*gbr.predict(testset)+regCount*regressor.predict(testset))
testset['SalePrice']=np.expm1(y_p)
y_train_p = xgb.predict(dataset)
y_train_p = np.expm1(y_train_p)
rmse.append(np.sqrt(mean_squared_error(y, y_train_p)))
rmse.append(xgbCount)
rmse.append(gbrCount)
rmse.append(regCount)
添加回答
举报