. Assignment 5 Use Python to analyze the data sets associated with the two cases below. When you are done, upload this completed worksheet as a Word document (copy and paste your output and comments...

1 answer below »
The instructions for the assignment are on the word document. The solutions must be in word and .py format.


. Assignment 5 Use Python to analyze the data sets associated with the two cases below. When you are done, upload this completed worksheet as a Word document (copy and paste your output and comments where indicated). Also save and upload the .py files that contain your Python code. Your code should contain comments about what it does at each step. You do not have to include your Python code on this worksheet. Refer to the Python examples that were covered in class exercises for guidance. Some of the code can be copied and used for this assignment, but be careful to make changes where needed. Also refer to the slide sets for additional information that can help you answer the questions. Scoring for this assignment will be based on correctly constructing the needed Python code and providing the correct results, along with the quality of any comments and written responses. Be sure to follow the instructions exactly and provide all information requested to receive full credit. Case 1: Which students are choosing to study STEM fields in college? There has been continued interest in understanding what type of students (based on demographic, aptitude, and other measures) plan to pursue undergraduate studies in fields related to science, technology, engineering, and mathematics (STEM). The CSV file “SurveyData” contains selected data collected from 240 college-bound students just after they graduated from high school in the United States. The data set is comprised of the following six variables for each student: · STEM: Does the student intend to pursue a STEM field of study (0 = No, 1 = Yes) · GPA: student’s high school grade point average (GPA) · SAT: student’s SAT scores · White: student is of European descent (Yes or No) · Female: student is female (Yes or No) · Asian: student is of Asian descent (Yes or No) Some respondents are classified as neither White nor Asian (none are classified as both). Respondents that are not classified as female are male. 1A.Create a logistic regression model using STEM as the response (y) variable and GPA and SAT as the predictor (x) variables. The model will predict whether a student is expected to pursue a STEM field or not. Divide the data into training and testing data, with the testing data size equal to 20% of the all data (use random_state=101). Create the model using the training data, then generate a set of predictions using the test data. Provide the intercept (b0) and coefficients (b1 and b2) for the model below. 1B.Generate a classification report for the model. Describe how well the model seems to work based on the values (percentages) for the different metrics. Provide the classification report output and your interpretation below. 1C.Now create a logistic regression model using STEM as the response (y) variable and all of the other five variables as the predictor (x) variables. (Note: you may want to create a separate Python file to run Parts C and D.) The model will again predict whether a student is expected to pursue a STEM field or not, but the decision is based on more variables. You will need to create dummy variables for the last three variables. Divide the data into training and testing data, with the testing data size equal to 20% of the all data (use random_state=101). Create the model using the training data, then generate a set of predictions using the test data. Provide the intercept (b0) and coefficients (b1 through b5) for the model below. Based on the coefficients, what variables seem to affect the decision to pursue a STEM field the most? 1D.Generate a classification report for the model. Describe how well the model seems to work based on the values (percentages) for the different metrics. Provide the classification report output and your interpretation below. How does this model compare with the first model? Case 2: Information Technology (IT) use among countries. The use of IT seems to be linked with the economic and societal development of many countries. The file “InfoTech.xlsx” contains data collected by a non-profit organization that measures the use and impact of IT from about 140 countries. The following variables are provided: · IU: Individual (personal) usage of IT · BU: Business usage of IT · GU: Government usage of IT Each variable contains a score between 1 (lowest) and 7 (highest). 2A.Run descriptive statistics and seaborn “pairplot” on the data set. What do these tell you about the different variables (e.g., How are they similar and/or different? Do you notice any correlations?). Provide the output and your interpretation below. 2B.Create a dendrogram of the data using the Ward method. Label the axes and title as appropriate. Provide the chart below. Comment on how well you think a choice of 4 clusters would work for this data, based solely on the dendogram. 2C.Now use Hierarchical clustering (agglomerative) to model the data. Use 4 clusters and Euclidean distances. How did the clustering group the countries? To answer this, generate two scatterplots, both with BU on the y-axis (since we have 3 variables, with need to think in three dimensions). Provide your charts and answer below. 2D.Generate an “elbow” chart for the data set. Label the axes and title as appropriate. Paste the chart below. Comment on how well you think a choice of 4 clusters would work for this data, based solely on the chart. 2E.Now use k-means clustering to model the data. Use 4 clusters and random state = 0. Again, create two scatterplots similar to those done in Part C. How do the results from hierarchical clustering and k-means clustering compare to each other? Provide your charts and answer below. 2 Info Tech IUBUGU 3.53.33.6 2.72.82.6 4.83.33.2 43.34.3 6.24.74.9 5.85.54.7 4.73.64.6 6.23.95.6 233.7 5.95.14.5 2.13.42.7 2.83.13.5 2.92.93.2 3.932.5 3.13.33.5 4.73.63.5 4.93.43.2 1.22.42.3 2.73.22.9 1.93.53.2 5.64.85 3.63.33.5 1.22.52.5 4.83.84.5 3.83.84.5 5.95.44.9 43.44.7 4.73.94 2.53.53.6 5.13.33.4 4.83.73.6 5.74.23.3 6.85.64.6 3.13.43.4 3.43.43.8 3.72.93.7 3.23.43.5 6.24.35.3 1.52.93.7 6.55.74.9 5.94.95.2 2.43.12.8 2.53.43.6 43.14 6.15.74.7 3.43.43.3 4.83.43.4 2.73.82.8 1.72.72.4 2.63.43.3 1.72.72.1 2.73.83.6 6.24.84.6 5.23.53.7 6.554.6 23.54 3.243.8 3.233.4 5.84.84.8 5.55.75.2 5.43.73.9 3.43.63.5 6.35.85.3 43.84.3 4.73.54.7 2.53.84.3 6.45.35.5 5.53.53.6 3.43.12.9 1.93.33.2 5.444.2 53.32.8 232.8 1.73.12.8 5.44.24.6 6.75.35.3 4.93.34 1.53.32.7 1.432.7 54.65.4 2.433.1 5.83.94.2 2.12.72.4 4.23.74.2 3.53.54.1 4.23.13.8 3.63.64.1 4.53.34.1 4.13.24.5 1.83.13.2 1.72.52.2 2.93.63.4 2.12.92.6 6.55.75.3 64.95.3 2.42.92.2 2.43.43.2 6.65.45.1 5.23.34.6 23.13.2 3.93.94 332.6 3.13.33.6 3.73.93.9 5.23.53.5 54.14.7 5.94.75.4 4.63.53.4 5.23.54.3 1.83.65.2 5.93.85.3 2.53.73.7 4.833.2 4.23.53.6 6.35.36.2 5.53.83.6 5.34.23.5 3.84.13.2 5.53.84.6 2.73.84.9 2.33.12.6 6.65.94.9 6.564.4 2.23.33 1.633.3 4.23.83.7 4.63.43.4 3.83.24 4.23.74 1.83.23.3 3.83.53 6.14.56.1 6.55.15.3 6.15.85.3 5.13.34.7 3.82.92.9 3.53.43.9 1.93.53.2 2.432.8
Answered Same DayApr 11, 2022

Answer To: . Assignment 5 Use Python to analyze the data sets associated with the two cases below. When you are...

Sathishkumar answered on Apr 11 2022
97 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here