Artificial Intelligence, or AI for short has taken the world by storm. Every major company now uses some form of AI. This makes it even more important to grasp what AI is.
It may surprise you to learn that AI has been with us since 1952. It is not a new concept by any standards and a lot of our theories were postulated ages ago.
What’s changed is the amount of computing power and data we have at our disposal to bring into existence these wonders.
AI is simply decisions made by a computer. Nothing less and nothing more.
While this definition is indeed broad, it serves a satisfactory base for our futher reasonings.
Now, let’s break the two words to further distil.
That’s it! AI is simply a computer program makes predictions on data.
Therefore, even a series of if-else statements constitute AI; as we’ll soon see, there are far more fun ways to build predictors.
AI is a broad term used for any smart program. As we’ll soon see, there are many different subsets to this. Please take a look at the following exhibit:
src
Deep Learning branches into many different fields that are not shown here.
To demonstrate how simple AI really is, let's begin with a very simple prediction problem. Consider the following data:
| Years Worked | Salary ($) |
|---|---|
| 1 | 1000 |
| 2 | 2100 |
| 3 | 2900 |
| 4 | 4200 |
Now answer this:
What salary should you expect after working at this company for 7 years?
By intuition, the answer is likely to be in the ballpark of $7000. But how did you know this? You looked at the data, and basically extrapolated the next sequence.
Very clever of you.
AI is great for a linear problem like this one because of high correlation between the two variables. When the correlation is closer to zero, linear regression becomes useless.
Time for some super quick math. To calculate slope:
and to calculate bias (or Y intercept)
Let's understand the variables:
x̄: Mean of x's
ȳ: Mean of y's
x̅y̅: Mean of {g : Result of xy ∈ (years_worked, salary)}
(x̄)²: x̄, squared
x̅²̅: Mean of {x : x ∈ years_worked}
mx̅: Slope × x̄
After some calculations, we get the following:
x̄ = 2.5
ȳ = 2550
x̅y̅ = 7675
(x̄)² = 6.25
x̅²̅ = 7.5
m = ((2.5 * 2550) − 7675) / (6.25 − 7.5)
= −1300 / −1.25 = 1040
b = 2550 − 1040 × 2.5 = −50
We have our slope and bias!
The equation thus is:
y = 1040x − 50
Coming to our earlier question, what will my salary be after 7 years of work? Let's ask the machine 🤖
y = 1040 × 7 - 50 = $7230
Not too bad!
Notice that our little equation satisfies all characteristics of an AI:
Looking at this, it's immediately obvious that our regression won't work very well for data like this:
| Years Worked | Salary ($) |
|---|---|
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
Linear regression lines are unable to fit on exponential data. We need something more complex.
Also, the amount of data you have also matters, very little data will lead to the line fitting poorly, leading to extreme predictions.
Now that you know how AI works and limitations with simple models, you can move onto more complex models like neural networks.
The field of AI and ML in general is hot. New discoveries and applications are being found regularly, some plain stupid, others magical.
What a time to be alive!
Thanks for reading till the end! 👋
@rxge