From the course: Deep Learning: Getting Started

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Input preprocessing

Input preprocessing

- [Instructor] As discussed in the earlier chapter, input data should be pre-processed and prepared for deep learning before it can be used to train the models. Code for this video is in section 4.2 of the notebook. Let's explore the code now. We first load the iris.csv file into a pandas dataframe. This file is available as a part of the exercise files in the same folder as the notebook. We then print the contents of the dataframe to check. The target variable species is a text field. It needs to be converted to a numeric representation to be used for deep learning. For this, we use a LabelEncoder model based on the species column, and then update the species column with the corresponding encoding. Next, we convert the dataframe into a NumPy array, which is the preferred input format for Keras deep learning. We separate the feature and target variables into different variables, namely X_data and Y_data. X_data has four columns and Y_data has one. We print the feature variables and…

Contents