AI in Business and Finance — Transcript
Full transcript
- 0:02Okay, welcome back guys. So, today's
- 0:04lecture is about AI in business and
- 0:07finance. So, we've talked about AI in
- 0:10healthcare, we talked about AI in
- 0:12education,
- 0:13we talked about AI in creative
- 0:16expressions,
- 0:17poetry, music. So, today we're going to
- 0:20talk about AI in business and finance,
- 0:21which is also a very interesting topic.
- 0:23I we wanted to kind of
- 0:25explore the potentials of AI in
- 0:28different disciplines and not only is
- 0:30maybe give you some concrete examples of
- 0:32real applications, real algorithms. One
- 0:35more time, I'm going to reiterate, when
- 0:38we talk about AI, we want to talk about
- 0:40AI, the engine behind AI. Not like AI is
- 0:44used to generate predictions. We need to
- 0:47know what algorithm was used. How was it
- 0:49used? Again, this is why the future
- 0:53depends on experts in business. I'm not
- 0:57an expert in business, but experts in
- 0:59business will know how to use AI. Who
- 1:01knows know the details and the
- 1:03technicalities behind it, okay? Let's go
- 1:06through this. So, AI in business and
- 1:08finance is the topic.
- 1:11Let's start. So, again, AI generated on
- 1:13purpose. I do these just to give us a
- 1:16nutshell of using AI to teach AI, okay?
- 1:19So, yes, AI in business, yes.
- 1:22One, we could look at trading, look at
- 1:25chatbots like we did with healthcare,
- 1:28fraud detection. So, we're going to talk
- 1:30about the details now. Credit scoring,
- 1:34banking,
- 1:36loans, loan defaults, meaning they don't
- 1:39pay their loans, investment management.
- 1:42This is a huge thing. I think I've I've
- 1:44mentioned this before. I do have one of
- 1:46my friends who work in business and
- 1:48finance. His background is computer
- 1:49engineering. Super smart, super genius
- 1:52friend.
- 1:53He did a bachelor's in computer
- 1:55engineering again from one of the top
- 1:58universities. He went and did a master's
- 1:59in computer engineering, again, a top A
- 2:02student, GPA 4. Uh super smart. All of a
- 2:05sudden, he said, "You know what? I don't
- 2:07think computer engineering is for me."
- 2:08I'm like, "What? You You're a genius in
- 2:09computers."
- 2:11He went to finance. He went to basically
- 2:13investments,
- 2:15uh stocks analysis. He uses background
- 2:18in computers to make recommendations,
- 2:21and again, makes multi-million dollars a
- 2:23year. So, this is a very good example I
- 2:25use
- 2:27um to to show the potentials of having a
- 2:30technological background and
- 2:32implementing it in different domains is
- 2:35really uh
- 2:36uh it pays off. It pays off big time,
- 2:38okay? So, let's go over this.
- 2:40Uh what would we learn in this lecture?
- 2:42Um
- 2:43Again, there's a learning objectives,
- 2:45learning outcomes.
- 2:46Hopefully, you're going to identify some
- 2:48key applications of AI in business and
- 2:51finance.
- 2:52Understand how AI models are used for
- 2:55prediction and decision-making. That's
- 2:58very important. We can look at some
- 3:00examples, financial data and finance
- 3:03using some AI concept. Let me give you
- 3:05some small
- 3:06uh
- 3:07worked example, maybe with numbers.
- 3:10Again, one word, I don't want to go too
- 3:11technical because this is not a
- 3:13technical course as per se, but still we
- 3:16need to quantify. Like we did in
- 3:18healthcare, we looked at accuracy,
- 3:20precision, recall.
- 3:22These measures that really are core of
- 3:25you identifying how good is an AI system
- 3:29doing, okay? So, we're going to do some
- 3:31examples also in business and finance.
- 3:33Evaluating risk, some ethical
- 3:35implications of AI. Obviously,
- 3:37everywhere we deploy AI, we ask the
- 3:39multi-million dollar question. You know,
- 3:41how ethical it is. Can I do this? You
- 3:43know, if I can, what are the
- 3:45limitations? So, these are questions to
- 3:47ask. Again, we're going to revisit the
- 3:48confusion matrix that I've talked about
- 3:51in healthcare. Again, you can apply it
- 3:52in any domain, but I'll apply it also in
- 3:55the business domain with some worked
- 3:57examples. So, let's start with the
- 3:58obvious question. Why?
- 4:00Why AI in business? Why can't we do
- 4:02things the way they are done? Why
- 4:04involve AI? And how how it would help.
- 4:09So, obviously the the the first answer
- 4:11to this is because of the data. We have
- 4:13massive amount of data. Like everywhere
- 4:16else in business, it's even more. Again,
- 4:18if I want to add marketing to the mix of
- 4:20business, finance, and marketing, so
- 4:22basically a school of business,
- 4:24um you would see that data is all over.
- 4:26So, we have transactions, financial
- 4:28transactions. People are buying using
- 4:30their credit cards left and right all
- 4:32over. Especially these days with, you
- 4:35know, digital currency and also digital
- 4:37transactions. Nobody carries a credit
- 4:39card anymore. We do it with our phones.
- 4:42So, e-payments, m-payments, mobile
- 4:44payments, and so on
- 4:46are very common. So, we have a lot of
- 4:47data, a lot of transactions happening.
- 4:49Customer behavior. So, how are customers
- 4:52behaving? Could be some simple things,
- 4:55buying, selling, you know, consumers
- 4:57could they're consuming
- 4:59um going to restaurants. And all these
- 5:01behavior, how they're When do they buy,
- 5:04you know, during summer, during this
- 5:06time, and all these. Market data, of
- 5:08course, how's the market fluctuating.
- 5:11So, we have a lot of data. So,
- 5:13AI will obviously help us understand
- 5:15these data more, making better
- 5:17decisions, automating some of these
- 5:20processes. Again, from different ends,
- 5:22could be at the consumer end or from the
- 5:24supplier end or from the big companies
- 5:26end.
- 5:27Um
- 5:29Again, hopefully reducing risks,
- 5:31optimizing profit. All these are
- 5:34measurements in the business world. You
- 5:36know, we want to maximize profit. Who
- 5:38doesn't? We want to minimize cost. So,
- 5:40most of the things we do in the business
- 5:41world, if you're coming from a business
- 5:43major or finance, has to do with
- 5:46optimization. We're optimizing something
- 5:48and subject to specific constraints.
- 5:51Usually we used to model it, we could
- 5:52simulate it on a computer. Now with AI
- 5:55we could even do better, we could
- 5:57automate this and we could do some
- 5:59reinforcement learning where we're
- 6:01learning as we go all over time. This is
- 6:04also very very interesting when it comes
- 6:07to almost any applications of AI. Okay,
- 6:10so AI turns data into competitive
- 6:12advantage. I love this. I put it at the
- 6:14bottom.
- 6:16Really, now companies who really employ
- 6:18and deploy AI systems and agents, we've
- 6:22talked about agents before, in an
- 6:24efficient way to optimize their
- 6:26processes will have a competitive edge.
- 6:29And this is really going to be the game
- 6:31that companies not going to be, I think
- 6:33it's already uh the game uh for for
- 6:36competition. So if you want to kick out
- 6:38your competition, have a better AI
- 6:39agent, have better optimizations,
- 6:42therefore having a better
- 6:45uh competitive edge, you know? This is
- 6:47very important. I mean, I was reading
- 6:49the other day, I was just recently, one
- 6:51of the articles that came out is how
- 6:53they were able
- 6:55the the
- 6:56um authors from Google, they published a
- 6:59compression technique uh for GPTs
- 7:03that can compress almost seven times
- 7:06better than what we have today.
- 7:08Again, for those who don't know
- 7:09technicalities a lot. So when you are
- 7:11typing and chatting with ChatGPT for you
- 7:13to understand, ideally
- 7:16uh what you're typing is saved in a
- 7:18cache. A specific kind of cache, I'm not
- 7:20going to go through the technicals.
- 7:22And obviously as you type more, the
- 7:23cache will grow more, this cache memory.
- 7:26So if I have a way to compress, I could
- 7:29literally make my system faster by
- 7:33getting even less memory space. Less
- 7:36memory meaning let more better
- 7:38searching, hence I could do it in a
- 7:40better way. And imagine if I have that
- 7:44algorithm. Now, obviously Google has it.
- 7:46Um therefore, their GPT would be seven
- 7:49times faster what other GPTs are out
- 7:52there by using a specific algorithm. So,
- 7:54AI in this case gave them a competitive
- 7:56edge. Obviously, we will what what you
- 7:59can do in 7 minutes, I can do in 1
- 8:02minute. Imagine the comparison. By just
- 8:04designing a new algorithm. So, AI uh by
- 8:07by manipulating AI in in a in a better
- 8:10way, you can do better optimization.
- 8:13Okay. So, if you look at the pipeline,
- 8:15I've done this pipeline again before in
- 8:17healthcare. I've done it in creative
- 8:18science. I do it always in the
- 8:20applications. So, we always have the
- 8:21pipeline. I have this data coming in. We
- 8:23do some kind of pre-processing. Then we
- 8:26have a model hopefully. Then we deploy
- 8:28it. So, in the case of business, our
- 8:30data is all about sales, customer data.
- 8:32I've talked about this. Prices,
- 8:34behavior, all these. We do some
- 8:36pre-processing, cleaning them,
- 8:38normalizing them. I've talked about
- 8:39normalization before. Again, we want to
- 8:41normalize. We want to have the same
- 8:42denominator. Cuz I when I do
- 8:44comparisons, when I do analysis, we need
- 8:46to be having a normalized data. And
- 8:49obviously, we have need to clean clean
- 8:50it meaning remove all the junk data, the
- 8:52noise, the fake data, the missing data,
- 8:55and so on.
- 8:56So, now hopefully we can generate a
- 8:58model in the business world as well. In
- 9:00business, most likely regression is very
- 9:02popular cuz we do a lot of prediction.
- 9:05So, you could expect regression models
- 9:07that we've talked about. Classification
- 9:09uh to make a decision. Should I buy?
- 9:11Should I sell? You know, if you you're
- 9:12looking at stocks, so we're looking at
- 9:14classification. And you can have
- 9:16clustering to do some kind of customer
- 9:19segmentation. We've talked about this
- 9:20before. These customers look alike, so
- 9:23we do clustering. So, you can see a lot
- 9:25of models are employed that you have
- 9:27learned already um in the business
- 9:29world, in the finance world. So, we
- 9:31deploy it in real-time systems. So, some
- 9:33key applications I'll talk about and do
- 9:35some examples as we go on.
- 9:38Then fraud detection,
- 9:40that's a very common example. Can we
- 9:42detect fraud? And this is really
- 9:44interesting. I mean, for those of you
- 9:46have credit cards, you would know this.
- 9:48I mean, I get phone calls at midnight
- 9:50sometimes like, "Did you do this
- 9:51transaction?" I'd be sitting and buying
- 9:52in Amazon. And they Or if I haven't
- 9:56bought anything for the last 2 months,
- 9:57all of a sudden I buy I don't know,
- 10:00Alibaba.com.
- 10:02I haven't bought from Alibaba for the
- 10:03last 2 months, I'm buying it $1,000. It
- 10:06will flag it, right? So, this is simple.
- 10:08This has been there. It's not AI. It's a
- 10:10simple if statement that they put in the
- 10:13code somewhere. Like, "If this happens,
- 10:15be careful. Have a counter plus plus."
- 10:17So, almost any anybody can design this
- 10:20simple basic application. Okay, this is
- 10:225 or 10 years ago. That's what I'm
- 10:24talking about.
- 10:25Obviously, with AI, we could do
- 10:28500 times better. Cuz you you monitor
- 10:31behavior. You monitor how things are
- 10:33done. Um anything suspicious, meaning it
- 10:36doesn't belong to a pattern. So,
- 10:38ideally, this is how AI works. It's all
- 10:40about patterns. And something that
- 10:42doesn't belong there, an anomaly, uh it
- 10:45it's kind of flags it. And this anomaly
- 10:47could be something basic like, "I
- 10:49haven't done this ever. I do it." We can
- 10:51detect as human. But it could be way
- 10:53more than this. I mean, it could be from
- 10:54the basic things of the way you're even
- 10:56typing your password. Imagine. You know,
- 11:00if you go to an ATM machine with the
- 11:01advanced ATMs,
- 11:04and if you're putting my password, I'm
- 11:05not going to say my password now. My
- 11:07password is A B C D. A, then I spend
- 11:11maybe 2 seconds to put the B, another 2
- 11:13seconds to put the C. And every time
- 11:16I've went to the ATM machine for the
- 11:17last, I don't know, 10 years,
- 11:20most likely me, if I know my PIN, you
- 11:23know, this amount of time I spent on
- 11:26every letter to move my finger from here
- 11:28would kind of be the same, right?
- 11:31So, if one day I put an A
- 11:33then I scratch, I put the B, then I
- 11:36scratch, I took the what's I put C. This
- 11:38would be flagged. I'm not saying it's
- 11:39going to say, "Oh, he definitely is not
- 11:42the Muhammad." It will be flagged. Maybe
- 11:44the camera will record a minute of it or
- 11:47will send a human to check it out. So,
- 11:50you could see because I did something
- 11:51away from the pattern. And this is
- 11:54really a good example of fraud detection
- 11:55what I just did now. I didn't improvise
- 11:57this. Usually I prepare before
- 11:59recording. Sometimes I improvise on the
- 12:01spot. So, this is one of the things I
- 12:03improvise, but it's a good example.
- 12:05Okay? So, fraud detection.
- 12:07Credit scoring, you know, in the US, if
- 12:10you're in the US uh there's something
- 12:12called credit scoring. So, you know,
- 12:13when they want to give you a credit
- 12:14card, the limit is 5,000. If you were
- 12:17paying on time, you know, respecting the
- 12:20due dates of your payments at the end of
- 12:22each month, your score could be more up.
- 12:24So, that's why they give you a score. If
- 12:26you did some kind of fraud, your score
- 12:27could be down. If you they catch you
- 12:29stealing So, score has a formula. So, we
- 12:32could now use AI in order to really rank
- 12:35good people financially. You see that if
- 12:38you want to give you a loan, you know,
- 12:40your credit score is high, I will give
- 12:41you a loan. So, again, before it's using
- 12:43a formula, simple. Um adding and
- 12:46multiplying some numbers. Now, I could
- 12:48look at behavior over time.
- 12:51Stock prediction, as I said, for those
- 12:53who do it deal stocks, I I I recommend,
- 12:55by the way, playing around with stocks
- 12:57virtually, not buying really, you know,
- 12:59using these simulators to see if you
- 13:01actually invested in this how it would
- 13:03happen and so on. It's interesting in
- 13:05the business world. So, yes, obviously
- 13:07now it could make better recommendation
- 13:09by looking at patterns. This is risky,
- 13:12you know, because if we're all using AI
- 13:15we're all using the same prediction
- 13:16systems, uh this is the big question,
- 13:19right? So, if then we're all going to
- 13:20buy at the same time and sell at the
- 13:22same time, which would cause chaos.
- 13:24Which is the market will change
- 13:26completely. So, all the predictions will
- 13:28fail. So, it's there is a thin line
- 13:30here, you know,
- 13:33if the agents my agent doesn't talk to
- 13:35your agent, which is not usually the
- 13:37case. Something I'll be talking about
- 13:39later on also.
- 13:41Regarding AI agents socializing with
- 13:44each other, communicating with each
- 13:46other, having their own Instagram, an
- 13:48Instagram of AI agents, Instagram for
- 13:50AIs. Humans are not allowed and this is
- 13:52there. So, get get ready when I talk
- 13:54about it in the
- 13:56coming lectures. I am I am very excited.
- 13:57Okay. So, stock prediction, yes, it
- 14:00could help us with stock prediction.
- 14:01Customer segmentation, I've talked about
- 14:02this before. Maybe K-means clustering
- 14:05could be an option unsupervised looking
- 14:07at their patterns
- 14:08how they're buying, how they're selling,
- 14:10what they're like, what they don't like.
- 14:12And making recommendation system example
- 14:14again, maybe Amazon is a good example
- 14:16buy this, sell this. You bought this,
- 14:18why don't you buy this? You know, your
- 14:20friend bought this, why don't you buy
- 14:22this? There are formulas, you know,
- 14:24there are things that it's learning and
- 14:26enhancing over time. Okay?
- 14:29So, let's talk about fraud detection.
- 14:30So, the idea is obvious, we've got to
- 14:32detect transactions that are suspicious
- 14:35using some kind of classification model.
- 14:38So, it is a real-time classification
- 14:40model. There's a AI models. Most likely,
- 14:43now obviously you could do better, but
- 14:45binary classification maybe is the
- 14:47easiest. Again, when I talk about these
- 14:48I don't want to go too technical, but
- 14:50still we'll give some example, but
- 14:52binary is the easiest. It's either fraud
- 14:54or no fraud, right? Zero or one. That's
- 14:56why we call it binary. So, it's fraud or
- 14:59it's not fraud.
- 15:01Of course, we can make it more
- 15:03interesting, make it fuzzy. Fuzzy
- 15:05classification meaning it could be one,
- 15:08could be 0.5, 0.7, a probability between
- 15:11zero and one.
- 15:12It's a fraud, so it's more probabilistic
- 15:15model versus simply binary
- 15:17classification. Well, binary would work.
- 15:19So, this could be an example of a
- 15:21distribution that we get. So, these are
- 15:23the ones that are legit. These are the
- 15:25ones flagged or these are the one really
- 15:27fraud. So, you could have a simple a bar
- 15:30uh distribution to to kind of visualize
- 15:32it.
- 15:33So, let's look at some features.
- 15:35So, when I'm detecting this, we could
- 15:37have many variables. I mentioned some
- 15:39here. Let's call them features. These
- 15:40are the things that I'm going to use in
- 15:42my model. Remember when we did Google
- 15:44Teachable Machine example, you're giving
- 15:46it images.
- 15:48When you're giving it an image, you have
- 15:49facial
- 15:51uh features. That's kind of, you know,
- 15:53if you're doing neural network
- 15:55or deep learning, you have millions and
- 15:57millions, right? So, these are the
- 15:59features that you give the model to
- 16:01learn from it in order to detect
- 16:03something. Again, when it comes to the
- 16:05features and fraud detection, for
- 16:06example,
- 16:08uh
- 16:08what do we need to know? Of course,
- 16:09transaction amount,
- 16:11a good example. Location, you know, if
- 16:13I'm in I don't know in in um
- 16:16in Singapore, I never been there. I even
- 16:19buy a a a ticket there, they could see,
- 16:21you know, AI would know later on if I
- 16:23bought a ticket to make the correlation.
- 16:26In my credit card, you haven't bought a
- 16:28ticket, all of a sudden you're in Sri
- 16:29Lanka buying uh I don't know um
- 16:33uh sweets, right? So, maybe you don't
- 16:35even eat sweets. How did it know?
- 16:37Because it tracked. You could see it
- 16:39kind of knows you now. AI is learning,
- 16:41so a simple thing is that transaction,
- 16:44how big the amount is, the location, the
- 16:46time, the frequencies. I could add much
- 16:48more. I only add four. I could add the
- 16:50ones I mentioned now. Uh patterns
- 16:53between credit card statements, you
- 16:55know,
- 16:56um and so on.
- 16:58So, these are features that could be
- 16:59given to the model. And then we could do
- 17:02logistic regression. We've talked about
- 17:03this. Did not give you an example then.
- 17:05I'll give you an example today how to
- 17:07actually use it. You need to know it's
- 17:09very simple formula. Again, if this was
- 17:11an exam or something, you I'll give you
- 17:12the formula. You need to understand it.
- 17:14That's that's the important part.
- 17:17Decision trees, we've done decision
- 17:18trees before, you remember that? Neural
- 17:20networks, these are things that could be
- 17:21beneficial a lot, especially neural
- 17:23network, uh deep learning, uh to to
- 17:27figure out frauds or no frauds, okay?
- 17:30We could have the same confusion matrix
- 17:32like before, the faults, remember the
- 17:34confusion matrix? If you don't remember
- 17:36them, true positive, true negative,
- 17:38these are good stuff. Again, true
- 17:41meaning good.
- 17:42True positive, true negative meaning the
- 17:44AI was able to detect a fraud when it
- 17:48was actually a fraud.
- 17:50True negative, the AI was able to detect
- 17:53that's not a fraud when it's not a
- 17:56fraud, you know? So, these are good
- 17:57things. Then, the false positive, false
- 17:59negative are the bad things, meaning we
- 18:01flipped it. The AI got it wrong. So, for
- 18:04example, false negative, it's fraud, but
- 18:07we missed it, and this is obviously the
- 18:09most critical. False negative, it's bad.
- 18:12The AI did not figure it out, but it was
- 18:13indeed a fraud. Now, false positive, it
- 18:16still got it wrong, but it's not a big
- 18:18deal, you know? It says it's fraud, but
- 18:20it's not a fraud. Then, we we looked it
- 18:22up, we figured out it is a mistake. So,
- 18:24false negative negative is critical here
- 18:26as we did before. When we did
- 18:28healthcare, you know, we analyzed this,
- 18:30so you need to really under- This is
- 18:32really so important. So, false negative,
- 18:35we missed a fraud. Obviously, it's going
- 18:37to cause loss, uh the criminal will get
- 18:39away, we did not catch him. Uh false
- 18:42positive, as I said, it's inconvenient.
- 18:44He has to go to make some phone calls.
- 18:45Some people get angry cuz we got to
- 18:47accuse them and then figure out we did a
- 18:49mistake. Very simple to do when we do
- 18:51exams online, you know, and we have a
- 18:54camera, it's watching you, and a
- 18:56lockdown browser, and the AI There is an
- 18:59AI, not very smart, still work They're
- 19:01still working on this. The AI will see
- 19:03if I'm I'm looking there, it will flag
- 19:06you. If you're looking down, it will
- 19:07flag you. We as professors will watch
- 19:10these snippets. Say, "Ah, you know what?
- 19:12No, he was doing it. He wasn't cheating.
- 19:14And we kind of could see if you're
- 19:15talking and whispering. It will flag all
- 19:17these. And it's based on very simple
- 19:20algorithm of just watching your
- 19:22movements, your eyes, retina looking up
- 19:25and down, videos look for an amount of
- 19:27time. So, these are the features that
- 19:29are fed into the model. So, back to
- 19:31this. So, actual fraud, actual legit.
- 19:34So, legit versus fraud, predicted fraud
- 19:37versus predicted legit. So, we have true
- 19:39positive to negative as I told you. So,
- 19:41we predict legit when it's actually
- 19:43legit. And actual fraud, we predict it,
- 19:46so that's true positive. And false
- 19:48negative and false positive. So, we
- 19:49could do a small example like we did
- 19:51before.
- 19:52Okay? So, you could see
- 19:561,000 transactions. Supposedly, we had
- 19:5850 cases of fraud.
- 20:00You know, the model detected the true
- 20:04positives were 40, the true negatives
- 20:06were 850. You always expect the legit to
- 20:09be more than the fraud. Uh false
- 20:11positive 100 false negative 10. So, I
- 20:13want you to calculate the accuracy,
- 20:14precision, and recall. Again,
- 20:17easy. Well, accuracy, it's all about,
- 20:20remember, true positives, we're looking
- 20:22at basically how well we did. So,
- 20:25accuracy, it's about you could see true
- 20:28positives,
- 20:29true negatives over the total. The total
- 20:32was 1,000 of them.
- 20:34So, that's how accurate we were, 89%.
- 20:37So, I I told you you need to definitely
- 20:38know accuracy, precision. These two
- 20:42things you definitely need to know them
- 20:43by heart. And again, recall is also
- 20:45something important to know. So,
- 20:47accuracy, easy. We could calculate it 2
- 20:49seconds. Precision are the P's. Just
- 20:52This is a trick. For I remember it like
- 20:54this. The P's.
- 20:56So, we're looking at
- 20:58TP like again like before, true positive
- 21:00is my
- 21:01numerator. Always my numerator true
- 21:03positive. You know, when we look at
- 21:06precision or recall. true positive, this
- 21:08is where how we get good. Accuracy puts
- 21:10the true negative with it.
- 21:11But usually you put true positive. So,
- 21:14true positive over the P P's. So, how
- 21:16many P's we have? These TP, FP. So, 40 +
- 21:19100, you see them? It's how you remember
- 21:21this formula for life. You will never
- 21:23forget this, even after this course.
- 21:24Anyway, that's you, "Oh, yeah, I get
- 21:26it." True positive, TP over TP + FP,
- 21:29PPP. The others don't have P. P P be
- 21:31positive. So, we're looking only you're
- 21:33being positive. Think about precision,
- 21:35you are a positive person. So, you're
- 21:37only looking at the positives. So, you
- 21:38could see true positive over true
- 21:40positive
- 21:41um over uh plus four false positive.
- 21:45That's what precision is. Okay?
- 21:48Um
- 21:49the
- 21:50last one, which is recall, again, true
- 21:52positive. So, now I'm adding the true
- 21:56positive again. So, this is similar to
- 21:58this. You can see true positive over
- 21:59true positive. True positive over true
- 22:01positive. The difference here, I don't
- 22:03put the false positive, I put the false
- 22:06negative. So, I'm being negative here,
- 22:08in case you want to remember this. So,
- 22:09recall and precision are identical,
- 22:11except instead of using the 100, which
- 22:14is the false positive, I'm going to take
- 22:16the false negative, 80%. You could see,
- 22:19precision
- 22:20is 28%
- 22:23right?
- 22:24Um accuracy is 89%.
- 22:28You could see now, people think, yeah,
- 22:30precision and accuracy are close. You
- 22:31know, in the health care, they were very
- 22:33close numbers. And this on purpose I
- 22:35wanted to put an example you could see.
- 22:36And the obvious reason is the 850 here.
- 22:39So, I'm looking at the true negative is
- 22:41what really affected it compared to
- 22:43this. It's a big number. That's why as
- 22:45you can see the the the fluctuation,
- 22:47okay?
- 22:48Okay, so high recall is usually a good
- 22:51thing. Low precision, meaning we have
- 22:53many false alarms. That's what it means.
- 22:56So, we have false alarms. That's what
- 22:57precision means. It's still accurate
- 22:59model, but we have false alarms. Okay?
- 23:02So, this is a good example. Let's give
- 23:04you example of which is the first
- 23:05example business and finance was how can
- 23:07you use AI in the world of fraud
- 23:10detection is a big topic. How can you
- 23:12use AI for credit scoring? So,
- 23:14we could predict the loan default. As I
- 23:17said when I started so credit scoring
- 23:19gives you a a score each one of us based
- 23:21on our history. Which is good. But with
- 23:24AI I could do predictions now in the
- 23:27future. So, that's simply a formula.
- 23:29Before it was ah your score is ah
- 23:32X whatever that X is. Ah X is good. You
- 23:35give you a loan. Now no, I will not only
- 23:38look at X I will do some prediction
- 23:40modeling. So, you could predict would he
- 23:42pay his loan if I give him a loan? If I
- 23:44give him a credit card a new credit
- 23:45card, will he end up paying it? So, I
- 23:47could do this prediction. So, you could
- 23:49look at income, credit history, debt,
- 23:52ah maybe the way you're spending your
- 23:54money, you know, um how it's
- 23:56fluctuating, how you're traveling not
- 23:58traveling, how many kids you have. I
- 24:00could give inputs again and again the
- 24:02more inputs you give it, the more
- 24:04accurate this kind of model will become.
- 24:05So, typically we want to either approve
- 24:08the loan or reject the loan based on the
- 24:11probability of default. So, a a good
- 24:13model will be a logistic regression.
- 24:15I've talked about this before. Again, if
- 24:17you remember it is not regression it's a
- 24:19classification although it's called
- 24:21logistic regression.
- 24:23Um the formula is this. Don't panic.
- 24:26Again, if this was an exam, I'd
- 24:28definitely give you this one but you
- 24:29need to know how to plug in the values
- 24:31and understand what it means. Simple.
- 24:33It's going to find the probability Y
- 24:35equal to one. The good thing about this
- 24:37model is so simple. You find this
- 24:39formula and it's going to be between
- 24:40zero and one. The closer it is to one,
- 24:43then our prediction it's a one.
- 24:46The closer it is to zero, then our
- 24:48prediction is zero. So, again one
- 24:49meaning approve, zero meaning don't
- 24:52approve. 0.5 is a gray area. And the
- 24:55closer above 0.5 meaning I will approve
- 24:58this loan.
- 24:59Below 0.5, I will not approve this loan.
- 25:02That's it. Again, the formula takes
- 25:04these parameters, X1, X2, X3, X4, X5, as
- 25:09many as I want you to get. I I This case
- 25:11I I'm looking at income, credit history,
- 25:13debt. Then we'll have these values. We
- 25:15need to normalize them, of course.
- 25:17Again, they need to be normalized for
- 25:20you to plug in this formula and have
- 25:22weights. These weights you don't define
- 25:24them. The model will define them. That's
- 25:25why it's called, you know, it's a
- 25:27machine learning model. We don't know
- 25:29what W1, W2, W3 are. These are depending
- 25:32on, you know, the model that we
- 25:34generated. So, the model basically will
- 25:36give us a function with these Ws
- 25:38defined. And E is exponential, in case
- 25:40you don't know math.
- 25:41E is a simple exponential model. Simple.
- 25:44Okay? So, probability of default is what
- 25:46this is. Let me give you an example. All
- 25:48is good.
- 25:49So, if I tell you X1 is the income
- 25:52score, X2 is the debt. I'm not going to
- 25:54give you X3 and 4. I can. You just have
- 25:56to plug them in the calculator. So,
- 25:58assume the model learned. We did some
- 25:59machine learning model. It learned the
- 26:02weights. So, W1 was -0.8
- 26:05for X1. So, for my income, it's
- 26:07negative. It's -0.8.
- 26:11My income score and it's 1.5 my debt
- 26:15score.
- 26:16So, the weight of the debt is 1.5. The
- 26:19weight of my income is a negative point
- 26:21eight.
- 26:23Again, for one customer, we had his
- 26:26income was two. Again, whatever that two
- 26:28means. $2,000, we put two, for example.
- 26:31Okay? And one was his debt score.
- 26:34There's a score for his debt. The
- 26:36question is, should we give him a loan
- 26:38or not? As simple as that. Using,
- 26:40obviously, logistic regression. Let's do
- 26:43this. Simple. We have the formula. I'm
- 26:45going to write the formula again one
- 26:46more time. 1 over 1 plus E to the power
- 26:49minus W1, X1. We have W1. We have X1.
- 26:52W1, W2, we have W2, we have X2. Again,
- 26:55this gets used to how to use the
- 26:57calculator. I'm not going to teach you
- 26:58this.
- 26:59So, it's basic, so we going to put it in
- 27:00the formula. I put it here. You know,
- 27:03minus 0.8, let me calculate it. So, I
- 27:05did the math. The math was 0.475.
- 27:09Aha, it's a bit gray area, huh? 0.475,
- 27:12so it's almost exactly what I was
- 27:13saying. Yes, it's still less than 0.5,
- 27:16but 0.475,
- 27:18it's gray in the middle. So, it's a
- 27:20decision, it's kind of yours as a human.
- 27:22It's not very obvious, right? So, the
- 27:24probability of default
- 27:27is 0.475.
- 27:29So,
- 27:30the model says 47.5%
- 27:34the customer belongs to this class one,
- 27:36whatever class one that you define. So,
- 27:38if we define class one as default,
- 27:41meaning they would not pay, right? So,
- 27:42default probability is 47.5. So, should
- 27:46we uh again,
- 27:48uh default is 47.5, not default is 52.5,
- 27:52right? So, again, I said it's a gray
- 27:55area, it's not 50/50. So, we could
- 27:57classify them
- 27:59um as not likely to default. So, uh if
- 28:03you look at it from the beginning,
- 28:05again, the minus 0.8, therefore, higher
- 28:09income score reduces the risk. You could
- 28:13see it.
- 28:14So, because it's a negative, more
- 28:16income, this will be reduced it. And
- 28:18this is 1.5, higher debt score will
- 28:21increase the risk because it's a
- 28:23positive, right? So, again, the idea is
- 28:26this will allow us to figure out
- 28:29uh the probability of default. So, this
- 28:31was
- 28:32in the real world, it's going to keep on
- 28:34doing it all the time using this and
- 28:36classifying you as a do you belong to
- 28:38those who will be defaulting or
- 28:42not likely to default. In this case, you
- 28:45could see depending on what what the
- 28:47class was. In this case, I define it as
- 28:49default. Probability of default is what
- 28:52this is. So, it's only 47%
- 28:56they will default. Right? Which means
- 28:58they're more likely
- 29:00not to default because it's a bit high.
- 29:02But, later on
- 29:04again, we could avoid these gray areas
- 29:06as I said.
- 29:07Uh and the human will decide on it. But,
- 29:09it's kind of interesting how we we can
- 29:13use logistic regression to classify
- 29:15people in the finance and business
- 29:17world. So, again, let me give you a
- 29:19scenario. So, the model predicts again
- 29:230.8 default risk. Customer B 0.3. So,
- 29:28who gets the loan? You want to pick
- 29:30customer A customer B? I I
- 29:32Obviously, who's going to get the loan?
- 29:34We're going to go with B because the
- 29:37default risk probability is less. So,
- 29:40again, this could be with comparing. It
- 29:42doesn't only have to be between 0.5 and
- 29:451 and deciding. So, you want to classify
- 29:47them on what category they belong to.
- 29:49Okay?
- 29:50So, we gave an example on credit score,
- 29:53loan prediction.
- 29:56Um
- 29:56okay? So, let's continue giving some
- 29:58more fraud detection as well. That was
- 30:01the first example. Stock prediction. So,
- 30:03I want to predict stocks. So, how would
- 30:05we do that? So, obviously, you could
- 30:07predict the prices of future stocks.
- 30:08It's going to make people money,
- 30:11millions and billions. So, data we need
- 30:13are historical patterns. I If you've
- 30:14seen these charts before, I'll show you
- 30:16some in a second. These historical
- 30:18patterns will give us an idea what the
- 30:20future price would be. Maybe the news. I
- 30:23mean, if you're watching the news today,
- 30:24you know, this is a trendy lecture.
- 30:27Trump Donald Trump says something, he
- 30:30tweets something, tomorrow the stocks
- 30:32will go down. He says, "I'll do peace."
- 30:35The stocks will go up. You know, like
- 30:37I'm giving you an example how an
- 30:38influencer, in this case a president,
- 30:41can really affect these prices and the
- 30:43AI kind of is reading all these behind
- 30:46the scenes. So, we're looking at
- 30:47historical data and we're only looking
- 30:49and we're also looking at the news.
- 30:52Market trends as well.
- 30:54So, usually we use something called time
- 30:56series models. Think about it as a curve
- 30:59over time. You know, we have the long
- 31:01short term memory, which is the LSTM.
- 31:05Uh this is a type of RNN. We've talked
- 31:07about RNN before. Recurrent neural
- 31:09networks. We talked about ANN,
- 31:10artificial neural network. Talk about
- 31:13CNN, convolution neural network. Again,
- 31:15RNN we also talked about it. Uh which is
- 31:18recurrent neural network. One of them is
- 31:19called LSTM. Again, don't worry about
- 31:21the technicalities. Just remember it's
- 31:23under this kind of uh deep learning
- 31:26model, recurrent neural network, uh
- 31:29which will again uh have deep learning
- 31:32into it, hidden layers, in order to have
- 31:34some kind of prediction model. Uses
- 31:36transformers as well, similar to what
- 31:38GPT does, you know, generative
- 31:41pre-processing transformers. So,
- 31:43transformer model, which is a type of
- 31:45machine learning as well. So, you can
- 31:47think about it. The idea at the end of
- 31:48the day, I want to look at price of T
- 31:50plus one, T's time, the next or the next
- 31:54data point. If this is a price model,
- 31:57you know, I stop here. I want to look at
- 31:58the next one. So, think about it as
- 32:00price T plus one, so a future model is a
- 32:03function of price, volume, news, and
- 32:07many other things, right? So, I want I
- 32:09will have a function of this. This is
- 32:10something I would predict. I would
- 32:12generate from these models. So, I would
- 32:15feed in all these data, generate this
- 32:17machine learning model that we can use
- 32:20for future predictions. This is the
- 32:21idea. So,
- 32:23tomorrow's price depends on today's
- 32:25price, volume, news, sentiment,
- 32:29emotions, you know?
- 32:31Uh there's a lot of randomness. There
- 32:33are things that could happen beyond your
- 32:34control. All of a sudden, there is war.
- 32:37The model cannot predict war, or maybe
- 32:39it can. Uh some external factors, some
- 32:41noise even there. So,
- 32:44for example, let me give you an example,
- 32:45like I always do.
- 32:46Suppose I have a a price model, like
- 32:49before, is 0.6 price of D to the
- 32:53previous price The future price is the
- 32:55current price at 0.6
- 32:570.2 + 0.2 * volume + 0.3 * news. Again,
- 33:02I gave you a very very basic linear
- 33:05model. It's not always the case, but
- 33:07assume this is the model that we
- 33:08generated
- 33:10using, again, deep learning and
- 33:12transformers. So,
- 33:14suppose today the price is $100, the
- 33:17volume is 50, we normalize it, as I
- 33:19said, on a scale. Then, news is 0.8,
- 33:22again, normalized, assuming it's between
- 33:24-1 and 1. So, this is meaning
- 33:26sentiments. How positive is the news,
- 33:29right? So, how positive? 0.8, kind of
- 33:31positive, good news. So, think about it
- 33:34as 0.8 meaning the news is good.
- 33:37Obviously, if it's negative, it's bad,
- 33:39and something in the middle, it's not.
- 33:41So, based on this, I could plug in the
- 33:42value. I plug them in, ta-da-da, just
- 33:45multiply, we all know how to multiply.
- 33:48We get $70. Wow. So, the price was $100.
- 33:53Our predicted model predict the next
- 33:55price is $70. So, if you're trading, if
- 33:58you're trading online, and you see the
- 34:00price is going down, go ahead and sell
- 34:02now, immediately, right? You're going to
- 34:04lose $30 if this prediction model's any
- 34:08It's kind of accurate, depending on
- 34:09accuracy. Again, we've talked about
- 34:10accuracy before.
- 34:12So,
- 34:13the model predicts a lower price, so,
- 34:16even though the news is positive,
- 34:19the model still predicts a huge drop.
- 34:22So, why is that? Ask yourself, why?
- 34:25Look at this, why? Because the dominant
- 34:28factor was what?
- 34:30Okay? The price weight decrease by 0.6
- 34:35automatically. So, the price weight here
- 34:38is what was dominating this whole model.
- 34:41Yes, the news affected it, but not much.
- 34:44So, that's why. You could look at this
- 34:45and you can see obviously 0.6, this
- 34:47coefficient is really what affected the
- 34:50decrease. And before I do anything, I
- 34:52already lost
- 34:5340% of my value. I started with a 100 *
- 34:570.6, that's 60. I lost already 40, and
- 35:00the others tried to help, you know? The
- 35:03news increased it a bit, and the volume
- 35:07also did not do what? Increased it a bit
- 35:09as well. Okay? So, by one.
- 35:11But, this did mu- mu- much of the heavy
- 35:14lifting, right? And this one is kind of
- 35:16did the heavy lifting downwards.
- 35:19Affected. So, this is really
- 35:20interesting, and this is why I want you
- 35:22to really reflect on these examples.
- 35:25It's not about the formulas. Excel can
- 35:27do it. ChatGPT can give you these
- 35:29formulas.
- 35:30It's about you understanding and making
- 35:32human decisions. And this is what I I
- 35:35always try to focus on. Okay. So, guys,
- 35:37this is an example of this time series I
- 35:39was telling you about. Stocks over time,
- 35:41you could see. You could see
- 35:44the data. We have daily stock sales,
- 35:46website traffic, anything we could we
- 35:48could plot its data. There is a trend
- 35:51you could see here upward. We have some
- 35:53fluctuations. So, you could see it's
- 35:54going up, then it fluctuates a bit here,
- 35:57then goes up again, then fluctuates
- 35:59here. Then it goes up, fluctuates here.
- 36:01So, So, these are again, you can have
- 36:02noise even there. So, the idea is AI
- 36:06learns patterns, tries to understand
- 36:07what's happening. So, when it fluctuated
- 36:09here, what happened? When it went from
- 36:12here to here? It tried to figure out
- 36:14what are the things happening in its
- 36:16model in the specific time that caused
- 36:20this decrease. Same thing here and here
- 36:22and there. So,
- 36:24is it predictable? Of Of it's
- 36:25predictable to an extent. We do still
- 36:27have random events,
- 36:29but there are trends that we can use in
- 36:31order to generate beautiful models.
- 36:35Again,
- 36:36one of the things that will happen
- 36:39we do have noise. What is noise? Meaning
- 36:41data that don't don't belong there.
- 36:44Things that happened or they're
- 36:45affecting our time series to look ugly,
- 36:48not very smooth.
- 36:50We call these noise. So, what people do
- 36:52usually do is something called the
- 36:53moving average. Very simple. Instead of
- 36:56me always taking the points, I will take
- 36:58the average of the points. Very similar
- 36:59to what we do in filtering. You know, if
- 37:02I'm using a filter now in the camera,
- 37:04okay, or use it when you take pictures,
- 37:06what it does it does the filter. This
- 37:07filter is doing the moving average. It's
- 37:09taking, you know, your your skin around
- 37:13here and if there's something
- 37:14anomaly, maybe a pimple, it will take
- 37:17the average the color and divide it and
- 37:21then put it instead of that point. You
- 37:24would see that it went away as if you
- 37:25erased it, you know? So, think about
- 37:27this what This is what the moving
- 37:29average is. Simply taking the values
- 37:32around a point. You could make N as big
- 37:34as you want. The bigger it is, the
- 37:37bigger the window is.
- 37:39In order to be removed noise to an to an
- 37:41extent, right? So, this will kind of
- 37:44help us detect trends more efficiently,
- 37:46ignore some kind of noise. So, it will
- 37:48smooth the data. We don't want to always
- 37:49do this, of course. Sometimes we won't
- 37:53very smooth a lot. If this window If N
- 37:55is very big, you might lose some things
- 37:58that we need to know, of course, right?
- 38:00So, so it's a very risky thing to do,
- 38:02but still it's good to remove noise and
- 38:04some sudden events over time. You can
- 38:06see here, we have a moving average.
- 38:09The orange thing is the moving average
- 38:12and the actual data is this. So, yes,
- 38:15you could see it's a smoother curve,
- 38:17although it might hurt sometimes. So, we
- 38:20You to avoid making N or averaging over
- 38:23more points. That would cause
- 38:26a worse performance, okay?
- 38:28So, ideally I'm always comparing actual
- 38:31versus forecasted. So, what you actually
- 38:34got, what you predicted, what you
- 38:36forecasted. So, it could give us an idea
- 38:39uh
- 38:40that of course our models won't give us
- 38:42a perfect answer. They approximate. You
- 38:44could see in this case, so if I had a
- 38:46linear model, this is my linear model,
- 38:48like the one I gave you for the price,
- 38:50for example. That was purely linear.
- 38:52Purely linear meaning it's a line.
- 38:54Obviously, the real world is not a line.
- 38:55You could see the forecasted and the
- 38:58actual
- 38:59uh compared to each other, okay?
- 39:02So, the biggest prediction error is when
- 39:05we have peaks, you know, when it's going
- 39:06up, going down,
- 39:08um
- 39:09when it's not very volatile, we could
- 39:11get some mistakes over time, okay?
- 39:14So, another example that I'll talk about
- 39:16are seasonal patterns. This is
- 39:18interesting. I like this.
- 39:19Seasonal patterns are ideally as things
- 39:21happen over seasons, right? So, AI will
- 39:24be able to detect this. So, repeating
- 39:27patterns, for example, holiday sales,
- 39:30right? I don't know if you know Black
- 39:31Friday, uh
- 39:33over summer. These are kind of obvious,
- 39:35but sometimes we have other things,
- 39:36other season, Easter, and so on. So,
- 39:38these will affect our data. So, we
- 39:40cannot simply look at the data that the
- 39:42way we just looked at it now. Just plot
- 39:44a curve over time. We can't because when
- 39:46it went down here because something was
- 39:48happening. There's a seasonal impact,
- 39:50you know? Regular ups and downs, some
- 39:53trends are there. So,
- 39:56they usually repeat themselves because
- 39:58of these specific seasons.
- 40:00Uh so, if you look at here, you could
- 40:01see these are seasonal sales. You could
- 40:04see here, oh wow, it's a peak here.
- 40:06Doesn't mean your restaurant is very
- 40:09good. No, maybe this is a season. High
- 40:11season versus low season, right? Even
- 40:13plane tickets look at these patterns
- 40:16when they put the price of the ticket
- 40:18automatically. So, it's kind of easy if
- 40:20it's fixed, if it's based on calendar
- 40:22days, we don't need AI to do this.
- 40:25Obviously, AI needs to use this in its
- 40:27model when predicting because you don't
- 40:29want it to be
- 40:30confused about these seasons because we
- 40:33don't have a consistent pattern over
- 40:35time. So, obviously, examples would be,
- 40:37as I said, Black Friday, Ramadan
- 40:39shopping, which is where you know,
- 40:41Ramadan, back to school, all these are
- 40:44examples of seasonality. Uh
- 40:47So,
- 40:49anomalies
- 40:50exist. We talked about fraud detection
- 40:53before. So, these transactions are we
- 40:56call them anomalies. Just in case these
- 40:59points do not belong there, hence
- 41:01they're abnormal. So, AI wants to focus
- 41:03on these anomalies and figure out what
- 41:07happened there and flag them because
- 41:10humans might miss them. And this applies
- 41:12not only to fraud. I only put fraud as
- 41:14an example. Anomalies could apply to
- 41:16stocks prediction, loan default. Loan
- 41:20default, the guy won a lottery. You
- 41:22know, all of a sudden, he's paying his
- 41:24loan. It doesn't mean
- 41:27this is the norm. This is an anomaly,
- 41:30you know?
- 41:31AI would be able to detect these as
- 41:33well. So, anomalies could be present in
- 41:36every single pattern in business and
- 41:38finance, and our goal is to kind of
- 41:40figure these out. This is an example of
- 41:41anomalies. You can see these points are
- 41:44anomalies, and
- 41:47we in the fraud detection example, do we
- 41:50have to detect each one of them as a
- 41:51fraud? We don't have to, of course, but
- 41:53most likely we flag them and we look at
- 41:56them more. Some could be valid. So, a
- 41:58human plus AI will work together to
- 42:01figure out if it's an anomaly or not.
- 42:03Okay?
- 42:04The fifth example is customer
- 42:06segmentation that I I talked about in
- 42:08the beginning. So, we could use we group
- 42:10customers to different groups.
- 42:13This is very nice. So we use K-means
- 42:15clustering. So we we put them in
- 42:17specific clusters. We assign points to
- 42:20them. And now we know that you belong to
- 42:22this cluster. What it means? It means if
- 42:24I'm doing a marketing campaign, if I
- 42:26want to sell you something, you all guys
- 42:28belong to the same cluster. So customer
- 42:30segmentation is very popular when it
- 42:32comes to you know, marketing, business
- 42:34plans, targeted marketing, pricing
- 42:37strategies. All these are things that we
- 42:40could look at. So this is an example of
- 42:42customer segmentation. So we have two
- 42:43clusters, the blues and the oranges. And
- 42:47therefore we could define
- 42:50what to do with each. Okay?
- 42:52So we're looking at AI. What does it
- 42:55look?
- 42:56Again, to summarize what I gave in these
- 42:58examples and trends, we look at the
- 43:00long-term direction, seasonality, we
- 43:02look at repeating patterns, noise, we
- 43:06look at randomness, anomalies,
- 43:09we look at rare events. So AI tries to
- 43:11learn these in its models. So these are
- 43:14the things that it kind of tries to
- 43:15learn in order
- 43:18to have a nice prediction model, which
- 43:20is based on the learning patterns and
- 43:22had handling any uncertainty. Okay? So
- 43:26again, just a quick review of what we
- 43:28did. So stock prediction, what approach
- 43:30should we use?
- 43:32Time series. Fraud detection, anomaly
- 43:35detection.
- 43:36Sales forecasting, seasonality models.
- 43:40So these are some examples of models
- 43:41that we discussed today and the problems
- 43:44that we have
- 43:46in the business and finance world. Okay?
- 43:49Six is recommendation systems.
- 43:52In the business of finance. So we want
- 43:53to make some recommendation. So the idea
- 43:55is I want to suggest a product for you
- 43:57to buy. Again, we've all seen it on
- 43:58Amazon. If you use Amazon, similar to
- 44:00Netflix recommending a movie.
- 44:03Netflix, Amazon are very good examples.
- 44:06So, we use collaborative filtering,
- 44:09content-based
- 44:11uh filtering as well and algorithms. We
- 44:13use similarity.
- 44:15So, we look at something called cosine
- 44:17similarity to look at how close and how
- 44:20similar users are. Again, don't panic. I
- 44:23know you guys cosine similarity. I'm
- 44:25panicking. Don't worry, they're very
- 44:26easy. I'll give an example now. So,
- 44:30for example, user likes action movies,
- 44:32we recommend something similar. Uh what
- 44:34we use is this. So, I'll talk about
- 44:36collaborative filtering and
- 44:37content-based as well uh later on, but
- 44:40for now similarity is very interesting,
- 44:42very simple. So, we want to define
- 44:43something called a vector. Each user and
- 44:46I want to see how similar users are. So,
- 44:49when we make a recommendation, it's
- 44:50similar to clustering. Clustering is a
- 44:52bit uses something similar behind the
- 44:54scenes. Here, we're only measuring
- 44:56similarity and again, very similar to
- 44:58friend uh friends' recommendation, how
- 45:01similar people are. It's not simply he's
- 45:03a friend of this, then therefore, you
- 45:05should be a friend with him. No. We
- 45:07don't look at similarities based on the
- 45:09dot product formula, cosine formula.
- 45:12Okay, let me give you an example.
- 45:14Again, one more time, the the formula is
- 45:16simple. It's A * B dot product, meaning
- 45:20it's a vector. Uh I have A1, A2 and you
- 45:23are B1, B2. This is a dot product. So,
- 45:26it's going to be A1 * B1 + A2 * B2.
- 45:30Simple. You You multiply them and the
- 45:32the bottom part is the magnitude of A
- 45:35and the magnitude of B. So, we're going
- 45:37to take typically Euclidean, so A
- 45:39squared + B squared. Like you find the
- 45:41distance between two points. Once you do
- 45:43the formula, you need to know this,
- 45:45please. It's simple,
- 45:47uh
- 45:47but you need to know what it means.
- 45:49That's what I care about more, not how
- 45:51to calculate it, okay? So, let me give
- 45:53you an example. You have two users
- 45:54rating uh three movies.
- 45:58Again, user A.
- 45:59You know in Netflix, I will sometimes
- 46:01ask us to rate a movie. So, I want to
- 46:03put an example you can correlate with.
- 46:04So I watched movies I gave the first one
- 46:06530 and we gave it 432. Are these guys A
- 46:10and B similar? Now if you look at it you
- 46:12say oh doctor we don't need the formula.
- 46:14It's about doctor right? Because they're
- 46:16close right? It looks close. Like both
- 46:18of us liked movie one, both of us like
- 46:21liked movie two. Give it high.
- 46:24And both both of us disliked movie
- 46:26three. You give it two I give it a zero.
- 46:28Suppose I'm A you're B. Yes we could
- 46:30look at this but imagine you have a
- 46:31million.
- 46:32Let's put a billion
- 46:34users over Netflix watching a thousand
- 46:36movies. Then you have a thousand billion
- 46:40of this table. Okay? Imagine how many
- 46:42rows you have, how many mappings you
- 46:44have. Not only A and B, A and B and C
- 46:47and D and E and F.
- 46:48And the thousand others and the billion
- 46:50others.
- 46:52So this would be when non-polynomial
- 46:53time if you know a bit about algorithms.
- 46:56It'll be an NP problem. There's no
- 46:58solution for it.
- 47:00By you simply looking and you can't even
- 47:02see kind of do brute force and looping
- 47:05on every one of them is going to be too
- 47:06much. Obviously by looking at it the
- 47:08example I made is simple but let's do
- 47:10the formula. You know again if I have a
- 47:12simple similarity formula one more time
- 47:15AI does way more than this but I'm just
- 47:17giving you an example for you to
- 47:18understand.
- 47:19So so I'm going to make them as vectors
- 47:21so A is basically user A rated 530, 530
- 47:26B rated 432. I want to find the dot
- 47:29product and the magnitude because
- 47:31similarity cosine formula works this
- 47:33way. By the way you have many
- 47:34similarities formulas not only one you
- 47:36have about 10 of them we teach I teach
- 47:38this in another course advanced not in
- 47:41this course of course. You don't care
- 47:42all you need to know are there's
- 47:43something called similarity how similar
- 47:46things are. So it's easy. So let's go
- 47:48ahead and do this.
- 47:49We do the dot product A.B 54 3*3 + 0*2.
- 47:54Okay? So one more time 5*4 3*3 0*2 we
- 47:59get 29. Again, this is my numerator. My
- 48:02denominator is the distance between two
- 48:04points. Something they taught you, I
- 48:06don't know, intermediate school. You
- 48:08know how to find the distance. So, let's
- 48:10go ahead and do this. So, we compute the
- 48:12magnitude, the distance is
- 48:155 squared. So, A squared all these guys
- 48:18under a square root. That's it. So, this
- 48:19is what we call
- 48:21Euclidean, basically, right? 5 squared +
- 48:233 squared + 0 squared = 34. The
- 48:25magnitude of B
- 48:28Okay? It's 4 squared + 3 squared + 2
- 48:31squared square root 29. Then we put it
- 48:33in the formula. Let's go ahead and do
- 48:34this. So, this is the formula in case
- 48:36you forgot. We're going to put it here.
- 48:38We got 0.92. We kind of saw that without
- 48:41even doing the formula. We saw that A
- 48:43and B are close. I agree, but again, as
- 48:45I said, imagine you have thousands of
- 48:47them and multiple not only three movies,
- 48:49right? So, yes, the very high
- 48:52similarity, meaning these have similar
- 48:55tastes. A and B have similar tastes. So,
- 48:57therefore, I'm going to make a
- 48:58recommendation
- 48:59I'm going to recommend to A movies that
- 49:02B
- 49:04you haven't watched, but B watched them,
- 49:06for example. So, rated movie, for
- 49:08example
- 49:10The rating could be zero or haven't
- 49:13watched it. That's why I did not give it
- 49:15a rating yet, suppose. So, what B has
- 49:17watched it, gave it a two, maybe I could
- 49:20recommend it. Obviously, our example's
- 49:21not a good one. I could have better
- 49:23example, meaning I will also add a
- 49:25column to do watch or did you
- 49:26did you not watch it? But you got the
- 49:28point. We figured out that A and B are
- 49:30similar. Same thing applies to buying
- 49:32things, advertisements that you see on
- 49:35Instagram and Tik Tok that you get.
- 49:38They're not magic. You got them for a
- 49:40reason. Either because of you, what
- 49:42you've done, an email that you got, or a
- 49:45WhatsApp message, or your friends, or
- 49:48people similar to you, okay? So, this is
- 49:51the idea.
- 49:52So, that we have a lot of challenges. Uh
- 49:54biased this data privacy. You see many
- 49:56of the examples I gave you,
- 49:58I really kind of invaded your privacy. I
- 50:00said, "Oh, I'm going to see what did you
- 50:02buy a plane uh ticket? I'm going to see
- 50:05how you spend your money." This is all
- 50:07invasion of privacy. Who's going to
- 50:09allow others to check out their credit
- 50:11history, right? Or your your credit card
- 50:13statement. Maybe your bank can do it.
- 50:15And this is something I'm going to give
- 50:17you example. Uh MasterCard was able to
- 50:19do. So, yes, we have some issues. So,
- 50:22biased data It could be biased like we
- 50:24all always say about biasedness because
- 50:27of the data that we use for training. Uh
- 50:29privacy issues a lot. Overfitting, I've
- 50:32talked about this before.
- 50:34I mean, where my data was not good
- 50:36enough and I trained it on a specific
- 50:38pool of data uh
- 50:40that wasn't really representative of the
- 50:42whole set. So, when I want to do
- 50:44prediction, my prediction would not be
- 50:45good.
- 50:47Market is very unpredictable as well.
- 50:49So, again, if you look at ethics, so,
- 50:52if I want to give you a loan, my my
- 50:54algorithm could be biased, very similar
- 50:55to biased in hiring. Biased towards
- 50:57gender, biased towards a specific group
- 51:00of people. Again, this is what we refer
- 51:02to as algorithmic bias.
- 51:04It could be unfair. Could deny loans.
- 51:08Again, based on the data. It's not very
- 51:09transparent. I've talked about
- 51:11transparency before. We don't know how
- 51:13the AI system is doing it.
- 51:15We can't.
- 51:16Uh even if we do, we won't understand
- 51:18the decisions behind it. So, it could be
- 51:20Again, this is an example based on where
- 51:23you live.
- 51:24Uh yeah, Montauk. You might get a loan
- 51:26or not get a loan. So, this could be
- 51:28very unfair, very biased. So, again, we
- 51:32need to regulate this. So, ethics, when
- 51:34it comes to AI in business and finance,
- 51:35is a huge topic. It's a course on its
- 51:37own. Okay?
- 51:39Let's look at some a real-world
- 51:41applications just to finish this
- 51:42lecture. Very nice lecture. I like it
- 51:44cuz it has to do with money, right? So,
- 51:47if you look at
- 51:48uh
- 51:48JP Morgan, they used AI for legal
- 51:52contracts. So, they they did uh
- 51:55again, about 360,000 hours of manual
- 51:58work using AI. They used NLP, document
- 52:02classification. Again, you all know JP
- 52:04Morgan, right? They used it for legal
- 52:06documents. Uh obviously, it could go
- 52:08wrong. So, we could have some issues by
- 52:10misinterpret- interpreting. That's why
- 52:12we still need humans, but this is a
- 52:14real-world example. I always When I give
- 52:16you these examples, I want to give you
- 52:17something that's real. Do not make this
- 52:19up. So, it was on the news. So, we have
- 52:21some issues, of course, legal,
- 52:23financial, or liability risks that could
- 52:25happen with something like this. Again,
- 52:27you can check out the video
- 52:30uh JP Morgan.
- 52:32Uh
- 52:32again, these are some examples.
- 52:35Okay, let's let's unpack this.
- 52:36>> Again, this is
- 52:37>> on artificial intelligence in banking,
- 52:39So, this is something using um
- 52:42notebook LM
- 52:44created a podcast for you to see how um
- 52:47AI can be used in banking and some
- 52:49examples. This is nice. You could hear
- 52:51listen to this, but again, I wanted to
- 52:53do it
- 52:55show you an example of using an AI tool
- 52:57to explain AI in business. So, you can
- 52:59check this out, okay?
- 53:01Let me just stop this, okay?
- 53:03So, AI in fraud detection,
- 53:05um it could monitor
- 53:07uh as I said, I already talked about
- 53:09this. Real-time banking, this is already
- 53:11used. So, the example we use about fraud
- 53:13detection is used in many banks, top
- 53:15banks. There are some breakthroughs on
- 53:18the news it was.
- 53:19Uh they use anomaly detections. Uh false
- 53:22positive, false negatives could happen,
- 53:24of course. False negative, the missed
- 53:27fraud, is what we need to be aware of,
- 53:29okay? Again, I put a short video
- 53:32uh to see fraud in the age of AI. I'll
- 53:34just show you what I mean. It's a
- 53:361-minute thing about JP Morgan payments.
- 53:40When AI takes over the account, access
- 53:42still looks legitimate. But subtle
- 53:45signals emerge. Unusual amounts, new
- 53:47recipients, transactions that break
- 53:50expected patterns.
- 53:52In 2024, more than 1 million identity
- 53:55theft cases were reported. Okay, stop
- 53:57here. So, in 2024, more than 1 million
- 53:59identity theft we had. Imagine. Again,
- 54:03using AI, hopefully. 1 million, that's
- 54:06huge. You know, people impersonating
- 54:09others and stealing their identity to do
- 54:11some financial stuff. Let me just stop
- 54:13here. So, again, you could check this
- 54:15out on your own. Um
- 54:19uh as a real example. So, we could have
- 54:21Oh, yeah, this is huge. AI scams and
- 54:24deep fakes, this is all over the place.
- 54:26I'll give you examples. So, AI
- 54:29was used to impersonate executives as if
- 54:33using deep fakes. Like, you're looking
- 54:34at me now. Hopefully, I'm real. Uh they
- 54:37had deep fakes, and they were
- 54:41that led to a loss of 25 million
- 54:43dollars. Again, this was on the news.
- 54:46They used fake voice, fake video. Uh
- 54:49they used deep learning, voice cloning.
- 54:52Um you could see, AI is good.
- 54:54Uh but in this case, it was used for
- 54:56bad.
- 54:58And I put the link there. You could read
- 55:00about what's what's happened. There's a
- 55:01scammers using this, of course. To fight
- 55:04AI, we need to use AI. The same thing
- 55:06when we we talk about security. To fight
- 55:09uh thieves, you need a thief on in your
- 55:12team to understand how thieves think,
- 55:15right? Same thing with cybersecurity.
- 55:17You know, many of the hackers ultimately
- 55:20work for the FBI and CIA because they
- 55:23understand how hackers think. So, same
- 55:25thing here. AI that understands AI, you
- 55:27know?
- 55:28Uh so, we need to defend use of
- 55:30multi-factor authentication, AI
- 55:32detection systems, human verification as
- 55:34well. Mastercard is another example
- 55:38at scale I put here they're using a new
- 55:41gen AI models huge processing billions
- 55:45of transaction you're looking at
- 55:47MasterCard to Visa and MasterCard huge
- 55:50you have billions of transactions so
- 55:52they claim they they they double the
- 55:55fraud detection accuracy using their AI
- 55:57model by the way each one have their own
- 56:00AI model they don't share too much
- 56:02information about it and because they're
- 56:04using their data to train it to become
- 56:06more smart or smarter over time they use
- 56:09something called graph neural network I
- 56:10mentioned it a bit when I talked about
- 56:12molecules we talked about
- 56:16health care AI and health care so that's
- 56:18what we refer to as graph neural network
- 56:20and behavior analytics how people are
- 56:22behaving and this really shows the scale
- 56:25of AI
- 56:26going to finish this lecture what do you
- 56:28think about a business AI system define
- 56:32what the problem is what data you need
- 56:34what model you need what risks are there
- 56:36again this is a small example if we were
- 56:39in class we'd do this live for you to
- 56:42kind of envision this so please reflect
- 56:44on this on your own so I I want to
- 56:46create a new business a new startup and
- 56:49let's define these what are we trying to
- 56:51solve using AI what kind of data do I
- 56:53need what kind of model call it a
- 56:56function f of x
- 56:58and these are the parameters x1 x2 x3 x4
- 57:01x5 x6 and these are the what the things
- 57:03I'm going to feed to the model and then
- 57:05you could sit with a computer scientist
- 57:06like me or anybody and say write me a
- 57:09program to take these model take these
- 57:11data and generate an AI model and this
- 57:15could give you make you billions of
- 57:16dollars if you really have a model that
- 57:19has high accuracy high precision you
- 57:23know high recall the things that we
- 57:25already discussed before okay so yes AI
- 57:28is transforming businesses decisions are
- 57:31becoming data driven and really changing
- 57:35everything and human oversight has to
- 57:37always be there
- 57:39whether we like it or not. Okay, so the
- 57:41humans
- 57:43are the are the core. So I'm going to
- 57:45I'm going to stop sharing.
- 57:47Okay, so
- 57:49thank you so much. I hope you enjoyed
- 57:51this lecture as much as I did and I will
- 57:53see you in the next lecture. Take care.
About this transcript
This page contains the full transcript of AI in Business and Finance by Mohamed Watfa, generated from the public captions YouTube serves with the video. The transcript has 10,193 words across 1,558 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.