Inspiration
I am learning Machine Learning course on Coursera taught by Andrew Ng. I had the chance to implement one variable linear regression from scratch with gradient descent using python and numpy library. From then I got an idea of building an interactive graph, where best fit line are predicted in real time instead of the need to use Jupyter Notebook or Excel. I also want to challenge myself to build a machine learning pipeline, from backend to frontend with my software engineering knowledge.
What it does
A website where users can input x and y value, then there's a graph that will graph those values and best fit line is calculated using gradient descent. The calculation will be done by cloud computing Google Cloud. That's the initial plan, but I ran into lots of roadblocks while implementing it so the end result is quite different
How we built it
Frontend is built using React, with Recharts library for graphing. I find Recharts very good when it comes to graphing.
Backend is built using Google Cloud Functions. I like how each Google Cloud Function automatically have an invoke url
Challenges we ran into
The biggest challenge would be using Google Cloud Functions. Since I only need somewhere to run computation problem, Cloud Function with zero server management seems like the best choice. However, this is the first time I work with Google Cloud and Python for web (Flask) as well. The backend ends up not complete. I get the function to work with initial dataset but have trouble processing json data for computation. Therefore, I opted for calculate best fit line following this website: https://machinelearningmastery.com/implement-simple-linear-regression-scratch-python/
Accomplishments that we're proud of
I proud of how I learn Rechart and allow users to modify graph in real time with React using React hooks like useState, useEffect and useContext.
What we learned
I learned a lot about Google Cloud, especially it's Cloud Function. This is my first time working with it so there's lots of roadblocks. I like how each Cloud Function has its own URL to invoke. In addition, installing dependencies in Google Cloud is very easy, you only need to specify it in requirement.txt. However, testing it was tedious, as it needs to be updated and the time it takes to update can be like 3 minutes. I have trouble with Flask and how to use json data for my computation, so it ended up not finished. But I managed to get it to work with initial data set,
What's next for Linear Regression with responsive front end
Learn more about Google Cloud, especially Cloud Functions. Also look up any current Machine Learning implementation to see how I can incorporate them into my project.
Note:
Google Cloud Function code is included in the GitHub repo below. Two important functions that I implemented are compute cost and gradient descent. The code is part of the assignment I did for Linear Regression with gradient descent implementation using numpy. The website is live at https://khainl1110.github.io/HibernationHack/
Log in or sign up for Devpost to join the conversation.