Question: In this exercise, you will build a linear predictive model to predict crime rate based on several factors. The data is in the crime-rate file.

In this exercise, you will build a linear predictive model to predict crime rate based on several factors. The data is in the “crime-rate” file. You will build the model by writing your own script for gradient search. Experiment with 2-3 learning rates to see the effect of learning rate on the search. in python and using CrimeRate.xlsx file

Here is what the CrimeRate files looks like

123 4 5 6 7 8 9 10 == 11 12 1314 15 16 17 18 19 20 21 22 23 24 25

123 4 5 6 7 8 9 10 == 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 X1 A 478 494 643 341 773 603 484 546 424 548 506 819 541 491 514 371 457 437 570 432 619 357 623 547 792 799 X2 B 184 213 347 565 327 260 325 102 38 226 137 369 109 809 29 245 118 148 387 98 608 218 254 697 827 693 X3 C X4 40 32 57 31 67 25 34 33 36 31 35 30 44 32 30 16 29 36 30 23 33 35 38 44 28 35 D 12 74 72 70 71 72 68 68 62 69 66 60 81 66 67 65 64 64 62 59 56 46 54 54 45 57 57 X5 E 77 11 11 18 11 9 8 23 12 13 7 9 13 4 9 11 12 10 12 7 5 5 15 15 22 14 20 26 12 9 X6 F 31 43 16 25 29 32 24 28 25 58 21 77 37 37 35 42 21 81 31 50 24 27 22 18 23 60 X7 G 20 18 16 19 24 15 14 11 12 15 9 36 12 16 11 14 10 27 16 15 8 13 11 8 11 18 H J K L M N The data (X1, X2, X3, X4, X5, X6, X7) are for each city. X1 = total overall reported crime rate per 1 million residents X2 = reported violent crime rate per 100,000 residents X3 = annual police funding in $/resident X4 =% of people 25 years+ with 4 yrs. of high school X5 =% of 16 to 19 year-olds not in highschool and not highschool graduates. X6 =% of 18 to 24 year-olds in college X7 =% of people 25 years+ with at least 4 years of college The goal is to build a linear predictive model to predict reported crime rate (X1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solutions Step 1 To build a linear predictive model to predict the reported crime rate X1 based on the given data you can follow these steps in Python We will use gradient descent to train the model w... View full answer

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 Programming Questions!