0

I wanted to study how to vectorize categorical columns and use them as input for a regression model.

When i tryed to fit it ('SalePrice' is the target),

my dataframe with one hot vectors

fit the model

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)

it returns that

/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.

I'm a bit new to dl, but i thought maybe this kind of input could be used. em'i doing something wrong?

Thank's a lot! just need a tip for get in the right direction :)

  • 1
    that has nothing to do with your lack of DL knowledge ... it's a Python issue, and the error message is exactly telling your what you're doing wrong: *"setting an array element with a sequence."* - check your code and understand the difference between an array and a sequence. – UninformedUser Feb 02 '20 at 17:49
  • 1
    Here, also for reference: https://stackoverflow.com/questions/13310347/numpy-valueerror-setting-an-array-element-with-a-sequence-this-message-may-app/39114489 – UninformedUser Feb 02 '20 at 17:50
  • this is usefull, thanks! – Javier Espinoza Traslaviña Feb 02 '20 at 18:40

0 Answers0