Crime rate data analysis in Los Angeles

29
Jongwook Woo HiPIC CSULA Crime rate data analysis in Los Angeles Presented by, Donda, Ram Dharan Puli, Sridhar Reddy Advised by, Dr Jongwook Woo

Transcript of Crime rate data analysis in Los Angeles

Page 1: Crime rate data analysis in Los Angeles

Jongwook Woo

HiPIC

CSULA

Crime rate data analysis in Los Angeles

Presented by,Donda, Ram Dharan Puli, Sridhar Reddy

Advised by, Dr Jongwook Woo

Page 2: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Synopsis

IntroductionMicrosoft Azure HDInsight Cluster DetailsRaw data projectionDetailed analysis of Crime DataConclusionData set & Github URL

Page 3: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

IntroductionDay to day exponential growth of crimes US holds 44th position with 50.15% crime

index in 2014 Despite of having technologyTotal reported crimes in USA are 94.76

million in 2014

Page 4: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Specifications of Data Set

Data is collected from Los Angeles Police

Department (LAPD)

Offenses like Criminal, Vandalism, Burglary,

Assault, Traffic and Theft occurred in 2014 are

analysed. File Size – 41MB Number of Files – 1 File Format – CSV (Comma Separated Values) Total Number of offenses – 2.44 million

Page 5: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Microsoft Azure HDInsight Cluster Details

Number of data nodes - 2CPU – 4coresMemory – 14GBOperating system - Windows server 2012

Page 6: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Projection of Raw Data

2% 8%

9%

12%

17%19%

33%

Total occurences of each Crime

CRIMINALVANDALISMOTHERSBURGALARYASSAULTTRAFFICTHEFT

Page 7: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Total No.of Crimes in 2014

1 2 3 4 5 6 7 8 9 10 11 120

5000

10000

15000

20000

25000

19169

17384

19730

19413

20645

20494

21480

21280

21287

2166919844

21355

No.of Crimes per Month

Page 8: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Raw Data Projection on MAPS

Page 9: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Query for accurate ‘DISTANCE’ calculation

INSERT OVERWRITE TABLE LOCATION_VALUES Select cast(regexp_replace(split(location_2,',')[0],'\\(','') as double),

cast(regexp_replace(split(location_2,',')[1],'\\)','') as double),

dr_no,

2 * asin(

sqrt(cos(radians(34.0667)) *

cos(radians(cast(regexp_replace(split(location_2,',')[0],'\\(','') as double))) *

pow(sin(radians((-118.1678 - cast(regexp_replace(split(location_2,',')[1],'\\)','') as double))/2)), 2)

+pow(sin(radians((34.0667 - cast(regexp_replace(split(location_2,',')[0],'\\(','') as double))/2)), 2)) )*3956 from LAPD_CRIME_DATA;

Page 10: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of Crimes for every 5miles from CSULA

0- 5 5-10 10-15

15-20

20-25

25-30

30-35

35-40

>400

1000020000300004000050000600007000080000

20062

77559

4907546935

33974

14321

6 1 1

Page 11: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Comparision of Crimes for every 5miles from CSULA, UCLA and USC

0- 5 5-10 11-15 15-20 20-25 25-30 30-35 35-40 >500

20000

40000

60000

80000

100000

120000

csula ucla usc

Page 12: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Mapping of Crimes Occurred within 5miles from CSULA

Page 13: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Mapping of Crimes Occurred within 5miles from UCLA

Page 14: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Mapping of Crimes Occurred within 5miles from USC

Page 15: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Types of Crimes within 0-5miles from CSULA

ASSAULT20%

BURGALARY8%

CRIMINAL3%

THEFT33%

TRAFFIC18%

VANDALISM8%

others10%

Page 16: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Types of Crimes within 5-10miles from CSULA

ASSAULT20%

BURGALARY11%

CRIMINAL3%

THEFT32%

TRAFFIC18%

VANDALISM8%

others9%

