Question: For this exercise, we will be using adult.csv . we used this dataset extensively in chapter 1 . Read the dataset using Padans and call

For this exercise, we will be using adult.csv. we used this dataset extensively in chapter 1. Read the dataset using Padans and call it adult_df.
import pandas as pd
adult_df = pd.read_csv('adult.csv')
a) What type of values does the attribute eduction carry?
b) Run 'adult_df.education.unique()', study the results, and explain what the code does.
c) Based on your understandings, order the output of the code you ran for b).
d) Run 'pd.get_dummies(adult_df.education)', study the results, and explain what the code does.
e) Run 'adult_df.sort_values(['education-num']).iloc[1:32561:1200]', study the results and explain what the code does.
f) Compare your answer to c) and what you learned from e). Was the order you came up with in c) correct?
g) Education is an ordinal attribute, translating an ordinal attribute from an analytic perspective to a programming perspective involves choosing between Boolean representation, string representation, and integer representation. Choose which choice has been made for the three following representations of the attribute education.
- 'adult_df.education'
-'pd.get_dummies(adult_df.education)'
- 'adult_df[education]'
h) Either of the choices has some advantages and some disadvantages. Select which programing data representation each statement below describes.
- If an ordinal attribute is presented using this programming value representation, no bias or assumptions are added to the data, but algorithms that work with numbers cannot use the attribute.
- If an ordinal attribute is presented using this programming value representation, the data can be used by algorithms that only take numbers, but the size of the data becomes bigger and there may be concerns for computational costs.
- If an ordinal attribute is presented using this programming value representation, there will be no size or computational concerns, but some statistical information that may not be true is assumed and it may create bias.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!