Ai Notes
Ai Notes
Machine Learning aik aisi technology hai jo computers ko bina specifically program kiye hue
data se seekhne aur improvement karne ki ability deti hai. Yani ke, computer algorithms ko
data ke zariye train kiya jata hai taake wo future mein data ke mutabiq decisions le sakain.
1. Data: Machine learning ka pehla step data hota hai. Ye data kuch bhi ho sakta hai, jaise ke
text, numbers, images, etc.
2. Features: Features data ke wo attributes hain jo learning process mein important role
play karte hain.
1. Supervised Learning: Ismein labeled data use hota hai jahan input aur output dono
defined hote hain. Algorithm ko inputs aur unke corresponding outputs se seekhne diya
jata hai. Example: Spam email detection.
2.
1. Clustering: Clustering mein hum data points ko similar characteristics ke base pe groups
ya clusters mein divide kartay hain. Yani ke hum ye samajhnay ki koshish kartay hain ke
data mein konsi patterns ya structures hain. For example, customer segmentation in
marketing. Clustering further do types ki hoti hai:
Hierarchical Clustering: Is method mein hum nested clusters banatay hain by
progressively splitting or merging them.
Partitioning Clustering: Is method mein hum n clusters banatay hain. Jaisa ke K-means
clustering.
2. Dimensionality Reduction: Dimensionality reduction mein hum high-dimensional data ko
low-dimensional data mein convert kartay hain. Yani ke hum ye samajhnay ki koshish
kartay hain ke data mein konsi features most important hain. For example, Principal
1. Reinforcement Learning: Ismein agent ko actions aur rewards ke zariye seekhne diya jata
hai. Agent environment ke sath interact karke apni performance ko improve karta hai.
Example: Game playing bots.
1. Data: Machine Learning models ko train karne ke liye data ki zaroorat hoti hai. Data ko
typically features (inputs) aur labels (outputs) mein divide kiya jata hai.
Data types
Machine Learning mein data ko typically do main types mein classify kiya jata hai:
1. Numerical Data: Ye data type numbers ko represent karta hai. Numerical data further do
types ki hoti hai:
Continuous Data: Ye data type infinite number of possible values ko represent karta
hai. For example, temperature, age, salary, etc.
Discrete Data: Ye data type finite number of possible values ko represent karta hai.
For example, number of students in a class, number of products in a store, etc.
2. Categorical Data: Ye data type categories ya labels ko represent karta hai. Categorical
data further do types ki hoti hai:
Nominal Data: Ye data type categories ko represent karta hai jin ka koi mathematical
meaning nahi hota. For example, color (red, blue, green), city (Lahore, Karachi,
Islamabad), etc.
Ordinal Data: Ye data type categories ko represent karta hai jo kisi specific order ya
sequence mein hotay hain. For example, ratings (poor, average, good, excellent),
education level (high school, bachelor’s, master’s, PhD), etc.
Machine Learning models ko train karne se pehle, hume categorical data ko numerical form
mein convert karna parta hai. Is process ko encoding kehte hain. For example, one-hot
encoding, label encoding, etc.
Ye yaad rakhain ke data type ki understanding bohat zaroori hai kyunki ye decide karta hai ke
hum kis type ki machine learning techniques use kar saktay hain. Best of luck!......
Model: Model wo function hai jo input features ko output labels mein map karta hai. Different
types ke problems ke liye different types ke models hote hain, jaise ke linear regression,
decision trees, neural networks, etc.
Ye models machine learning aur data science ke field mein unki effectiveness aur versatility ki
wajah se widely istemal hote hain.
1. Loss Function: Loss function ye measure karta hai ke model ki predictions kitni accurate
hain. For example, mean squared error (MSE) regression problems ke liye commonly used
hota hai.
2. Optimization Algorithm: Optimization algorithm model ke parameters ko adjust karta hai
takay loss function minimize ho. For example, gradient descent aik common optimization
algorithm hai.
3. Training and Testing: Data ko typically training set aur testing set mein divide kiya jata
hai. Model ko training set pe train kiya jata hai aur phir testing set pe test kiya jata hai
takay hum ye check kar saken ke model unseen data pe kaisa perform karta hai.
4. Overfitting and Underfitting: Overfitting wo hota hai jab model training data pe bohat
acha perform karta hai lekin unseen data pe acha perform nahi karta. Underfitting wo
hota hai jab model na to training data pe acha perform karta hai aur na hi unseen data pe.
5. Regularization: Regularization wo technique hai jo model ki complexity ko control karti
hai aur overfitting ko prevent karti hai.
6. Cross-Validation: Cross-validation wo technique hai jo model ki performance ko estimate
karti hai by using different subsets of the training data.
Ye kuch basic concepts hain jo Machine Learning ki understanding ke liye important hain..
1. Automation: Machine learning se bohot se tasks automate ho jate hain, jo pehle manual
intervention se kiye jate thay. Is se waqt aur resources dono bachat hain.
2. Data Analysis: Machine learning algorithms data ko bohot tezi aur accuracy se analyze kar
sakte hain. Yeh bade data sets me se useful patterns aur insights nikalne me madadgar
hotay hain.
3. Personalization: Machine learning ko use kar ke products aur services ko individual users
ke preferences ke mutabiq customize kiya ja sakta hai. Jese Netflix aur Amazon
recommendations systems.
4. Fraud Detection: Banks aur financial institutions fraud detect karne ke liye machine
learning algorithms use karte hain. Yeh algorithms unusual transactions aur patterns ko
identify karte hain jo fraud ki nishani hoti hain.
5. Predictive Maintenance: Industries me machine learning ko use karke machines ki
maintenance predict ki jati hai. Yeh machinery ki downtime aur repair costs ko kam karta
hai.
6. Healthcare: Medical field me machine learning se diseases ki early diagnosis aur
treatment me madad milti hai. Yeh algorithms patient data ko analyze kar ke accurate
diagnosis provide karte hain.
7. Improved Customer Experience: Customer service me chatbots aur virtual assistants
machine learning use karte hain jo 24/7 assistance provide karte hain aur customers ke
queries jaldi resolve karte hain.
8. Image and Speech Recognition: Machine learning se image aur speech recognition me
bohot behtari aayi hai. Facial recognition, voice assistants jaise Siri aur Google Assistant
is ka practical implementation hain.
9. Efficiency and Productivity: Machine learning se processes me efficiency aur
productivity increase hoti hai. Automated systems repetitive tasks ko jaldi aur effectively
perform karte hain.
Disadvantages of Machine
Learning
Machine Learning (ML) ke kuch nuqsanat bhi hain. Yahan hum kuch aam nuqsanat discuss
karain ge:
1. Data Dependency: Machine Learning models ka performance data par depend karta hai.
Agar data mein bias ya error ho to model ki predictions bhi ghalat ho sakti hain.
2. Time and Resources: ML models ko train karne mein bohat zyada waqt aur computing
resources ki zaroorat hoti hai, khas kar ke jab data set bohat bara ho.
3. Interpretability: Kuch ML models, jaise ke neural networks, bohat complex hote hain aur
in ki predictions ko samajhna mushkil hota hai. Isay hum “black box” problem kehte hain.
4. Overfitting: Agar model ko zyada optimize kar dia jaye to wo training data par to acha
perform kare ga lekin new data par acha perform nahi kar sake ga. Isay hum “overfitting”
kehte hain.
5. Security and Privacy: ML models ki predictions se sensitive information leak ho sakti hai.
Is liye inhe use karne se pehle security aur privacy ka khayal rakhna zaroori hai.
1. Training: ML models ko train karne ke liye data ki zaroorat hoti hai. Data ke bina, models
kisi pattern ya relationship ko seekh nahi sakte.
2. Accuracy: Model ki accuracy data par depend karti hai. Agar data sahi aur relevant ho, to
model ki predictions bhi accurate hongi.
3. Generalization: Agar hum diverse aur representative data se model ko train karte hain, to
model naye data par bhi acha perform kare ga.
4. Feature Selection: Data se hum important features identify kar sakte hain jo model ki
performance ko improve kar sakte hain.
5. Model Selection: Different types of data ke liye different ML models behtar perform karte
hain. Data ki understanding se hum behtar model select kar sakte hain.
Is tarah se, data ML mein central role play karta hai aur is ki quality aur quantity ML models ki
performance ko directly affect karti hai.
1. Image Recognition: One of the most common uses of machine learning is for image
recognition1.
2. Translation: Translation is a natural fit for machine learning1.
3. Fraud Detection: Financial institutions process millions of transactions daily. Machine
learning helps in detecting fraudulent transactions1.
4. Chatbots: Machine learning powers chatbots to provide better customer service1.
5. Generate Text, Images, and Videos: Machine learning can generate text, images, and
videos1.
6. Speech Recognition: Machine learning is used in speech recognition systems1.
7. Self-Driving Cars: Machine learning algorithms are used in the development of self-
driving cars1.
8. AI Personal Assistants: Machine learning powers AI personal assistants like Siri, Alexa,
and Google Assistant1.
9. Email Spam Detection: Machine learning is used for email spam detection2.
10. Customer Segmentation: Machine learning is used for customer segmentation based on
demographic data in sales and marketing2.
11. Stock Price Prediction: Machine learning is used for stock price prediction in finance2.
12. Claims Approval Automation: Machine learning is used for claims approval automation
in insurance2.
13. Content Recommendations: Machine learning is used for content recommendations
based on viewing history in media & entertainment2.
14. Natural Language Processing: Machine learning finds application in natural language
processing3.
15. Computer Vision: Machine learning is used in computer vision3.
16. Speech Recognition: Machine learning is used in speech recognition3.
17. Agriculture: Machine learning finds application in agriculture3.
18. Medicine: Machine learning finds application in medicine3.
Traditional Programming:
Is approach mein, programmer rules (code) likhta hai jo input data ko process kar ke
output generate karta hai.
Yani ke, programmer ko problem ka solution pata hona chahiye takay wo usay code mein
express kar sake.
For example, agar hume aik calculator program banana hai to hume pata hona chahiye ke
addition, subtraction, multiplication, aur division kaise hota hai.
Traditional programming real-world
problems solve
Jee, yahan kuch real-world problems hain jin ko hum traditional programming se solve kartay
hain:
Ye yaad rakhain ke har problem ke liye best solution find karne ke liye hume problem ko achi
tarah samajhna parta hai. Best of luck!
Machine Learning:
Is approach mein, hum machine learning model ko input data aur corresponding output
data provide kartay hain. Model khud hi rules (patterns) learn karta hai jo input data ko
output data mein map kartay hain.
Yani ke, hume exact solution ki zaroorat nahi hoti. Model khud hi solution learn karta hai
data se.
For example, agar hume aik email spam detection system banana hai to hume exact rules
define karne ki zaroorat nahi hoti. Hum model ko spam aur non-spam emails provide
kartay hain aur model khud hi learn karta hai ke email spam hai ya nahi.
Ye yaad rakhain ke dono approaches ki apni strengths aur weaknesses hain. Kuch problems ke
liye traditional programming behtar hoti hai jab ke kuch problems ke liye machine learning
behtar hoti hai. Best of luck!
Machine learning Real-world problems
solve
Machine Learning (ML) ke applications bohot zyada aur diverse hain. Yeh technology kai
industries mein real-world problems solve karne mein madadgar sabit hui hai. Chaliye, in
applications ko thoda detail mein dekhte hain:
1. Product Recommendations:
ML algorithms images aur videos ko recognize kar sakte hain. Facial recognition, object
detection, aur scene understanding jaise tasks mein ML ka bohot bada role hai. For example,
Facebook apne platform par photos mein logon ko tag karne mein facial recognition use karta
hai.
3. Virtual Assistants:
Siri, Alexa, aur Google Assistant jaise virtual assistants ML algorithms use karke user ke voice
commands ko samajhte aur respond karte hain. Yeh assistants natural language processing
(NLP) ka use karte hain.
4. Gaming:
Gaming industry mein ML ka use intelligent aur adaptable gaming experiences banane ke liye
hota hai. For example, ML algorithms opponents ke behavior ko predict karke games ko
challenging bana sakte hain.
5. Healthcare:
Healthcare mein ML algorithms diseases predict karne, patient care improve karne aur
personalized treatment plans banane mein madadgar hain. For example, ML models
symptoms ke basis par diseases diagnose karne mein doctors ki madad karte hain.
6. Environment Protection:
ML algorithms weather patterns predict karne, wildlife ko monitor karne aur environmental
changes ko track karne mein use hote hain. For example, ML se endangered species ki tracking
aur deforestation monitoring mein madad milti hai.
7. Dynamic Pricing:
ML real-time data ko analyze karke industries jaise airlines aur ride-sharing services mein
dynamic pricing implement karta hai. Isse companies ko demand aur supply ke hisaab se
prices adjust karne mein madad milti hai.
8. Finance:
Finance sector mein ML stock market prediction, credit scoring, fraud detection aur risk
management jaise areas mein innovative solutions provide karta hai. For example, ML
algorithms fraudulent transactions ko detect karne mein madadgar hote hain.
9. Education:
Education mein ML personalized learning experiences create karne mein madad karta hai. Yeh
individual students ke learning style aur pace ke mutabiq content suggest karta hai. For
example, adaptive learning platforms like Khan Academy.
10. Transportation:
Transportation sector mein ML real-time traffic data ko analyze karke routes optimize karta
hai. Isse travel time reduce hota hai aur efficiency improve hoti hai. For example, Google Maps
ka route optimization feature.
Machine Learning ka istamaal bohot zyada aur rapidly grow kar raha hai, aur future mein aur
bhi naye applications aur innovations dekhne ko milenge. Agar aap kisi specific application ke
baare mein aur detail mein jana chaahte hain, to zaroor batayein!
1. Predictive Analytics:
ML algorithms past aur present data trends ko analyze karke future trends predict karte hain.
Ye businesses ko future planning mein madad karta hai. For example, e-commerce companies
apni sales aur inventory needs ko accurately predict kar sakti hain aur accordingly apne stock
levels maintain kar sakti hain .
2. Data Mining:
ML algorithms large datasets se valuable information extract karne mein expert hain. Ye
extracted information businesses ko better decisions lene mein madad karti hai. For example,
data mining se customer behavior patterns identify kiye ja sakte hain jo targeted marketing
campaigns ke liye useful hain .
3. Customer Segmentation:
ML algorithms customer data ko analyze karke different customer segments identify karte
hain. Ye businesses ko apni marketing strategies ko tailor karne mein help karta hai, jisse
customer engagement aur satisfaction improve hoti hai. For example, retail companies apni
customer base ko different segments mein divide karke personalized offers aur promotions
bhej sakti hain .
4. Sales Forecasting:
ML algorithms sales data ko analyze karke future sales predict karte hain. Ye businesses ko
apni inventory management aur production planning mein madad karta hai. For example, a
manufacturing company apni future product demand ko accurately forecast karke
production schedule optimize kar sakti hai .
5. Fraud Detection:
ML algorithms unusual patterns identify karke fraudulent activities detect karte hain. Ye
businesses ko fraud se bachne mein madad karta hai aur financial losses se protect karta hai.
For example, banks ML algorithms use karke suspicious transactions ko real-time mein detect
aur block kar sakti hain .
Conclusion:
In points se ye saaf hai ke Machine Learning Business Intelligence mein bohot important role
play karta hai. ML ke zariye businesses apne data ko efficiently utilize karte hue insightful
decisions le sakte hain, jo unke business outcomes ko significantly improve karte hain.
In points se hum ye samajh saktay hain ke data visualization ka potential kitna zyada hai. Best
of luck!
Example:
Agar aap soch rahe hain ke zyada parhne se exam marks par kya asar hoga:
IV: Ingredients aur inki quantity (jaise sugar, flour, eggs, etc.)
DV: Cake ka taste aur texture (final product)
Agar aap sugar zyada dalenge, to cake meetha hoga (DV change hogaya).
Agar aap zyada pani denge to paudha tez ug sakta hai ya mar sakta hai.
Question: Agar aap 4 ghante exercise karte hain har hafta aur aapka weight 2 kg kam hota hai,
to IV aur DV kaun se hain?
Example: Study hours, sleep hours (IVs) aur exam marks (DV).
Sochiye ke aap apne dost ke ghar tak driving time predict kar rahe hain:
Sochiye ke aap exam marks predict kar rahe hain lekin multiple factors dekh rahe hain:
1. X-Axis (Horizontal Axis): Yeh axis "Years of Experience" show kar rahi hai. Iska matlab hai
ke har point ka horizontal position uss individual ki experience (in years) ko represent
karta hai.
2. Y-Axis (Vertical Axis): Yeh axis "Salary" show kar rahi hai. Iska matlab hai ke har point ka
vertical position uss individual ki salary ko represent karta hai.
3. Data Points: Har blue dot ek individual data point ko represent karta hai. Yeh point batata
hai ke kisi individual ke pass kitne years ka experience hai aur uski salary kitni hai.
4. Trend: Agar aap dekhain to yeh chart ek clear positive correlation show kar raha hai. Iska
matlab hai ke jaise jaise experience badh raha hai, salary bhi increase ho rahi hai. Yeh
trend linearly upward move kar raha hai, jo suggest karta hai ke zyada experience wale
individuals ko higher salaries mil rahi hain.
Jo point 2 years of experience ke upar hai aur uski salary 45,000 hai, woh batata hai ke
kisi individual ke pass 2 saal ka experience hai aur uski salary 45,000 hai.
Isi tarah, agar ek point 10 years of experience pe hai aur salary 120,000 hai, toh iska
matlab hai ke us individual ke pass 10 saal ka experience hai aur uski salary 120,000 hai.
Summary: Yeh chart clearly dikhata hai ke salary aur years of experience ke beech mein direct
relationship hai. Jaise jaise experience badhta hai, salary bhi proportional increase hoti hai.
how to check Dependent variable aur
independent variable
Dependent variable aur independent variable ko check karne ke liye, aapko yeh samajhna
padega ke kaun sa variable doosre variable par dependent hai.
Agar aap kisi individual ka experience increase karte hain (independent variable), to uski
salary mein bhi increase aata hai (dependent variable).
Experience change hota hai to salary bhi accordingly change hoti hai, lekin salary change
hone se experience par koi direct effect nahi padta.
Summary: