Do you need good math for machine learning?

How much math for machine learning do we need to learn? This question probably haunts every beginner who has no math-background.

In this section we will take a look at the tip of the iceberg. As we progress, we will learn more about basic mathematics and statistics that we need for machine learning.

Firstly, for absolute machine learning beginners who have no math-background, we have a few comforting words.

To start with machine learning you don’t need a lot of Mathematics.

Secondly, to start machine learning you need to know data structures first. Then comes data analytics. Not math.


If you are a complete beginner your journey to learn TensorFlow might start from here.

For the TensorFlow beginners we have a dedicated category – TensorFlow for Beginners.
But besides that, you may need to learn several other machine learning and data science libraries.

As a result, you may check these categories as well – NumPy, Pandas, Matplotlib.

However, without learning Python, you cannot learn the usages of these libraries. Why? Because they all use Python as the Programming language.

Therefore please learn Python at the very beginning and start learning TensorFlow.

And, finally please check our Mathematics, Discrete Mathematics and Data Structures categories specially. We have tried to discuss from basic to intermediate level so that you can pick up the core ideas of TensorFlow.

Finally, as we move forward, we can learn mathematics, and we can master mathematics to do some serious machine learning projects. Right? 

Let’s start with power and logarithm as these two concepts are extremely necessary in machine learning and data science.

What is power? 

In Python we have a function pow(). 

What does this function do? It raises a number to a certain power. By the way, we call it the exponent of a number. 

The exponent of a number says how many times we use this number in a multiplication. 

As a result, 2 to the power of 4 means we multiply 2 for 4 times. 

Python allows us to express this statement quite elegantly.

raising_two_to_four = 2**4
print(raising_two_to_four)

# output
16

However, we can also express it another way.

raising_two_to_four = pow(2, 4)
print(raising_two_to_four)

# output
16

Therefore, exponents make things look simple. 

It is always easy to write the same stuff in the following way.

# simple multiplication
2*2*2*2*2
# easier way to express with exponent or power
2**4

In other words, we also say, we have raised 2 to the power 4. 

Multiplying a number two or three times does not take much effort. 

But it could be cumbersome when we raise a number to a large number. 

Another way to say that is, it’s very difficult to multiply any number 1000 times. Right? 

Exponent or power saves us.

Now we can think this in an inverse way. 

In some way, the opposite of exponent is logarithm. 

When we try to find the log of any number with a certain base value, it gives us the number of times it multiplies together.

For example, the base 2 of 16 takes us to the value of the exponent that changes 2 to 16. 

Certainly, It gives us the value 4. 

However, in Python we need to import the math library, to get the log() function.

Let’s see the code. That will explain what we want to say.

import math

log_base_two_of_sixteen = math.log(16, 2)

print(log_base_two_of_sixteen)

# output
4.0

In machine learning and in data science we need logarithm. 

Why we need it, and how we use it, we will discuss in the next section.

By that time, if you want to take a look at the Python primer code, please visit the respective GitHub Repository.

What Next?

Books at Leanpub

Books in Apress

My books at Amazon

GitHub repository

TensorFlow, Machine Learning, AI and Data Science

Flutter, Dart and Algorithm

C, C++, Java and Game Development

Twitter

Comments

One response to “Do you need good math for machine learning?”

  1. […] With reference to this topic, in our previous section we have seen how we can use basic exponent and logarithm in Python. […]

Leave a Reply