0

How can I associate values to classes in Keras?

Input:

[[1, 2, 3], [4, 5, 6], [7, 8, 9]]

Expected:

[1, 2, 3], [4, 5, 6] associated with class 1
[7, 8, 9] associated with class 2

The problem is that [1, 2, 3], [4, 5, 6] come from one file and [7, 8, 9] from another. I have read an example with iris.csv but the samples have same size.

Eduardo Andrade
  • 111
  • 1
  • 1
  • 13

1 Answers1

0

One suggestion would be to merge the two datasets into one like this:

X (shape=(3,3))

[[1, 2, 3], [4, 5, 6], [7, 8, 9]]

y (shape = (3,1))

[1, 1, 2]

Many classifiers support labels in that format out of the box.

If you need to further process the labels, you can use scikit-learn for that. Have a look at these:

Felipe
  • 11,557
  • 7
  • 56
  • 103