- Prof. Dancy's Site - Course Site -

CSCI 204 (Data Structures and Algorithms) Final Project

Combating crime one data point at a time!


There are 3 main phases in this project

Phase 1
Phase 2 Phase 2

Final Phase

Back to shortcuts
Shortcuts:

Project Objectivs & Overview

Project Deliverables

Project Point Breakdown
Project Milestones & Dates

SCRUFFY THE CRIME DOG IMAGE
Scruffy the crime dog wants you to take a bite out of crime

Teams of three or four students
Teams will be assigned by Prof. Dancy

Due-Dates:

Objectives

Final Project Overview

Back to shortcuts

Scenario

SCENARIO IMAGE
Scenario

You're group is an elite group of developers that have been contracted by the Chicago Information Sciences Department. You've been asked by the Police Chief to develop a new police patroll dispatch system that his officers can use to fight crime in the most efficient way possible.

Police chief (simpsons) IMAGE
The police chief is relying on you to help combat crime

The Chief made this back of the napkin drawing to help you think about what he envisions as the final system (the Decision Engine)

Confused gif

To help with this, he's given you a dataset of previous crimes so that you can decide how you'll handle those new data that you'll be reading in.

Phase 1

Back to shortcuts

Getting Familiar with the dataset

The first step is to explore the dataset a bit. Your dataset is contained in the file called Chicago_Crimes_2018-2019_Train.csv.
As indicated by the name, the values in this file are comma-separated.

Using AVL Trees to store your data and keep it in order

You will need to create an AVL tree class that you can use to store data so that you can make decisions on how to prioritize any crime coming in.
For your decision-making, you should store at least 2 AVL Trees:

How should I determine the priority?
Confused gif

This is part of the challenge! How should you determine priority? There might be many ways, but I'll leave it up to you to think about that.

Creating visualizations of your data

This part of Phase 1 is meant to give you an opportunity to find a visualization package you like and get familiar with it.

How do I draw this thing

Great question! There are several options out there for your AVL tree:

If you're talking about general drawing (e.g., drawing other aspects of those data you have):

How should I design my viz? What should my visualization convey?

The starter code


class ChicagoCrimeFun:

	def init(self):
		"""
		Constructor that could do several things, including read in your training data
		"""
		pass

	def build_loc_priority(self):
		"""
		Should be used to build your location-priority AVL tree
		"""
		pass

	def build_crime_priority(self):
		"""
		Should be used to build your location-priority AVL tree
		"""
		pass

	def decide_next_patrol(self, new_request=None):
		"""
		You will need this later, but I'm just giving this here for you to keep it as a placeholder
		"""
		pass



Phase 1 Presentations

Each team will be required to give a ~6 minute presentation on their implementations and the visualizations that they've created for Phase 1. You should be sure your presentation works on the classroom computer sometime before your presentation date or you must bring your own laptop, and make sure you know how to project your display on your external monitor port.
These presentations should give a good background on your design choices and the reasons for those choices. It will also be your chance to quickly discuss issues you have had or did have w/ the project.

More specifically, your presentation must provide answers to the following:



Phase 1 reflection

Each person in your team will be required to give an end-of-phase (Final) reflection.
You should think of this like an additional journal, but specifically for the project.
This will be the time to reflect on:

Phase 2

Back to shortcuts

Making a decision based on past data

The chief loves what you've done, but needs some help with decision-making
Now that you have a way to lookup the priorities of locations and crimes for any dispatch coming in, we can now start to think about making decisions.
You need to make your decide_next_patrol method should return where the next patrol should go:

Image with example coords

But how should you make these decisions?

Using a Heap Priority Queue to make decisions on dispatches

Create an attribute for your main ChicagoCrimeFun class called dispatch_queue that will be used to decide where to send patrols when you have had 911 dispatch calls.
dispatch_queue should be a MinHeap that holds:

As with your AVL Tree, you should be creating a separate MinHeap class.

You should use the following methods to add a dispatch to your MinHeap (You must fill in the body of the metod):

	def add_dispatch(self, dispatch_string):
		'''
		Method to add a dispatch to our dispatch_queue
		Parameters:
			dispatch_string: [string] A string that represents a recent 911 dispatch call request that is reported to the police
		'''

	def decide_next_patrol(self, new_request=None):
		'''
		Used to decide next place to send patrol
		Parameters:
			new_request: [string][optional] A string that represents a 911 dispatch call that is reported to the police
		Returns:
			[tuple] A tuple of length 4 that represents the 4 points of an area to patrol.
		'''
		pass

