top of page

Deep Learning Tips how to use to_categorical for one hot encoding in TensorFlow

Updated: Jul 24, 2023

TensorFlow requires us to pay attention to how we put out categorical classification target into our model. The to_categorical function in TensorFlow works in a similar way to the get_dummies function in Pandas. And on a DataFrame can be used as a substitute. Hot one encoding with TensorFlow requires use to give integers as our class. If we use an sklearn preprocessing LabelEncoder and can then return these integers back into the original classes.

Follow Data Science Teacher Brandyn


42 views0 comments

Recent Posts

See All


Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page