From the course: Responsible AI Algorithm Design
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Solution: Frameworks for ethical decision-making in AI
From the course: Responsible AI Algorithm Design
Solution: Frameworks for ethical decision-making in AI
(playful music) - [Instructor] Okay, let's tackle the solution now. Let's find the src folder again, go into the 01_04_solution.py file. So we will import our libraries that we have discussed, including pandas, sklearn, matplotlib, and seaborn. We load the data set from fetch_openml, and then we assign the DataFrame as df equals to adult_data.frame. So after that, what we got to do is we go ahead and pre-process the data as it's one of our tasks for this challenge. So let's go ahead and handle missing values by dropping them. So we will use the df.dropna function and then we will drop them in place, which means it will happen right then and there. So this is handling our missing values by dropping them. We go ahead and encode categorical variables here. So we will say df equals to, again call the pd.get_dummies, and get_dummies will handle the one hot encoding for us. So we will input the DataFrame, and then we will give the drop_first to be True here. So this parameter avoids multi…