In this exercise, you will build a linear predictive model to predict crime rate based on several
Fantastic news! We've Found the answer you've been seeking!
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. 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
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a Python program to demonstrate multithreading. Your code shall first create a file for writing called "synch.txt" (autograder will be looking for this file). Then it will create two separate...
-
You are asked to develop a Floppy Disk program that allows users to access a floppy disk locally mounted on a computer. You are expected to use C programming language. In your program, all file I/O...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A chemical processing plant has a network of pipes that are used to transfer liquid chemical products from one part of the plant to another. The following pipe network has pipe flow capacities in...
-
Start with the partial model in the file Ch18 P08 Build a Model.xls on the textbook's Web site. Schumann Shoe Manufacturer is considering whether or not to refund a $70 million, 10% coupon, 30-year...
-
i) Does the following code have a deadlock? Why? ii) If you answer is "Yes", then rewrite the code using the same MPI calls below to fix the problem. } } MPI_Comm_rank(MPI_COMM_WORLD, &myrank); if...
-
Top managers of Chase Financial Services are reviewing company per- formance for 2009. The income statement reports a 20% increase in net income over 2008. However, most of the net-income increase...
-
Hot Wings, Inc., has an odd dividend policy. The company has just paid a dividend of $8 per share and has announced that it will increase the dividend by $6 per share for each of the next four years,...
-
3. Differentiate the following. Show your work. x-2 a) y = 2x+5 (3 marks)
-
Solve Problem 3.33 in Chapter 3 to construct an x-bar chart in conjunction with an R-chart for delivery time at the Great Outdoors Clothing Company. Data in Problem 3.33 in Chapter 3 The Great...
-
Refer to the infinite slope shown in Figure 15.46. Refer to the infinite slope shown in Figure 15.47. Given: B = 25, y = 17.8 kN/m3, ' = 28, and c' = 31 kN/m. Find the height, H, such that a factor...
-
You are a public accountant for several wealthy individuals who have major real estate holdings, including a couple who owns a mall in Brentwood, Tennessee. A major retailer has just moved out of the...
-
How do operating systems handle process synchronization and coordination in a multi-threaded environment, specifically addressing the challenges associated with resource contention, deadlock...
-
1. How can astronomers know things for certain since they only look at space from one vantage point? How is it possible to detect something in space that we can't see through our telescopes? 2....
-
Salvatore decided to start a small business in order to help pay for a forthcoming holiday. As there was an imminent threat of a strike by power company workers, he decided to buy and sell oil lamps...
-
Angelina and Brad divorced in 2018. Per the divorce agreement, Brad receives their former residence valued at 1,800,000 (basis 1,000,000) Brad will pay Angelina 1,500,000 annually for 5 years. If...
-
Question B A hollow cylindrical wire carries a current I in the negative z direction (into the page). The current is uniformly distributed. 1.What is the current density (i.e., current per unit area...
-
Suppose the S&P 500 futures price is 1000, = 30%, r = 5%, = 5%, T = 1, and n = 3. a. What are the prices of European calls and puts for K = $1000? Why do you find the prices to be equal? b. What...
-
The report 2005 Electronic Monitoring & Surveillance Survey: Many Companies Monitoring, Recording, Videotaping and Firing Employees ( American Management sect ion 9.2 Exerc ises Each 526 U. S....
-
The report 2007 Electronic Monitoring and Surveillance Survey: Many Companies Monitoring, Recording, Videotapingand FiringEmployees (American Management Association, 2007) summarized a survey of 304...
-
The article referenced in the previous exercise also reported that 5.7% of high school graduates were unemployed in 2008 and 9.7% of high school graduates were unemployed in 2009. Suppose that the...
-
Is the color of a smartphone nominal or ordinal?
-
A pollster wants to estimate the proportion of voters in a certain town who are Democrats. He goes to a large shopping mall and approaches people to ask whether they are Democrats. Is this a simple...
-
Provide an example of a qualitative variable and an example of a quantitative variable.
Study smarter with the SolutionInn App