Giter VIP home page Giter VIP logo

best-places-to-live-ds's Introduction

1️⃣ Best Places to Live -- Data Science Portion

You can find the complete project at Live in the Best Place.

The DS portion of this project found in this repo is a Python Flask API

5️⃣ Contributors

🚫Add contributor info below, make sure add images and edit the social links for each member. Add to or delete these place-holders as needed

Justin Hsieh Michael Curry Student 3 Student 4 Student 5

MIT

Project Overview

1️⃣ Trello Board

1️⃣ Product Canvas

The Best Places to Live website and app is a single resource to allow users to weigh all their factors of moving to a new city at once. It creates comparisons between cities based on a user's factors to help user's decision. The goal is for it to be fun and engaging for the user while minimizing the amount of time spent researching cities.

The Data Science portions of this project can be lumped into three stages:

  1. A city sorting model based upon user input factors
  2. Data Visualization for each city with compare-city functionality.
  3. Bonus features -- cholopleth & heat maps; a tender-style swipe features for finding that perfect city match.

Tech Stack

  • Python
  • Heroku

2️⃣ Predictions

The model of our flask API takes in a JSON as a POST request in the format:

Sample input:

{
"input1": ["population", "avg_commute_time"]
}

The input comes from users at the Front-End. They select any number of the displayed factors as important in deciding a new home city. The DS flask API then returns another JSON with 20 cities in format:

{
    "name": "New York City, NY",
    "photoMobile": <url>,
    "photoWeb": <url>,
    "population": 8175133.0,
    "geohash": 9whpt4gjbqfngtthkk9f
  },

These 20 cities are ranked in order of best fit based upon user selected factors.

The city ranking function within our model works with pandas operations on a small csv found in the home directory of the flask API. The data-frame itself is composed of the following features: 133 possible city ranking factors; names of cities; location data; photo urls. Each row represents one of the top 256 largest cities in the United States.

The numerical data for the 133 factors have been transformed using df.rank() on a scale of 0 to 1. This flattens the distribution (see below) of each numeric feature such that each factor when compared to others are on the same scale. Factors that are negatively coorilated to rank (e.g. commute time) have been reverse-ranked.

The rankify() function works by filtering the dataframe by user selected factors. After filtering, only the top quantile of all factors selected by the user remain. The overall score of each city is calculated by taking the mean of the user selected factor by row. Finally the overall scores are sorted in descending order, and the top 20 city matches are added to the JSON along with location, population, and a photo url as above.

Data Sources

Python Notebooks

[Data Wrangling / Methodology]https://colab.research.google.com/drive/1FHGibP9lyn1ZSdwtL7arVHsR9QNFae2j)

3️⃣ How to connect to the web API

The url for the API is: https://best-places-api.herokuapp.com/api

3️⃣ How to connect to the data API

Sumbit a POST request to: Python Flask API

In the format:

{
"input1": ["population", "avg_commute_time", "<any number of valid factors>"]
}

API Returns JSON in the format:

{
    "name": "<city name>, <state>",
    "secure_url": <photo_url>,
    "population": <city population>,
    "geohash": <geohash number>
  },

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct. Please follow it in all your interactions with the project.

Issue/Bug Request

If you are having an issue with the existing project code, please submit a bug report under the following guidelines:

  • Check first to see if your issue has already been reported.
  • Check to see if the issue has recently been fixed by attempting to reproduce the issue using the latest master branch in the repository.
  • Create a live example of the problem.
  • Submit a detailed bug report including your environment & browser, steps to reproduce the issue, actual and expected outcomes, where you believe the issue is originating from, and any potential solutions you have considered.

Feature Requests

We would love to hear from you about new features which would improve this app and further the aims of our project. Please provide as much detail and information as possible to show us why you think your new feature should be implemented.

Pull Requests

If you have developed a patch, bug fix, or new feature that would improve this app, please submit a pull request. It is best to communicate your ideas with the developers first before investing a great deal of time into a pull request to ensure that it will mesh smoothly with the project.

Remember that this project is licensed under the MIT license, and by submitting a pull request, you agree that your work will be, too.

Pull Request Guidelines

  • Ensure any install or build dependencies are removed before the end of the layer when doing a build.
  • Update the README.md with details of changes to the interface, including new plist variables, exposed ports, useful file locations and container parameters.
  • Ensure that your code conforms to our existing code conventions and test coverage.
  • Include the relevant issue number, if applicable.
  • You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.

Attribution

These contribution guidelines have been adapted from this good-Contributing.md-template.

Documentation

See [Backend Documentation](link to your backend readme here) for details on the backend of our project.

See [Front End Documentation](link to your front end readme here) for details on the front end of our project.

best-places-to-live-ds's People

Contributors

justin-hsieh avatar mikedcurry avatar bkrant avatar christianipanaque avatar tactnician avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.