Keras KERA适合一个热向量输入

Keras KERA适合一个热向量输入,keras,deep-learning,one-hot-encoding,Keras,Deep Learning,One Hot Encoding,我想研究如何对分类列进行矢量化,并将它们用作回归模型的输入 当我尝试适应它时(“SalePrice”是目标) 符合模型 history_v4 = model_v4.fit(x = x_train_v4, y = y_train_v4, epochs=1000, shuffle = True, validation_split = 0.2, workers=12, verbose=1) 它还说 /tensorflow-2.1.0/python3.6/tensorflow_core/python

我想研究如何对分类列进行矢量化,并将它们用作回归模型的输入

当我尝试适应它时(“SalePrice”是目标)

符合模型

history_v4 = model_v4.fit(x = x_train_v4, y = y_train_v4, epochs=1000, shuffle = True, validation_split = 0.2, workers=12, verbose=1)
它还说

/tensorflow-2.1.0/python3.6/tensorflow_core/python/framework/constant_op.py in convert_to_eager_tensor(value, ctx, dtype)
     94       dtype = dtypes.as_dtype(dtype).as_datatype_enum
     95   ctx.ensure_initialized()
---> 96   return ops.EagerTensor(value, ctx.device_name, dtype)
     97 
     98 

ValueError: setting an array element with a sequence.
我对dl有点陌生,但我想也许可以使用这种输入。他们说我做错了什么


非常感谢!只需要一个正确方向的提示:)

这与你缺乏DL知识无关。。。这是一个Python问题,错误消息准确地告诉您您做错了什么:“使用序列设置数组元素。”-检查您的代码并理解数组和序列之间的区别。这里,也作为参考:这很有用,谢谢!