Question: Use Python. The datasets are too long so I can't copy and paste it here, but this is what part of the csv files look

Use Python.

Use Python. The datasets are too long so I can't copy and

The datasets are too long so I can't copy and paste it here, but this is what part of the csv files look like (what matters is the code even if the output is different, so it's okay if you don't copy the whole content of the dataset (especially for the house dataset)):

- House dataset (csv file):

paste it here, but this is what part of the csv files

look like (what matters is the code even if the output is

- x_new dataset (this is the whole content of the csv file):

different, so it's okay if you don't copy the whole content of

Predict the party affiliation of the House member whose votes have been recorded in the file named x_new.csv. Write the code here to achieve the following output: Party Prediction: ['democrat'/' republican'] water 0 0 1 D E F budget phys_fee el_sal 1 1 0 1 0 1 1 1 0 1 1 0 P Q duty_free south_africa 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 A B 1 party infants 2 democrat 3 republicar 4 democrat 5 democrat 6 democrat 7 democrat 8 democrat 9 republicar 10 democrat 11 republicat 12 democrat 13 republicar 14 democrat 15 republicar 16 republicar 17 republicar 18 democrat 19 democrat 20 democrat 21 democrat 22 democrat 23 democrat G H I K M N o religion sat_test nic_aid mx_missil immigrati synfuels education superfunc crime 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 0 o 1 1 1 1 0 1 B C D E F H 1 K M N O R 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 A 24 republica 25 republicar 26 republicar 27 republicar 28 republicar 29 republicar 30 democrat 31 republicat 32 republicar 33 republicar 34 democrat 35 republicat 36 republicar 37 democrat 38 democrat 39 democrat 40 democrat 41 republicar 42 republicar 43 republicar 44 democrat 45 republicar 46 republicar 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 B C D E F 1 K L M N o 0 2 3 4 5 15 1 2 3 1 1 8 0 9 1 10 0 11 1 12 0 13 0 14 0 1 1 0 1 0 0 1 1 Predict the party affiliation of the House member whose votes have been recorded in the file named x_new.csv. Write the code here to achieve the following output: Party Prediction: ['democrat'/' republican'] water 0 0 1 D E F budget phys_fee el_sal 1 1 0 1 0 1 1 1 0 1 1 0 P Q duty_free south_africa 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 A B 1 party infants 2 democrat 3 republicar 4 democrat 5 democrat 6 democrat 7 democrat 8 democrat 9 republicar 10 democrat 11 republicat 12 democrat 13 republicar 14 democrat 15 republicar 16 republicar 17 republicar 18 democrat 19 democrat 20 democrat 21 democrat 22 democrat 23 democrat G H I K M N o religion sat_test nic_aid mx_missil immigrati synfuels education superfunc crime 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 0 o 1 1 1 1 0 1 B C D E F H 1 K M N O R 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 A 24 republica 25 republicar 26 republicar 27 republicar 28 republicar 29 republicar 30 democrat 31 republicat 32 republicar 33 republicar 34 democrat 35 republicat 36 republicar 37 democrat 38 democrat 39 democrat 40 democrat 41 republicar 42 republicar 43 republicar 44 democrat 45 republicar 46 republicar 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 B C D E F 1 K L M N o 0 2 3 4 5 15 1 2 3 1 1 8 0 9 1 10 0 11 1 12 0 13 0 14 0 1 1 0 1 0 0 1 1

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!