So I have some train data in a csv file train.csv
with the following format:
x;y;type
[1,2,3];[2,3,4];A
[2,7,9];[0,1,2];B
This file is parsed as a pd.DataFrame
with the following:
CSV_COLUMN_NAMES = ['x', 'y', 'type']
train = pd.read_csv("train.csv", names=CSV_COLUMN_NAMES, header=0, delimiter=";")
train['x'] = train['x'].apply(literal_eval)
train['y'] = train['y'].apply(literal_eval)
So far so good. The literal_eval
function is applied so x
and y
are treated as array. The next step is to create a DataSet
with the following:
features, labels = train, train.pop('type')
dataset = tf.data.Dataset.from_tensor_slices((dict(features), labels))
And here is where it breaks :( It spills the following errors:
TypeError: Expected binary or unicode string, got [1, 2, 3]
Why is binary or unicode string expected? Are vector feature columns not allowed? Or am I doing something wrong? Please shed me some light