From the course: Machine Learning and AI Foundations: Value Estimations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Prepare the features

Prepare the features

From the course: Machine Learning and AI Foundations: Value Estimations

Start my 1-month free trial

Prepare the features

- [Instructor] Now we're ready to code our machine learning system. Let's open up train_model pt1.py. On the first line, we've loaded the dataset into a pandas dataframe using the read_csv function. Now that the data is loaded, our first task is to do any feature engineering work that's required. There are four address fields that we want to remove from our dataset because they weren't useful to us. The house number, unit number, street name, and zip code. We can do that by using the D-E-L command to delete the columns from our data table. First let's delete the house number and the unit number and the street name and zip code. We also need to apply one hot encoding to two columns that contain Cavic Oracle data, the garage type and city fields. Luckily, pandas provides a get_dummies function that performs one hot encoding. All we have to do is tell it which fields to encode. So here we'll call the get_dummies function. We'll pass in the dataframe name and the columns to encode. Next…

Contents