Skip to content

chocojazz/treehacks-2018

Repository files navigation

ethinvest

TreeHacks 2018

Inspiration

Child labor, unsanitary working conditions, low wages, and so many more forms of worker exploitation occur every single day. The goal of reducing this labor exploitation inspired us to come up with novel ways to incentivize companies to have ethical practices. In this vein, we built ethinvest, a platform for users to invest in companies known to be ethical.

What it does

Ethinvest uses machine learning to recommend stocks and provide data on companies with high ethics quotients. Users can find the most lucrative (and ethical!) companies to invest in, explore real-time stock prices, and view graphs visualizing stocks over time, all from within the web app.

How we built it

To recommend the most lucrative stocks, we used machine learning algorithms on the most recent real-time stock data. We tested models ranging from complex neural networks and SVRs to basic linear regression. Ultimately, we optimized exponential moving averages to use multiple-length windows concurrently, drawing insights on whether the stock will do better or worse in the next tick based on their crossover. We were actually able to reduce the mean squared percent error to just 2.36%! We listed the five companies whose predicted stock prices were greatest relative to their prices in the previous tick as "recommended."

In terms of data, we analyzed the Ethisphere EQ dataset to find companies known to be ethical, as rated on a combination of several factors related to the social good. We used the Yahoo Finance API to find the companies' corresponding tickers, and we integrated the Alpha Vantage API to get the respective companies' real-time stock data.

We built out the actual web app using jQuery, JavaScript, HTML, and CSS. The machine learning was conducted in Python in Jupyter Notebooks with scikit-learn.

Challenges we ran into

We ran into three main challenges: debugging the Yahoo API, building a suitable model for stock recommendation, and ideation. The Yahoo API was surprisingly difficult to integrate, and we were finally forced to hard-code the list of tickers generated by the Yahoo API into the Alpha Vantage API. Stock recommendation is a complex problem, and although we found an elegant, extremely effective solution, the process involved many iterations, where much more complex models performed more poorly than expected. Ideation is of course a common challenge at any hackathon, and we pivoted multiple times until we reached our final product (our initial idea was actually to detect anomalies in x-ray data).

Accomplishments that we’re proud of

We built a really cool web app with a concrete social impact!

What I learned

All of us are from a variety of backgrounds, and we all got a chance to experiment with technologies we weren’t previously familiar with. We each worked on machine learning, front-end, back-end, and everything in between.

What's next for ethinvest

In the future, we hope to provide further incentives for people to invest in ethical companies. Finding creative ways to incentivize ethical practices is a key problem that society must address together, and we would love to contribute to this noble ambition.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published