Issue 2 - "The ABCs of Algorithms" - a light approach to the math behind machine learning and AI

Issue 2 - "The ABCs of Algorithms" - a light approach to the math behind machine learning and AI

It's hard to talk about AI and machine learning without mentioning at least some math. But don't worry let's make this issue a fun and easy read and focus on the benefits that these algorithms brings.

What's an algorithm?

An algorithm is a set of rules or instructions given to an AI, which it uses to solve problems or make decisions. It's like a recipe, you follow the steps and you get a result.

What math do I need to know if I want to leverage AI/ML?

The answer is not much, but you do need understand what value it brings. First off, let's make math less scary by talking about it as a tool. When you have a nail, you use a hammer. When you have a math problem, you use a math tool.

The math version of a tool is something like a formula, an equation, or a graph. For example:

  • Use an equation to calculate the area of a circle, to see if you can place your outdoor furniture on your patio.
  • Use an integral, to calculate the area under a curve, to see how much paint you need to paint your wall.

some of these math tools are simple, some are more complex and you may or may not recognize them from school. But the point is, they're tools that help you make better decisions.

Example: More or less pizza?

Let's give an example, let's say you go to a Pizza place and they say we're out of 9 inch pizzas but you can get a 6 inch and a 4 inch, that's the same right? Well, you know that 6 + 4 = 10, so you're getting more pizza! Or are you? For those of us that remember our math, we know that the area of a circle is πr^2, so:

  • the area of a 9 inch pizza is 81π,
  • the area of a 6inch and a 4 inch pizza is 36π + 16π = 52π, so you're actually getting less pizza.

What you should have said is, through in another 4 inch pizza and a free drink and we're good to go! (That's 72π, by the way). I didn't say it was a good deal, but at least you know you're getting more pizza. :)

What did we learn? Math is a tool that helps us make better decisions and more pizza :)

Example: Buying a house

Even if most of us can relate to Pizza and being hungry, let's take something more serious, like buying a house (or an apartment). One reason for picking a house is the price and how it develops over time. How do we predict the price of a house in the future? Well, if we don't use math, we start looking at things like:

  • What has similar houses sold for in the past?
  • What has the price development been in the area?
  • What's the general trend in the market?
  • How bout the inflation rate?

All this can be conveniently presented visually in a graph, but how do you spot what happens say 5 years from now given that visual? Well, if we don't know math, we might resort to using a ruler, or squinting our eyes, but if we know math, we can have a better approach like figuring out the equation of the line and then extrapolating that into the future.

Some of us might remember the equation of a line from school, y = mx + b, where m is the slope and b is the y-intercept.

What we in reality do these days is to look into software and a programming language like Python, and use a library like scikit-learn to do the heavy lifting for us.

Algorithms need data

Ok, we've established that math is a tool, that there are some great benefits to using it but there's one thing we haven't mentioned that's crucial for machine learning and AI, and that's data.

Imagine you're working with Excel or similar spreadsheet tool, maybe you're working on your budget, or you're tracking company sales. Most likely you're working with rows and columns of data, and you're doing some calculations on that data. Maybe you're even showing different types of graphs to visualize the data.

To make all that work, you need data, data should have structure to work with which usually means it has columns and rows.

Bringing it all together - the model

So, now you know you need Math, either manually or via some Python library, you know you need data, now let's bake a cake, or in this case, let's make a model.

The model becomes something we can interact with, something that given some input can tell us something about the data, the house price 5 years from now or which team will win the premier league or if I can retire in 10 years.

Conclusion

In this issue, we approached the math behind machine learning and AI in a light and fun way. I might even made you crave pizza, but that's a good thing, right? Stay tuned for more issues, to see how machine learning, AI and math can be fun and easy to understand and help you in your daily life.

Omer Alti

Technical Lead at LSEG (London Stock Exchange Group)

3 周

Really liked the analogy used. You asked the model to make a pizza but ended up getting a cake as the model run out of pizza ingredients. Is that not called hallucinations ?

Thanks for the explanation and yes I am craving pizza now! ??

要查看或添加评论,请登录

社区洞察

其他会员也浏览了