Demystifying Machine Learning: How I Learned to Build Models from Scratch

Peter Papuli
4 min readMar 21, 2023

--

(generated using Midjourney V5)

Machine learning has become one of the most exciting and in-demand technologies in recent years, and it is no surprise that more and more people are interested in learning it. Look at all of the crazy and awesome things that companies have been unveiling recently with their new models. From OpenAI’s GPT-4, Microsoft just announcing Copilot, Google’s MusicLM, and so many more, the horizon seems to be buzzing with excitement and competition. However, many beginners believe that machine learning is a difficult subject that requires a master’s or even PhD in computer science or advanced mathematics to understand. Yeah, no. That’s definitely not the case.

As someone relatively new to the field, I found that it was a lot easier than I thought to get into machine learning. I’m not going to lie, it does take some dedication, but as long as you’re open to learning and stick to studying, you can do it. My background was in engineering, so having a good foundation of math made it a bit easier to start working with vectors and matrices. Being willing to understand the foundation of any topic is what really stuck with me from engineering, and the field of AI is super complex so being able to take a step back and understand what’s happening behind the scenes can sometimes be necessary to find out what’s going wrong.

The de facto programming language of choice was Python, which I started learning while working as an engineer. Not knowing really where I wanted to start, but seeing the movement that was happening, it seemed like the right language to learn. It was a good start; Python is notorious for being an easier entry point, so working and learning it seemed somewhat achievable. One mistake I made, though, was trying too early to jump into machine learning and signing up for Andrew Ng’s Machine Learning Specialization on Coursera before I really understood much of the basics. While certainly achievable, it felt too out of reach and so I took a step back and focused on the backbone of any good practitioner: I started out learning as much as I could about data.

some nonsense data :D

Data visualization and analysis helped me hone in on core technical concepts like scraping, wrangling, and storage, while also showing me more of the human side like how to tell a story with the data and making it accessible to any audience. Focusing more on data pipelines while still slowly being exposed to certain machine learning models like k nearest neighbors, and some basic NLP sentiment analysis gave me more insight into what made these models work effectively.

The main thing that really catapulted me from learning about data and theory was retaking Andrew Ng’s upgraded course and immediately starting on a personal project which I could be excited about. It was important for me to work on something that could motivate me. Not only to prevent burnout, but because I wanted something which would make my life easier. Isn’t that what data science is essentially about? Getting the data and making sense of it to make some tasks easier or more straightforward?

So, I started working on a Magic: The Gathering land recommender model from scratch. That meant scraping the data, preprocessing, then creating model architecture and tuning it, then hosting. Kaggle.com gets a lot of deserved recognition when it comes to people looking to get in the field or learn more about modeling, and I think it really can be a good starting point. From my experience though, the majority of work in data science comes from getting good representative data and asking hard questions like: “Do I really need to include this feature?” or “What is the essence of this task, and how can I represent that in data?”. In other words, getting a solid dataset that is representative of whatever model you’re trying to make is around 85%–90% of the work. Comparatively, training and tuning hyperparameters can feel like a breeze.

Not to discount the importance of model building of course. Revolutions have only been made in the field because of the ingenuity and research by countless talented teams. However, more of the importance has been placed in quality and quantity of data than model complexity in recent years. Developments in transfer learning and specialized GPUs made for machine learning workloads has made it so much more achievable for smaller business to reap the benefits of machine learning and create a more balanced and equal playing field.

All in all, while I have come a long way in my journey to learn machine learning, I am excited to continue learning and exploring this rapidly evolving field, knowing that there is still much to discover and achieve. I hope that sharing my experiences and insights can inspire others to pursue their own journey in machine learning, and to embrace the challenge and opportunity of contributing to the ongoing evolution of this fascinating field.

--

--

No responses yet