Fixing the Conflict Between Math and Machine Learning

Ashik Shaffi
The Startup
Published in
5 min readNov 18, 2020

--

The evergreen question when someone into Machine learning is

Do I need to know Math for Machine Learning?

I suck at Math, can I able to pursue ML ( Machine Learning ) still?

The blog is solemn of my takeaways and being practicing ML 6 months for now. So whatever is up to from now take it as a grain of salt, remember if it doesn’t work, you can always shift the boards and try another way.

It all started with an Internship, I asked a guy who works there, Where should I do start to learn Machine Learning?

He smiled and gave me a Big Statistics book I have ever seen ( didn’t give me literally ). I was confused, a guy who doesn’t like math and being flunking in it any Math book will scare his shit off.

‘ He then said you should go through this book to get started with ML, and some more there but this would be a good start. ‘

My idea of pursuing ML kinda died at the moment, I started with Web Development from then.

Then in January 2020, I bought a course named Complete Machine Learning and Data Science: Zero to Mastery, the course instructor later became my friend (Daniel) it was a Win-Win!!

While talking and observing the work of Daniel, I realized Daniel being from a non-technical background can do ML without worrying about Math a lot, Why not me?

Things needed to be understood between Math and Machine Learning listed below are my takeaways.

Code First, Math then

Many academics or research-oriented people personally I encountered lack at being a practical way of doing things. Even ML is all about Math but the libraries and frameworks out there don’t hold a strong recommendation for Machine Learning.

Things like Scikit-learn , TensorFlow , Fastai did not expect you to be good at math, but if you can’t code or adapt with libraries then it’s a problem.

Get comfortable with a programming language either R or Python, hold your anticipation to learn frameworks for a bit. People rush their way towards frameworks and libraries before they could code well in Python. I am one of them.

When you got comfortable using Python, make sure to test your skills on things like :

  • Writing meaningful and re-usable functions.
  • List Comprehension and lambda functions.
  • Regular expressions and string methods
  • Classes and Inheritance.
  • Handling Files with Python

These tools can ease up your process when you into using Frameworks and libraries, I personally got stuck in most of the places which led me to learn them one by one. The above tools will help you to get the most out of the libraries and frameworks out there.

Dealing with Math

Machine Learning is Math we all know it, we can’t ignore it. Instead, we can change the way of learning math.

While I was working on a project, I was having a hard time optimizing my model to its best, in ML we call it Hyper-parameter Tuning. To select the parameters and their values for your model you need to know math.

But we can fix this up by the experimental way, my issue was to find the values for max_depth and min_samples_split , and I don't know anything about this. Things I would do are :

  • Read the documentation, it will be confusing to make sense of at first. But when you waddle around for a bit you will get an idea.
  • Google, something like ‘ Whats max_depth and how to choose values for them ' .
  • Read more blogs about the algorithm and what’s exactly are those parameters, trust me I learned more math this way.
  • Straight up to Kaggle and find Notebooks which are of my same algorithm, observe how they did it, and learn from them. Learning from other codes is the best way of learning!

By this time you will be confident about what you are dealing with, follow these key patterns.

Experiment → Observe → Make a change → Repeat

I love experimenting especially in ML, you get to learn a bunch of things, remember you opt-in for a practical way of doing things. The experiment is key.

In the end, you need Math

To get started with Machine Learning you don’t need Math, but to optimize your model you need them. Even though we can solve things by experimenting, when you are into the new world of Neural Networks you can’t ignore maths.

Deep Learning, works on the principle of Mathematics ignoring them will put you into confusion. Frameworks can help you to build something whether they can be Detecting Masks or anything.

What if you want to build something of your own?

Yes, you can use frameworks but to understand how Neural Networks work you need math. Still, you can do all the things mentioned above, but only them is not enough.

Now you should work on Learn Math when Needed policy. There are a bunch of resources out there that teaches you Math for Deep Learning, learning them at all without a purpose seems boring.

Learn Math when you needed, while working on a project or solving something chances are high you will fall into the discomfort of not knowing the math.

  • Hit up Khan Academy of Youtube videos like 3Blue1Brown, which I think the best way to learn Math even if you hate them.
  • Watch videos of courses only when you in need, doing a full course seems overwhelming at times. We learn best when there is a need. Courses for Deep Learning, go through them when in need.
  • If you like books then Maths for Machine Learning is a great one

For getting started with Machine Learning, don’t worry much about Maths. Have a problem try to solve them, on the journey of solving the problem you will learn heaps.

These are my takeaways, don’t be afraid of Maths learn them when you want to or in need. Remember Experimental learning accelerates your learning and makes you remember most of the things you learned.

You know what to do when you face Math next time 🤖

--

--