Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.

Commit 697adaa

Browse files
committed
Add assignment3, template and sample proposal from SP CS41
1 parent 275e90d commit 697adaa

File tree

4 files changed

+262
-0
lines changed

4 files changed

+262
-0
lines changed

Assignment3/README.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Assignment 3: Final Project!
2+
3+
## The Proposal
4+
5+
_Due: Monday, April 29th at 11:59:59 PM_
6+
7+
As discussed in class, the purpose of the project proposal is for the course staff to ensure that the project is well-scoped and incorporates Python in some meaningful way. We can also suggest useful packages for your project. The more detailed your proposal, the more we can assist you by pointing you away from common pitfalls and towards feasible solutions.
8+
9+
As a team, submit your project proposal named `proposal.md` using [OK course website](https://okpy.org/koc/pcp/sp19/). You can use [`template.md`](https://github.com/koltpython/python-assignments/blob/master/Assignment3/template.md) as a starting template for your proposal. You can access the raw markdown [here](https://raw.githubusercontent.com/koltpython/python-assignments/master/Assignment3/template.md) or just copy-paste into VS Code to edit. See [`sampleproposal.md`](https://github.com/koltpython/python-assignments/blob/master/Assignment3/sampleproposal.md) for an example of what we're looking for. Additionally, we've added some ideas to [`ideas.md`](https://github.com/koltpython/python-assignments/blob/master/Assignment3/ideas.md) if you're stuck. When we review your proposals, we'll look at the most recently added proposal.
10+
11+
_Note: you can use late days on the project proposal, but hopefully you will complete the proposal on time so that we can get feedback to you sooner._
12+
13+
## The Project
14+
15+
_Due: Wednesday, May 15th at 11:59:59 PM_
16+
17+
Implement the project you have proposed, incorporating our feedback. You are free to begin working on the project before you hear from us.
18+
19+
### Development Strategy and Hints
20+
21+
Have a plan. We're making you submit a project proposal so that you think about potential challenges and your plan to overcome them.
22+
23+
Start small and iterate quickly. Python, unlike many other languages, allows you to rapidly iterate. Consider developing your code in small steps using the interactive interpreter.
24+
25+
Build incrementally and test frequently! This project will likely be the largest Python project you have written so far, so make sure each task works before moving on!
26+
27+
You will use a big portion of remaining class time to work on your projects. Use this time to work with your team and ask your questions aggressively on class time. Detailed information about schedule and location will be announced.
28+
29+
Without the structure of a usual assignment, it can be easy to get stuck for a long time on seemingly trivial tasks. I promise that even the most trivial-seeming tasks can be the most difficult! Hopefully, the course staff will be able to help you get unblocked! We may not know the details of every library and dataset you use, but we can certainly try to help.
30+
31+
### Deliverables
32+
33+
In addition to submitting your code (and everything that goes with it), you must include a `README.md` file as a meaningful writeup of your final project.
34+
35+
This writeup should contain a technical overview of the project and the code therein. In effect, you're writing documentation for your project - if the first thing someone reads about your project is the README, what information does she need to know? We're asking you to also include a technical section in your README to describe the code design, the purpose of various modules, and any requirements (e.g. must run a certain version of Python, or must have a particular operating system, or must have a Postgres database running, or must have a Google account, or anything else).
36+
37+
In addition, we're asking you to write short installation/execution instructions. After we download your code, what steps do we have to perform to get it up and running? For many projects, the answer will just be "run the main python script named `something.py`," but several others will have more complex configuration. If we can't set up your project, we have no way to confirm that your project works, so we hope that your installation instructions are clear, correct, replicable, and concise.
38+
39+
Other general sections of a README usually include, but are not limited to: known bugs, contact information for the maintainer (that's you!), and credits/acknowledgements.
40+
41+
There is no upper or lower limit to the length of the README. We've had successful README's in the past that are as short as a few hundred words, or some much longer, with the longest being around 2000 words. Regardless, the majority of the writeup should focus on the technical overview. You're free to write fewer or more words as you see fit, but remember that we are reading your README to understand what your project does.
42+
43+
_Video Supplement to README._
44+
45+
If you are comfortable with it, record a video of your final project in action and include it in the final submission. We'll watch this video to get a sense for what your project does. It can be a fun way to immortalize the work you've done and show us a working demo! You should narrate what we're seeing in the video, describing the features and technical overview that would otherwise be in the README.
46+
47+
Moreover, we want this video to be a conversational, informal way to show off what you've built! Don't worry if the production quality isn't good, or if your roommate walks in on you in the middle, or if you get some weird message notification.
48+
49+
Mechanically, you can [record your screen on a Mac with QuickTime Player](https://support.apple.com/en-us/HT201066#record), or you can just record a video on your phone.
50+
51+
### Starter Code
52+
53+
For this assignment, we are not explicitly providing any code to you.
54+
55+
You are free to use any builtin modules, publicly available code, or any code you find online, as long as you cite it appropriately. Google and StackOverflow are your friends! The chances are high that someone has built a library to help with your project, so make sure to ask us or search before reinventing the wheel!
56+
57+
You may _not_ use proprietary code, code which requires a paid license, anything which promotes illegal activity, anything which violates Stanford policies, etc.
58+
59+
## Grading
60+
61+
The project _proposal_ grade will be assessed purely on completion. Did you do it? Great! If not - less great.
62+
63+
Your final project grade will be assessed on both functionality and style.
64+
65+
Functionality will be determined holistically using a combination of difficulty of project and success of execution. Unfortunately, that's as detailed as we can get given the breadth of possible topics. In effect, if you put in your fair share of effort, we'll be reasonable. =)
66+
67+
Stylistically, as always, you'll be assessed on three main categories:
68+
69+
- **Pythonic practices:** Proper use of the Python tools and ways of thinking introduced in this class. Show us that you've learned how to think like a Python programmer!
70+
- **Program design:** General programming style - decomposition, commenting, logic, algorithm design, etc.
71+
- **Python mechanics:** Basically everything covered in PEP8 - naming, spacing, parenthesizing, etc.
72+
73+
We hold the final project to a higher standard of style than the assignments, since it's naturally more freeform. Make sure that your code is something that you are proud showing off!
74+
75+
## Submitting
76+
77+
Submission format will be announced soon!
78+
79+
**WARNING: If you use any third-party libraries, ensure that you have generated a `requirements.txt` file listing your project's dependencies before submitting. You can do this by putting the output of `$ pip freeze` into a file. When exercising your code, we guarantee that we will run `$ pip install -r requirements.txt` to install this list of dependencies.**
80+
81+
If your project is sufficiently convoluted, make sure to add the corresponding clarifying information in your README file.

Assignment3/ideas.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Potential Project Ideas
2+
3+
## Stuck?
4+
5+
_Here are some suggestions_
6+
7+
If you're totally stuck, it can help to think through your answers to the following questions.
8+
9+
What categories of stuff are you interested in? Machine learning? Sports? Food? Fashion? Music? Dev tools? Photography? Healthcare? Social media? Video games? Sleeping? Board games? Theater? Biophysics? Algorithms? Systems? Automation? AI? etc.
10+
11+
What data is available? Census data? Genome data? API data? Survey data? etc.
12+
13+
What problems do you care about? Healthcare? Food insecurity? Education? Climate change? Divestment? Mental health? Politics? etc.
14+
15+
You can do almost anything you would like to!
16+
17+
## Random Ideas
18+
19+
_Miscellaneous ideas that we thought of over the course of the quarter._
20+
21+
2-Step Auto-Authenicator - who needs security? automatically 2-step-authenticate all messages from a certain sender.
22+
23+
Pizza Button - a hardware button that when pressed will use my credit card info to deliver Domino's directly to the dorm room.
24+
25+
astparse - check for similarity between python code by looking at the ASTs
26+
27+
stamp - convert spotify playlists to apple music playlists and back
28+
29+
herowid - using the erowid database, a huge set of experiences of people on a variety of illegal drugs, classify a person's substance abuse based on their speech or text patterns
30+
31+
xl2py - an excel spreadsheet to python converter, with reference resolution and everything
32+
33+
facegraph - scrape all facebook chats with a given person and generate visualizations and analytics of your lifetime conversation
34+
35+
quarto AI - AI to play a hyper-tic-tac-toe game
36+
37+
codenames AI - AI using NLP to suggest a clue that is very similar to one set of words but very different from another set of words
38+
39+
wireframe visualizer - build a project that visualizes 3D graphics using raytracing
40+
41+
convex optimizer - generic convex optimizations on sufficiently constrained problems
42+
43+
## Previous Proposals
44+
45+
_List of proposals from last quarter's final projects of Stanford's CS41. This list exists to show you the incredible breadth of projects that are possible!_
46+
47+
Bach - Programming a Python-based piano interface with various musical capabilities.
48+
49+
NoNonsense.py - scrape the genome of a new organism and return all the genes that will need to be changed, as well as all suggested primers to design to convert this to a viable system for nonsense suppression.
50+
51+
TeaWithStrangers - When given a group of people and their survey answers, the program will output clusters of people based on common interests with optimized probability of great conversations and new friendships.
52+
53+
RaspiTrack.py - Implementing a small number of computer vision algorithms in Python using a Raspberry Pi and a RPi Camera module, specifically focused on detecting circular objects, including edge-detection (Canny), k-means, and blob detection.
54+
55+
Tweet Analyzer - scrapes Tweets based on a hashtag and performs sentiment analysis
56+
57+
Hearts - Programming a Python-based interface for the game Hearts.
58+
59+
Kaggle.py - Participate in a Kaggle competition using Python
60+
61+
Juke - desktop jukebox application, allowing a user to create a playlist then people in proximity will be able to queue songs from their laptops onto the playlist
62+
63+
Fantasy Football Trade Generator - propose mutually beneficial trades between teams in any fantasy football league.
64+
65+
Dexcom Data Visualizer - suite that parses Dexcom data to create useful visualizations and metrics using Python.
66+
67+
MashedHeadlines.py - Twitter bot that will mash together two headlines and tweet them every hour
68+
69+
Random Rapper - version of the random writer project from CS106B that scrapes rap lyrics from the lyrics website Genius.com to generate random, rap-like output.
70+
71+
> Credits: Prepared by Sam Redmond(@sredmond) from Stanford University, instructor of CS41.

Assignment3/sampleproposal.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Sous Chef
2+
3+
> Ahmet Uysal (auysal16) Sam Redmond (sredmond)
4+
5+
## Overview
6+
7+
We want to build a program that suggests (and generates) recipes given a set of ingredients to include and exclude.
8+
9+
## Background
10+
11+
There are lots of recipe websites on the internet, where you can search for a term like "pie" and you'll get back a list of pies. Usually, there are lots of good utilities in place to search the results in various ways - by price of ingredients, by total preparation time, etc. However, the results are determined only by the query string.
12+
13+
We want to let a user supply a set of ingredients to include and exclude - say, ingredients they already have in their kitchen and allergens, respectively - and then we suggest highly-rated recipes that use or focus on those ingredients. Perhaps they can restrict the results to dishes with only the specified ingredients in case they _really_ don't want to go to the market. Hopefully, we can also use some machine learning techniques to generate new recipes centered on the given ingredients using a variant of k-nearest neighbors and a few hand-chosen heuristics.
14+
15+
## Implementation Strategy
16+
17+
Our project falls into three major categories - scraping the data, interacting with the user, and computing recipes to output to the user.
18+
19+
First, we're going to scrape the [BigOven API](http://api2.bigoven.com/web/documentation), which has over 350,000 recipes. We'll put all of the recipes into a big database so that we can efficiently query it later. For this part, we're going to rely extensively on the `requests` module discussed in class - and perhaps some of the multiprocessing primitives in the standard library to speed up the download. There's also [Food2Fork API](http://food2fork.com/about/api) which has over 200,000 recipes if we need more data points. Lastly, we could always scrape the HTML of other common recipe sites like allrecipes.com.
20+
21+
To interact with the user, we're going to have a simple text-based I/O system where the user enters the ingredients one at a time and then signals when done. We'll then output a bunch of recipes for the user to choose from.
22+
23+
To actually compute the best recipes, we'll simply filter out all the recipes that _don't_ contain the desired ingredients or _do_ contain the undesired ingredients. Of the remaining recipes, we'll sort them on a combination of relevance to the original ingredient suggestions and overall ratings. We plan to use the awesome pandas library for better data manipulation of the recipes in raw Python.
24+
25+
## Tasks
26+
27+
1. Authenticate to the BigOven API
28+
2. Download all of the recipes into a database
29+
3. Load the recipes into Python Recipe class and Cookbook class
30+
4. Main loop that asks user for ingredients and returns recipes using the class interface
31+
5. Match ingredient names to names in recipes to filter bad recipes
32+
6. Sort remaining recipes by a "good" heuristic (we'll need to try a lot of heuristics)
33+
7. _(Stretch)_ Use common food substitutions and word misspellings for more flexible user input (i.e. buter -> butter, pop -> soda)
34+
8. _(Stretch)_ Map the recipes into a high-dimensional vector space and run clustering algorithms to find the best-matching recipes
35+
9. _(Stretch)_ Integrate with Instacart so that any missing ingredients can get automatically delivered
36+
37+
Honestly, the only part we're worried about is the actual algorithm of choosing the best matching recipes. Can a naive algorithm do "well enough," or do we need to incorporate ML techniques to get reasonable results? We're fairly confident that we can scrape the recipe data and do the console I/O.
38+
39+
### Estimated Timeline
40+
41+
**(Core)**
42+
43+
- Task 1 (1 hours) - both
44+
- Task 2 (2 hours) - both
45+
- Task 3 (0.5 hours) - Ahmet
46+
- Task 4 (1 hours) - Sam
47+
- Task 5 (1 hours) - Sam
48+
- Task 6 (3 hours) - both
49+
50+
**(Stretch)**
51+
52+
- Task 7 (1.5 hours) - Sam
53+
- Task 8 (4 hours) - Ahmet
54+
- Task 9 (5 hours) - Sam
55+
56+
We've made a little progress on Task 1 (we acquired an API token), but we haven't used it to connect to the API endpoint yet.
57+
58+
## Resources
59+
60+
All of our data is going to come from the APIs described above, but we're also going to hand-code some test recipes for small data sets to make sure the general logic is working.
61+
62+
> Credits: Prepared by Sam Redmond(@sredmond) from Stanford University, instructor of CS41.

Assignment3/template.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Project Title
2+
3+
> Team Member 1 (KU Username 1) ,Team Member 2 (KU Username 1) [, and Team Member 3 (KU Username 1) ] ]
4+
5+
## Overview
6+
7+
_This section should be on the order of a few (1-2) sentences. After reading this, we should have a general sense of your final project topic._
8+
9+
At a high-level, what do you propose to work on for your final project?
10+
11+
## Background
12+
13+
_This section should be on the order of a few (1-2) paragraphs. If your project is highly domain-specific, this section may be longer._
14+
15+
Give us some context for your project. We may not be as informed about the topic as you are. Why are you excited about this topic? Do you have any experience with projects like this? What effects could this project have on the outside world?
16+
17+
## Implementation Strategy
18+
19+
_This section should be on the order of a few (2-3) short paragraphs, and captures your current program design._
20+
21+
At a high-level, how do you plan to implement your project? How does it incorporate Python?
22+
23+
What are the main pieces that your projects breaks down into?
24+
How do these pieces connect to each other? If they share data in some way, how?
25+
26+
Which Python packages do you plan to work with? How will these external modules connect to the code you write?
27+
28+
## Tasks
29+
30+
_This section is the most important because it gives us a sense of the scope of your project and forces you to think about the deliverables to which you'll hold yourself._
31+
32+
Break down your project into a sequence of small tasks that you can feasibly accomplish to incrementally build towards a complete working project.
33+
34+
Include at least three stretch goals. A _stretch goal_ is an extension that you think would be really awesome, but would probably be outside the scope of the final project.
35+
36+
What tasks do you think will be easy? What tasks do you think will be hard? Tedious? Trivial? Give us a sense of your current outlook on these project tasks.
37+
38+
Annotate each of the tasks (including stretch goals) with an estimate for how long you believe the task will take you. Also annotate each task with the names of anyone responsible for the task.
39+
40+
If you've already accomplished some of the tasks, make a note of it! If you're incorporating a final project for another class into this final project, you'll be held to a higher standard of quality and quantity, so make a note of that too.
41+
42+
This task list isn't binding - you can change your mind, modify tasks, etc - but it's a good starting point to organize incremental development.
43+
44+
## Resources
45+
46+
_This section is smaller and less vital than the others. If you're not using any external resources, you can leave this blank._
47+
48+
What external resources will you be working with? If you are working with a dataset, how will you acquire the data set? If you're publishing some project (e.g. web app), how will you host your project? If your project requires hardware, how will you get it? Are there any other resources you need to acquire before starting?

0 commit comments

Comments
 (0)