# Objective

*JetBlue Flight Deals* (*JFD*) provides an intuitive viewer powered by efficacious algorithms to surface the best deals in an infinitely scrollable fashion that are relevant to your preferences.

## The *JFD* Stack

*JFD* is powered by the `R` statistical language, utilizing the [R Shiny](http://shiny.rstudio.com) and [R Shiny dashboard](http://rstudio.github.io/shinydashboard/) framework developed by *RStudio* to create an interactive, modular, fast, platform agnostic web application. Prototyping is made simple thanks to the speed of development in `R`, and the ability to use and distribute powerful statistical analyses packages on the central `R` repository, `CRAN`, enable `R` to do even more than just stats, with an infinitely scrollable table powered by the Javascript library [DataTables](http://datatables.net).

## The Dataset

*Jet Blue* provided a sample dataset consisting of their available flight offerings running from October 26, 2015 thru February 29, 2016. Each flight consists of the following information:

* Origin, Destination : three-letter airport codes
* Flight Time : consists of departure date and time
* FareType : "POINTS" and "LOWEST" designated the type of fare described subsequently
* DollarFare, DollarTax or PointsFare, PointsTax : the cost of the given flight
* Flight Type : in this sample dataset, the only type available was "NONSTOP"
* isDomesticRoute, isPrivateFare : domestic and private flight designations

Additionally, a database of annotation corresponding to each airport was made available. Each airport is annotated with the following information:

* MarketGroupName, MarketGroupId : local market group that airport belongs to, whose values include the following: "Mountain/Desert | Northeast | Caribbean | SouthSW | California | Mid-Atlantic"
* GeographicRegionName, GeographicRegionId : a finer version of market, identifies the local geographic region/id that airport belongs to, whose values include the following: ANC | BOS Area | Colombia | Desert West | DR | FLL | Gulf | LA Area | MCO | MidWest | Mtn West | NE Islands | NYC | Other Carrib | Pac NW | PBI | PR | SF Bay | Texas | The South | Upstate | WAS
* DestinationTypeName : the getaway type, which includes: "Family | Nightlife | Exploration | Romance | Beach"

In this dataset, only nonstop, outbound flights were considered, however, all the methods below could be easily extended to account for inbound (return) flights - while multiple stops would require a not inconsequential effort to implement, this would certainly be an avenue worth pursuing for future development.

## The Algorithm

The method behind the flight ranking takes into account a variety and multiples of inputs and their relative importance to one another, ranging from getaway types, specific or regional origin and destination sites and consideration of airports nearby, budget, and desired dates of travel. Our approach provides an infinitely scrollable list of options - but the secret sauce is in taking into account this multitude of potential preferences and weighing them against one another to surface the best possible flights.

### Logistic Scaling of Fuzzy Matches

Our approach looks for exact matches when possible (as in the case of getaway type, region, airport codes), but there are cases where we need to consider the "fuzzy" matches, and how to weight these. For example, let's say we specify that we would like to fly between June 5th and June 10th. If we simply used a binary encoding, we would miss out on a potentially great deal on June 11th or June 4th. However, we don't really care to see anything on May 25th, no matter how good of a deal - that simply would be too far from our desired weights. Similarly, given a budget of $200, we would hate to miss out on a $225 flight that fits all the rest of our preferences!

To address this "close but not quite" problem, we implemented a logistic scaling function to allow for close matches in preferred dates and budgets. This logistic scaling function rapidly decays as it goes outside of the given boundaries - as in the case of preferred dates. For a given budget, this is modified slightly, such that for a cost that exceeds budget, the penalty grows slowly, but then rapidly increases as cost exceeds the budget by $50 to $100. Conversely, as cost goes below a given budget, at first it is of slow benefit, but then rapidly gets "rewarded" the lower the cost goes, representing a steal of a deal.

### Order Importance Scaling

An additional factor to consider is when inputting multiple options, one needs to consider whether they are *unordered* (of equal importance) or *ordered* (ranked from high to low importance). Here, we have taken into account the order by which certain options, such as getaway type or to/from departure info (which could be specific airport codes or geographic regions).

To account for ordering of such preferences, we applied an order importance function which weights the first to last preferences of a given field (such as to *or* from *or* getaways) from high to low importance. To do this, we add together a uniform and exponential distribution, each scaled by (1 -) parameter `Order Importance` (`OI`). This parameter, filed under `Advanced Options`, determines whether the preferences should be treated as unordered (`OI = 0`) thus resembling the uniform distribution, or exponential (`OI = 1`), where the first preferences are highly weighted and lower preferences are heavily penalized. By default, `OI` is set to `0.7`, to allow for a moderate weighting of higher preferences, and thus is represented by a mixture of exponential (`70%`, with a rate of `3`) and uniform (`30%`) distributions.

### Nearby?

Sometimes, your favorite airport might not be the best place to go for the best flight deals - for example, from New Haven, it is equally easy (or difficult) to navigate to either *BDL* or *JFK* or *LGA*. To address this, we have added an option to include nearby airports, leveraging the local geographic region each airport is classified under to cluster them together.

### Preference Importance - Coefficients

For cases where some preferences may be more important than others, the `Coefficients` under `Advanced Options` allows for the ultimate tweaking of our algorithm. For cases where the departure date is an absolute must, and everything else is secondary, the user can tweak up the coefficient for `Depart Date`, or if budget is of no concern, this can be set to `0`.

### Infinitely Scrollable & Rapidly Updateable

Any good algorithm must provide results post haste, and to that end, our solution provides an infinitely scrollable ranking of pertinent flight results, and rapidly updates upon any tweaks to the settings made therein.

## Happy Deal Hunting!

Thanks for trying our app!
Plenty of people hope to travel and explore the world, and it's no surprise that traveling often ends up on bucket lists. However, flights are expensive, and trying to figure out when and to where airline tickets will be cheapest is exhausting.

Our project, Dream-Flight, hopes to make this process easier. By creating a visualization of flight prices and data, we hope to make planning those dream trips simpler. Dream-Flight allows the user to enter their departure location, as well as easily adjustable departure dates, travel duration, and budget. With just a few simple steps, users will see a mapped visualization of airports all over the world that offer flights that fit their travel criteria, marked by circles whose color reflects price point and size reflects destination popularity.

The flight visualization provides a crystal clear view of price points for flights to different locations at different times with just a quick glance. Whether it's a Spring Break vacation with friends, a trip to visit family, or an exploration abroad, finding a dream travel destination becomes easier with Dream-Flight!

Visit <https://dream-flights.herokuapp.com/main.html> to see Dream-Flight in action!

To check out our repo, please visit our GitHub: <https://github.com/PaliC/Dream-Flight>
## Inspiration 💡

*An address is a person's identity.*

In California, there are over 1.2 million vacant homes, yet more than 150,000 people (homeless population in California, 2019) don't have access to a stable address. Without an address, people lose access to government benefits (welfare, food stamps), healthcare, banks, jobs, and more. As the housing crisis continues to escalate and worsen throughout COVID-19, a lack of an address significantly reduces the support available to escape homelessness.

## This is Paper Homes: Connecting you with spaces so you can go places. 📃🏠

Paper Homes is a web application designed for individuals experiencing homelessness to get matched with an address donated by a property owner.

**Part 1: Donating an address**

Housing associations, real estate companies, and private donors will be our main sources of address donations. As a donor, you can sign up to donate addresses either manually or via CSV, and later view the addresses you donated and the individuals matched with them in a dashboard.

**Part 2: Receiving an address**

To mitigate security concerns and provide more accessible resources, Paper Homes will be partnering with California homeless shelters under the “Paper Homes” program. We will communicate with shelter staff to help facilitate the matching process and ensure operations run smoothly.

When signing up, a homeless individual can provide ID, however if they don’t have any forms of ID we facilitate the entire process in getting them an ID with pre-filled forms for application. Afterwards, they immediately get matched with a donated address! They can then access a dashboard with any documents (i.e. applying for a birth certificate, SSN, California ID Card, registering address with the government - all of which are free in California). During onboarding they can also set up mail forwarding ($1/year, funded by NPO grants and donations) to the homeless shelter they are associated with.

Note: We are solely providing addresses for people, not a place to live. Addresses will expire in 6 months to ensure our database is up to date with in-use addresses as well as mail forwarding, however people can choose to renew their addresses every 6 months as needed.

## How we built it 🧰

**Backend**

We built the backend in Node.js and utilized express to connect to our Firestore database. The routes were written with the Express.js framework. We used selenium and pdf editing packages to allow users to download any filled out pdf forms. Selenium was used to apply for documents on behalf of the users.

**Frontend**

We built a Node.js webpage to demo our Paper Homes platform, using React.js, HTML and CSS. The platform is made up of 2 main parts, the donor’s side and the recipient’s side. The front end includes a login/signup flow that populates and updates our Firestore database. Each side has its own dashboard. The donor side allows the user to add properties to donate and manage their properties (ie, if it is no longer vacant, see if the address is in use, etc). The recipient’s side shows the address provided to the user, steps to get any missing ID’s etc.

## Challenges we ran into 😤

There were a lot of non-technical challenges we ran into. Getting all the correct information into the website was challenging as the information we needed was spread out across the internet. In addition, it was the group’s first time using firebase, so we had some struggles getting that all set up and running. Also, some of our group members were relatively new to React so it was a learning curve to understand the workflow, routing and front end design.

## Accomplishments & what we learned 🏆

In just one weekend, we got a functional prototype of what the platform would look like. We have functional user flows for both donors and recipients that are fleshed out with good UI. The team learned a great deal about building web applications along with using firebase and React!

## What's next for Paper Homes 💭

Since our prototype is geared towards residents of California, the next step is to expand to other states! As each state has their own laws with how they deal with handing out ID and government benefits, there is still a lot of work ahead for Paper Homes!

## Ethics ⚖

In California alone, there are over 150,000 people experiencing homelessness. These people will find it significantly harder to find employment, receive government benefits, even vote without proper identification. The biggest hurdle is that many of these services are linked to an address, and since they do not have a permanent address that they can send mail to, they are locked out of these essential services. We believe that it is ethically wrong for us as a society to not act against the problem of the hole that the US government systems have put in place to make it almost impossible to escape homelessness. And this is not a small problem. An address is no longer just a location - it's now a de facto means of identification. If a person becomes homeless they are cut off from the basic services they need to recover.

People experiencing homelessness also encounter other difficulties. Getting your first piece of ID is notoriously hard because most ID’s require an existing form of ID. In California, there are new laws to help with this problem, but they are new and not widely known. While these laws do reduce the barriers to get an ID, without knowing the processes, having the right forms, and getting the right signatures from the right people, it can take over 2 years to get an ID.

Paper Homes attempts to solve these problems by providing a method for people to obtain essential pieces of ID, along with allowing people to receive a proxy address to use.

As of the 2018 census, there are 1.2 million vacant houses in California. Our platform allows for donors with vacant properties to allow people experiencing homelessness to put down their address to receive government benefits and other necessities that we take for granted. With the donated address, we set up mail forwarding with USPS to forward their mail from this donated address to a homeless shelter near them.

With proper identification and a permanent address, people experiencing homelessness can now vote, apply for government benefits, and apply for jobs, greatly increasing their chance of finding stability and recovering from this period of instability

Paper Homes unlocks access to the services needed to recover from homelessness. They will be able to open a bank account, receive mail, see a doctor, use libraries, get benefits, and apply for jobs.

However, we recognize the need to protect a person’s data and acknowledge that the use of an online platform makes this difficult. Additionally, while over 80% of people experiencing homelessness have access to a smartphone, access to this platform is still somewhat limited. Nevertheless, we believe that a free and highly effective platform could bring a large amount of benefit. So long that we prioritize the needs of a person experiencing homelessness first, we will able to greatly help them rather than harming them.

There are some ethical considerations that still need to be explored:

We must ensure that each user’s information security and confidentiality are of the highest importance. Given that we will be storing sensitive and confidential information about the user’s identity, this is top of mind. Without it, the benefit that our platform provides is offset by the damage to their security. Therefore, we will be keeping user data 100% confidential when receiving and storing by using hashing techniques, encryption, etc.

Secondly, as mentioned previously, while this will unlock access to services needed to recover from homelessness, there are some segments of the overall population that will not be able to access these services due to limited access to the internet. While we currently have focused the product on California, US where access to the internet is relatively high (80% of people facing homelessness have access to a smartphone and free wifi is common), there are other states and countries that are limited.

In addition to the ideas mentioned above, some next steps would be to design a proper user and donor consent form and agreement that both supports users’ rights and removes any concern about the confidentiality of the data. Our goal is to provide means for people facing homelessness to receive the resources they need to recover and thus should be as transparent as possible.

## Sources

[1](https://www.cnet.com/news/homeless-not-phoneless-askizzy-app-saving-societys-forgotten-smartphone-tech-users/#:%7E:text=%22Ninety%2Dfive%20percent%20of%20people,have%20smartphones%2C%22%20said%20Spriggs)

[2](https://calmatters.org/explainers/californias-homelessness-crisis-explained/)

[3](https://calmatters.org/housing/2020/03/vacancy-fines-california-housing-crisis-homeless/)