都输出时有2个输出,第二个值定义为第二年的房价,但在housing.target只有一个值。这个房价是怎么来的
来源:2-14 wide&deep模型的多输入与多输出实战
慕婉清7471612
2020-02-22
如题
写回答
1回答
-
正十七
2020-02-24
同学你好,这里数据集中是没有第二年的这个房价这个值的,所以为了简单起见,我用了跟housing.target一样的值。
x_train_scaled_wide = x_train_scaled[:, :5] x_train_scaled_deep = x_train_scaled[:, 2:] x_valid_scaled_wide = x_valid_scaled[:, :5] x_valid_scaled_deep = x_valid_scaled[:, 2:] x_test_scaled_wide = x_test_scaled[:, :5] x_test_scaled_deep = x_test_scaled[:, 2:] history = model.fit([x_train_scaled_wide, x_train_scaled_deep], [y_train, y_train], validation_data = ( [x_valid_scaled_wide, x_valid_scaled_deep], [y_valid, y_valid]), epochs = 100, callbacks = callbacks)
00
相似问题