Converting categorical datasets into continuous?

Hi. I’ve been working on my first TF project for a few weeks now in my spare time. I’ve learned a ton but I’m still running into a few gaps in my understanding before I think I can get everything working.

I’m trying to use a CNN to predict a continuous value using images as input. I’m using the functions from keras.preprocessing.image to load the datasets but they expect the labels to be categorical. Is it possible to transform the labels into continuous values before training?
Like if I have categories [“1”, “2”, “3”] can I transform those labels to values [0.0, 0.333, 1.0] and run some kind of regression?

I’m having trouble finding resources for something like this so any help is super appreciated!


For further clarification, if it’s helpful.
My goal is to build a CNN-regression model. I’d like to predict a continuous value with an image as input. I’m not clear, reading the documentation, how to use the image-dataset functions provided in kera.preprocessing.image to load a dataset of images with numeric, continuous labeling.


1 Like