If your dispatch_queue is not empty, you should be extracting from it to decide where to send the next patrol (and returning the tuple to represent the area that the patrol should be covering.)
Thus, your decide_next_patrol method should use the dispatch_queue to find & return the next area to patrol if it isn't empty.
Your code should also be able to handle a dispatch with attributes you've never seen before. For example, if the request includes a representation of location that you've never seen before (and thus isn't in your AVL tree), you should pick some way to handle that request.

How should we handle a decide_next_patrol call if our dispatch_queue is empty?

Using a Heap Sort to create a sorted list of all the possible locations to send patrols

So what about calls to our decide_next_patrol when our new_request is None and our dispatch_queue is empty?

To handle this scenario, I want you to create a sorted list from your AVL Trees using Heap Sort.
Your sorted list should be assigned to an attribute called crime_priority_list

Within your sorted list, each item should have a payload that is made up of a key and a value



Creating visualizations of your data

As with Phase 1, you will need to create a visualization for Phase 2.

Visualizing your Heap

Here you need to create a visualization that represents your MinHeap.
You are welcome to use the same tools that you used previously, or to try something new!

To be clearer about what I mean here, I want to see some visualization that is a direct representation of your Heap. If you want more clarity or to see if something you create will get the full credit, ask!

Expanding your AVL visualization

Now is the time to expand your AVL visualization! Revisit your preivous choice of visualization
I want you to expand/modify your original AVL visualization in some way. You should explain what you did and why in your README.md (one of the Phase 2 deliverables)



Phase 2 Presentations

Each team will be required to give a ~6 minute presentation on their implementations and the visualizations that they've created for Phase 2. You should be sure your presentation works on the classroom computer sometime before your presentation date or you must bring your own laptop, and make sure you know how to project your display on your external monitor port.
These presentations should give a good background on your design choices and the reasons for those choices. It will also be your chance to quickly discuss issues you have had or did have w/ the project.

More specifically, your presentation must provide answers to the following:



Phase 2 reflection

As with phase 1, each person in your team will be required to give an end-of-phase reflection.
You should think of this like an additional journal, but specifically for the project.
This will be the time to reflect on:

Final Phase

Back to shortcuts

For the final phase, we'll focus on reflection, revision, and packing our final software product for the police commisioner
In this part of the phase you will (hopefully) begin to think of your solution as more than just a technical solution, but instead a sociotechnical solution.
After all, all systems and artifacts we create are situated within our socio-cultural society and it is part of our jobs as responsible & ethical system designers and developers to realistically and systematically consider this.
You are not always given the tools or rightly forced to consider this, but consider this phase of the assignment a possible beginning to thinking about these things in a world that has (historically) tried to shield the technical from social considerations (even when those solutions are always used by and interact with individuals and social groups!)

1. Let's do some reading!

For this phase, you will need to read and respond to (in your report & code revision) 3 different articles/Book chapters

Weapons of Math Destruction, Chapter 5
Weapons of Math Destruction Chapter 5

This chapter will introduce you to some ideas on "Big Data" and the criminal justice system

The color of law, Chapter 6
Weapons of Math Destruction Chapter 5

This book chapter will introduce you to some ideas on how the make-up of neighborhoods came about. (Related to the topic of "red-lining" if you've ever heard that term)

Vox article on policing
We can't fix policing without talking about race. This cartoon explains why.
Image from the article

This article will introduce you to some racial issues with regards to policing (and cite some research in that regard).

2. Refactoring And Revising

This should be completed after reading and cognitively digesting the above readings
Given the above readings, refactor and revise your code so that it is, in your estimation, more fair and equitable.

You should also refactor your code so that comments, names, etc. are more socially appropriate. A way to think about it is illustrated in the scenario below:

A grieving family of a person shot by a police officer, partially as a result of mistaken identity, during a traffic stop comes to see you and your code that dispatched an officer to patrol that area. Would anything in your code (comments, name, etc.) anger or upset them due to being inappropriate given the severity of the system your developing?

3. Picking where to place police stations

In addition, the commissioner was hoping to have you help him determine where to place police stations.
Unfortunately, the commish' didn't provide this in his original project problem scope, so now all you can do is suggest a design
Thus, your project leader has notified him that you group can provide a design, but not an implementation

4. Final Report

Your final report should be 6-10 pages and should detail design choices you made with your system (you don't need to go into deep detail, your README.md will accomplish the detail)

This report can have several sections, but should have some similar to these main sections:

Final Phase Presentation

Each team will be required to give a ~6 minute presentation on their implementations and the visualizations that they've created for the Final Phase. You should be sure your presentation works on the classroom computer sometime before your presentation date or you must bring your own laptop, and make sure you know how to project your display on your external monitor port.
These presentations should give a good background on your design choices and the reasons for those choices. It will also be your chance to quickly discuss issues you have had or did have w/ the project.

5. Final Phase Reflections

This is your individual reflection (submitted separately by each group member)

A Note

This is your opportunity to complete specific tasks, but (largely) using your own design decisions and implementation decisions.
The visualizations are your opportunity to think creatively and to think about ways to visualize data structures so that they are useful (and hopefully cool!)
By using those data, you also get a first chance at making something else that kind of looks like the start of an AI system

You will carry out the following steps (not necessarily in order) to bring your project from concept to completion:


Deliverables

Back to shortcuts

Your delivered work should be coherent and reasonably organized.



### Phase 1

Back to shortcuts

Initial information on your group

Have one group member submit to the assignment on Google Classroom:

Your implementation (Code)

readme.md

In your submission, include a readme.md file named readme__GROUPNAME.md that provides a brief statement of your project. Include any important details needed to run your program. Use the markdown format as an opportunity to pretty things up in your readme

Back to shortcuts

Phase 2

Your implementation (Code)

Visualizations

Include your visualizations in the form of image files (.gif, .jpg, .png, etc.)

readme.md

In your submission, include a readme.md file named readme__GROUPNAME.md that provides a brief statement of your project.



Final Phase

Back to shortcuts

Your implementation (Code)

Visualizations

Include any new visualizations you might have made for your revision in the form of image files (.gif, .jpg, .png, etc.)
Also, include all the visualizations that you made for previous phases (but only if those did not change from the revision)

README.md

In your submission, include a readme.md file named readme__GROUPNAME.md that provides a brief statement of your project.

Team Self-Assessment – Every member must submit to Google classroom a document that has an assessment of team work

Point Breakdown

Back to shortcuts

In general, the break down used to grade the final project is as follows:

Phase 1, Worth 50 total points

Graded item Number of points
Initial group information submitted on time 5 pts
Location Tree works as it should (including being an AVL) 10 pts
Crime Tree works as it should (including being an AVL) 10 pts
Presentation 10 pts
Reflection (individual) 5 pts

Phase 2, Worth 75 Total Points

Graded item Number of points
All methods included and work according to instructions 15 pts
dispatch_queue works as it should (including being a MinHeap) 15 pts
dispatch_queue visualization 10 pts
AVL tree visualizations expansion/modification (and expansion/modification explanation) 5 pts
Readme.md 5 pts
Presentation 10 pts
Reflection (individual) 5 pts
Creativity in visualization, implementation, etc. 10 pts

Presentation Rubric

Graded item Number of points
Previous phase solution overview 1 pts
Your solution to the problem posed during this phase 2 pts
Display of Visualizations created for this phase and raionale 2 pts
Discussion of current issues in project 2 pts
Discussion of things learned by each group member up to that point 2 pts
Group presentation time roughly evenly distributed 1 pt

Phase 3, Worth 100 Total Points

Graded item Number of points
Readme.md 15 pts
Final Report 35 pts
Final Implementation 30 pts
Final Project Presentation 15 pts

README.md Rubric

Graded item Number of points
Details on what's needed to run implementation 2 pts
Visualizations included with explanation of each one 2 pts
Explanation of how you tested your code to ensure it works correctly (and thus how anyone else would test it if they picked it up) 1 pts
Police Station Placement Design section 5 pts
Code Refactoring and Revsions section 5 pts

Final Report Rubric

Graded item Number of points
Introduction 5 pts
System Design 10 pts
Discussion 13 pts
Conclusion 5 pts
Grammar/Spelling 2 pts

Final Presentation Rubric

Graded item Number of points
Previous phase solution overview 3 pts
Your solution to the problem posed during this phase 4 pts
Display of Visualizations created for this phase and raionale 2 pts
Discussion of issues faced in project 2 pts
Discussion of things learned by each group member up to that point 2 pts
Group presentation time roughly evenly distributed 2 pt

Final Implementation Rubric

Graded item Number of points
Previous phase solutions still working as required 15 pts
New code and revisions commented well 5 pt
Design of overall code (inheritance, no long methods, etc) 5 pt
New design addresses some particular sociotechnical issues (detail how in README.md) 5 pt

Back to shortcuts

Important Milestones

Back to shortcuts

Date Milestone
08-Nov Project assigned
11-Nov, 12:55pm Group Info Sheet due
15-Nov (in-class) Phase 1 Presentations, Phase 2 assigned
15-Nov 11:55pm Phase 1 Deliverables Due
22-Nov (in-class) Phase 2 Presentations
02-Dec 11:55pm Phase 2 Deliverables Due
09-Dec Final Phase Presentation
10-Dec 11:55pm Final Phase Deliverables Due

Back to shortcuts