Downloads are text notes. Choose Save as PDF in your browser’s print dialog for a PDF copy.
Understand the concept
Artificial intelligence is a broad field of systems that perform tasks associated with intelligence. Machine learning learns patterns from data. Deep learning is a family of machine-learning methods using multilayer neural networks. A rule-based program can belong to AI without learning from data.
Supervised learning uses labeled examples: spam messages with known labels, or house features with prices. Unsupervised learning explores structure without those target labels, for example clustering similar observations. Reinforcement learning learns a policy through interaction and rewards over time.
Generative models produce content such as text or images. These categories overlap rather than form an exclusive list: a generative model can use deep learning and several training stages. The code below is a transparent rule-based router for illustration, not a trained classifier. It misses cases that its rules do not cover.
Run the example
def route_message(text):
text = text.lower()
if "invoice" in text:
return "billing"
if "password" in text:
return "account support"
return "manual review"
print(route_message("Where is my invoice?"))
print(route_message("Hello there"))
Output / what to expect
billing
manual review
Try it yourself
Categorize: predicting labeled churn, grouping articles without labels, and learning a game policy from rewards. Give one limitation of the router.
View a suggested solution
# Labeled churn: supervised learning.
# Grouping unlabeled articles: unsupervised learning.
# Game policy learned from rewards: reinforcement learning.
# Limitation: "I cannot log in" has no password keyword and goes to manual review.
# A message containing both keywords takes the first matching branch.
Artificial intelligence ek broad field hai jahan systems intelligence se jude tasks karte hain. Machine learning data se patterns seekhta hai. Deep learning ML ka ek family hai jisme multilayer neural networks use hote hain. Rule-based program bhi AI ka part ho sakta hai bina data se learn kiye.
Supervised learning labeled examples use karta hai: known spam labels ya house features ke saath prices. Unsupervised learning target labels ke bina structure explore karta hai, jaise similar observations ke clusters. Reinforcement learning environment se interact karke aur time ke saath rewards se policy seekhta hai.
Generative models text ya images jaise content banate hain. Categories overlap karti hain: generative model deep learning aur multiple training stages use kar sakta hai. Neeche ka code rule-based router ka illustration hai, trained classifier nahi. Jo cases rules cover nahi karte, woh miss ho sakte hain.
Code chalao
def route_message(text):
text = text.lower()
if "invoice" in text:
return "billing"
if "password" in text:
return "account support"
return "manual review"
print(route_message("Where is my invoice?"))
print(route_message("Hello there"))
Output / kya expect karein
billing
manual review
Ab khud try karo
Categorize karo: labeled churn predict karna, bina labels articles group karna, aur rewards se game policy seekhna. Router ki ek limitation bhi batao.
Solution dekho
# Labeled churn: supervised learning.
# Grouping unlabeled articles: unsupervised learning.
# Game policy learned from rewards: reinforcement learning.
# Limitation: "I cannot log in" has no password keyword and goes to manual review.
# A message containing both keywords takes the first matching branch.
Run the example and attempt the exercise before marking this lesson complete.
pass the idea on
What did this make you think?
You review and publish the post yourself. Instagram uses your device’s share menu when available; otherwise copy the text and link. Facebook opens the link composer, where you add your thoughts.