Page 17: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Types of crimes greater than 10miles from CSULA

CRIMINAL2%

VANDALISM8%

others9%

BURGALARY13%

ASSAULT14%

TRAFFIC20%

THEFT34%

Page 18: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes within 5 miles from CSULA, UCLA and USC based on crime type

ASSAULT

BURGALARY

CRIMIN

ALTHEFT

TRAFFIC

VANDALISM

others0

5000

10000

15000

20000

25000

30000

csula ucla usc

Page 19: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

HQL Query when ‘DISTANCE’ is a parameter

Page 20: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes per area in LA

No.of Crimes in LA0

2000400060008000

1000012000140001600018000

1698

210

307

1084

087

65 1002

786

74 1090

612

016

1295

311

538

1200

811

804

1350

510

417

1247

6 1587

110

802

1193

910

886

1036

810

666

77th Street Central Devonshire Foothill Harbor HollenbeckHollywood Mission N Hollywood Newton Northeast OlympicPacific Rampart Southeast Southwest Topanga Van NuysWest LA West Valley Wilshire

Page 21: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes per Area within 5miles from CSULA

0100020003000400050006000700080009000

2

6007

1 1

8483

1 1 649

4637

1 5 2491 8 13 1 2

Page 22: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Types of crimes in Hollenbeck

ASSAULT

BURGALARY

CRIMINAL

THEFT

TRAFFIC

VANDALISM

others0

500

1000

1500

2000

2500

3000

1547

689

223

2836

1653

694 841

Page 23: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Total No.of Crimes for every 2hours in LA

00:00-02:00

02:00-04:00

04:00-06:00

06:00-08:00

08:00-10:00

10:00-12:00

12:00-14:00

14:00-16:00

16:00-18:00

18:00-20:00

20:00-22:00

22:00-24:000

5000100001500020000250003000035000

18352

8657

6517

1505919597

28592

22823

26114

28130

27874

25175

16860

Page 24: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes for every 2hrs within 5miles from CSULA

00:00-02:00

02:00-04:00

04:00-06:00

06:00-08:00

08:00-10:00

10:00-12:00

12:00-14:00

14:00-16:00

16:00-18:00

18:00-20:00

20:00-22:00

22:00-24:000

500

1000

1500

2000

2500

1534

761 646

13351533

21581832

2072229022942132

1475

Page 25: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes for every 2hrs within 5miles from CSULA, UCLA and USC

0

2000

4000

6000

8000

10000

12000

1238488 434

1179 16592372 1954 2110 2284 2003 1643 1091

6869

35782599

5345

7355

9950

83779597 1017610181

9476

6444

crimes ucla usc

Page 26: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Type of crimes from 0-5miles from CSULA during 4PM to 8PM

ASSAULT

BURGALARY

CRIMINAL

THEFT

TRAFFIC

VANDALISM

others0

200400600800

10001200140016001800

967

460

162

1647

933

428 424

Page 27: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

No.of crimes for every 2hrs within 5miles from CSULA, UCLA and USC

0

2000

4000

6000

8000

10000

12000

1238488 434

1179 16592372 1954 2110 2284 2003 1643 1091

6869

35782599

5345

7355

9950

83779597 1017610181

9476

6444

crimes ucla usc

Page 28: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

ConclusionCrime rate is higher in the heart of the city than

in other regions in LAAverage crime rate in the year 2014 is 20312.5Nearly 119 kinds of crimes are reported in 2014Microsoft Azure allowed us to process the entire

data with minimal costHuge storage space in cloud made Hadoop to

store the data without any data lossHQL made it simple to extract the data from

HDFS

Page 29: Crime rate data analysis in Los Angeles

High Performance Information Computing CenterJongwook Woo

CSULA

Github & Data Set details

https://gitlab.com/sridhar.puli.593/crimedataanalysis_compare/tree/master

https://data.lacity.org/A-Safe-City/LAPD-Crime-and-Collision-Raw-Data-2014/eta5-h8qx