- Prof. Dancy's Site - Course Site -
Phase 1
Phase 2
Final Phase
Project Point Breakdown
Project Milestones & Dates
Teams of three or four students
Teams will be assigned by Prof. Dancy
Due-Dates:
- (Team info on Classroom): 08-Nov
- Phase 1: 15-Nov (11:55pm)
- Phase 1 presentations on 15-Nov (in class)
- Phase 2: 22-Nov (11:55pm)
- Phase 2 presentations on 22-Nov (in class)
- Final Phase: 10-Dec (11:55pm)
- Final presentations on 09-Dec (in class)
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.
The Chief made this back of the napkin drawing to help you think about what he envisions as the final system (the Decision Engine)
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.
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.
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:
key
of the payload and some priority ranking as the value
payload
key
and matches those keys to some priority ranking (value
) to provide alternative priorities (e.g., if you want to use several factors to combine priorities to make a decision)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.
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:
Matplotlib
and Networkx
. This looks like it might be one of the more straight-forward examples of how to use these two to create a top-down tree visualization.If you're talking about general drawing (e.g., drawing other aspects of those data you have):
Matplotlib
works well enoughR
statistical package/language, the python version might be interesting to you as well, though the others might be a bit more updated & thus feature-richHow should I design my viz? What should my visualization convey?
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
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:
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:
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:
string
to be entered that represents a 911 dispatch the format will come in as follows:
"ID, Case, Number, Date, Block, IUCR, Primary, Type, Description, Location Description, Arrest, Domestic, Beat, District, Ward, Community, Area, FBI Code, X Coordinate, Y Coordinate, Updated On, Latitude, Longitude"
← stringtuple
of 4 latitude-longitude tuples
that effectively give us four corners of an area to patrol.
((41.8763889,87.6216667), (41.6944444,87.6216667), (41.6944444,87.6205556), (41.8763889,87.6205556))
But how should you make these decisions?
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:
key
value
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 extract
ing 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?
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
key
should be the overall priorityvalue
should be a representation of location that would allow you to return "A tuple of length 4 that represents the 4 points of an area to patrol"
As with Phase 1, you will need to create a visualization for Phase 2.
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!
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)
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:
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:
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!)
For this phase, you will need to read and respond to (in your report & code revision) 3 different articles/Book chapters
This chapter will introduce you to some ideas on "Big Data" and the criminal justice system
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)
This article will introduce you to some racial issues with regards to policing (and cite some research in that regard).
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?
README.md
, provide a section titled Code Refactoring and Revsions
that deails the changes you makeIn 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
README.md
provide a section titled Police Station Placement Design
. I want you to come up with a general design and algorithm (complete with what data structures you would use in this algorithm) to pick where to place police stations. This section should be written close to the end (i.e., after you read the above reading and complete any revisions to your code)
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:
Introduction
System Design
Discussion
Conclusion
References
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.
This is your individual reflection (submitted separately by each group member)
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
Get to know your team. Teams will consist of three (or four) people & I will require that everyone speaks equally during the presentations and can explain any part of the work (within reason).
The team will work together to decide on a particular way to approach the above problem. It's up to you to communicate effectively so that you can work well as a team
I will work with teams to check on the status and get estimates of time for the completion of the project. While I will be available to try to make sure you don’t go off into a barren desert, and can help point you to resources if you wish to use a method that we have not gone over, the point of this Final project is to give you a bit of freedom to explore things, while still using some of the things we've learned in 204.
Your delivered work should be coherent and reasonably organized.
Have one group member submit to the assignment on Google Classroom:
ChicagoCrimeFun
class file, which should be named ChicagoCrime__GROUPNAME.py
where GROUPNAME
is the name of your groupIn 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
ChicagoCrimeFun
class file, which should be named ChicagoCrime__GROUPNAME.py
where GROUPNAME
is the name of your groupFILENAME__GROUPNAME.py
where GROUPNAME
is the name of your groupInclude your visualizations in the form of image files (.gif
, .jpg
, .png
, etc.)
In your submission, include a readme.md file named readme__GROUPNAME.md
that provides a brief statement of your project.
ChicagoCrimeFun
class file, which should be named ChicagoCrime__GROUPNAME.py
where GROUPNAME
is the name of your groupFILENAME__GROUPNAME.py
where GROUPNAME
is the name of your groupInclude 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)
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
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 |
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 |
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 |
Graded item | Number of points |
---|---|
Readme.md | 15 pts |
Final Report | 35 pts |
Final Implementation | 30 pts |
Final Project Presentation | 15 pts |
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 |
Graded item | Number of points |
---|---|
Introduction | 5 pts |
System Design | 10 pts |
Discussion | 13 pts |
Conclusion | 5 pts |
Grammar/Spelling | 2 pts |
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 |
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 |
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 |