6.4.12 · Biology › Bioinformatics & Computational Biology
Intuition Badi picture (KYU)
Biology ab bahut zyada data produce karti hai — billions letters wale genomes, har cell mein hazaron gene-expression values, millions protein structures. Koi bhi insaan itna saara data aankhon se dekh nahi sakta. Machine learning (ML) ek aisa toolset hai jo ek computer ko data se patterns seekhne deta hai taaki woh aisa data pe predictions kar sake jo usne pehle kabhi nahi dekha.
Core promise yeh hai: ek scientist ke haath se rules likhne ki jagah ("agar yeh motif aaye, toh yeh ek gene hai"), machine examples se khud rules seekhti hai .
Definition Machine Learning
ML methods ka ek set hai jahan ek program ek task pe apni performance data se seekh ke improve karta hai , na ki fixed rules se explicitly program karke. Formally: data diya ho, toh ek ML model ek function f estimate karta hai jo inputs (X , jise features kehte hain) ko outputs (y , jise labels/targets kehte hain) se map karta hai.
KYU yeh biology mein matter karta hai: biological rules aksar unknown hote hain ya haath se likhne ke liye bahut complex hote hain (e.g. "kaun se DNA sequences promoters hain?"). ML unhe statistically discover karta hai.
Definition Supervised vs Unsupervised vs Reinforcement
Supervised learning : hamare paas labeled examples ( X , y ) hote hain. Model X → y seekhta hai. E.g. ek tumor ko benign/malignant classify karna.
Unsupervised learning : sirf X hota hai, koi labels nahi. Model structure (clusters, groups) dhundta hai. E.g. expression data se cells ko types mein group karna.
Reinforcement learning : ek agent trial-and-error se rewards ke saath seekhta hai. E.g. iterative feedback se ek protein design karna.
Intuition Biology ko numbers mein convert karna (KAISE)
Ek model sirf numbers khata hai. Toh hume biology ko ek feature vector ke roop mein encode karna padta hai.
Ek DNA base → one-hot: A = [ 1 , 0 , 0 , 0 ] , C = [ 0 , 1 , 0 , 0 ] , etc.
Ek cell → gene expression levels ka vector [ g 1 , g 2 , … , g n ] .
Ek patient → [age, blood-pressure, mutation-present?].
Label y woh hai jo hum predict karte hain: disease/no-disease, gene/not-gene, ek numeric drug response.
Classification = label ek category hai. Regression = label ek continuous number hai.
Hum sabse simple supervised model — linear regression — derive karte hain, kyunki baaki sab cheez is idea ka generalization hai.
KYU hume ek loss chahiye: "learning" ka matlab hai w , b choose karna taaki predictions y ^ true y ke close hon. Hume ek aisa number chahiye jo "ghalat hona" measure kare.
Intuition Gradient descent (jab koi closed form nahi hota)
Zyaatar real models (neural nets) algebra se solve nahi ho sakte. Isliye hum L par neechey ki taraf chalte hain :
w ← w − η ∂ w ∂ L
η learning rate hai (step size). Tab tak repeat karo jab tak L shrink karna band na ho jaaye. KYU yeh kaam karta hai: negative gradient lower loss ki taraf point karta hai.
Definition Train / validation / test split
Hum data split karte hain: train (model fit karo), validation (settings tune karo), test (unseen data par final honest score). Ek model tabhi useful hai jab woh aisa data par kaam kare jo usne training ke dauran kabhi nahi dekha .
Definition Overfitting vs Underfitting
Overfitting : model training data ka noise memorize karta hai → train par great, test par kharab.
Underfitting : model bahut simple hai → dono par kharab.
Sweet spot inn dono ke beech hai (bias–variance trade-off ).
Worked example Example 1 — Haath se ek line fit karna
Data (gene dose x , response y ): ( 1 , 2 ) , ( 2 , 2 ) , ( 3 , 4 ) .
Step 1: means x ˉ = 2 , y ˉ = 3 8 ≈ 2.67 . KYU? Formulas data ko mean par center karte hain.
Step 2: numerator ∑ ( x i − x ˉ ) ( y i − y ˉ ) = ( − 1 ) ( − 0.67 ) + ( 0 ) ( − 0.67 ) + ( 1 ) ( 1.33 ) = 0.67 + 0 + 1.33 = 2 . KYU? Yeh covariance × n hai.
Step 3: denominator ∑ ( x i − x ˉ ) 2 = 1 + 0 + 1 = 2 . KYU? Variance × n.
Step 4: w = 2/2 = 1 , phir b = 2.67 − ( 1 ) ( 2 ) = 0.67 . Toh y ^ = x + 0.67 . KYU? b = y ˉ − w x ˉ mein plug in kiya.
Worked example Example 2 — Supervised vs unsupervised choose karna
Task: "5000 single cells ko bina unke types jaane similarity ke basis par group karo."
KYU unsupervised? Koi labels nahi hain — hume har cell ka type nahi pata, toh hum sirf X par cluster karte hain. Agar hume known types pata hote aur unhe predict karna hota, toh woh supervised classification hota.
Worked example Example 3 — Ek classifier ke liye DNA base encode karna
Predict karo ki koi sequence ek splice site hai ya nahi. Sequence letter A .
Step: one-hot encode karo A → [ 1 , 0 , 0 , 0 ] . KYU A = 1 , C = 2 , G = 3 , T = 4 nahi? Kyunki numbers order/magnitude imply karte hain (T > A ) jo biologically meaningless hai — model fake structure invent kar leta. One-hot se yeh avoid hota hai.
Common mistake "High training accuracy = good model."
KYU yeh sahi lagta hai: model ne clearly data seekh liya — 99% correct! KYU yeh galat hai: ho sakta hai usne noise memorize ki ho (overfitting) aur woh naye patients par fail ho jaaye. Fix: hamesha ek held-out test set par performance report karo jो model ne kabhi nahi dekha.
Common mistake "Zyada features hamesha better hote hain."
KYU yeh sahi lagta hai: zyada information se madad milni chahiye. KYU yeh galat hai: bahut zyada features aur kam samples ke saath (curse of dimensionality , genomics mein common jahan 20,000 genes hote hain lekin sirf 50 patients) model overfit karta hai. Fix: feature selection / regularization.
Common mistake "Model ne jo correlation nikali woh = biological causation."
KYU yeh sahi lagta hai: model gene X se disease predict karta hai, toh X ka cause hona chahiye. KYU yeh galat hai: ML statistical association dhundta hai, mechanism nahi. Fix: ML output ko hypothesis maan lo jise experimental validation chahiye.
Common mistake "Categories ko 1,2,3 encode karo."
KYU yeh sahi lagta hai: yeh simple hai. KYU yeh galat hai: fake ordering invent hoti hai (dekho Example 3). Fix: one-hot encoding.
Machine learning ek line mein kya hai? Aisi methods jo ek program ko hand-coded rules ki jagah data se patterns seekh kar task mein improve karne deti hain.
Supervised learning mein kaisa data hota hai? Labeled examples ( X , y ) ; yeh inputs ko known outputs se map karna seekhta hai.
Unsupervised learning mein kya hota hai? Sirf inputs X (koi labels nahi); yeh clusters jaisi structure dhundta hai.
Classification aur regression mein kya fark hai? Classification ek category predict karta hai; regression ek continuous number predict karta hai.
"Features" kya hote hain? Numerical inputs X jo model ke liye biological data encode karte hain.
Hum loss ke roop mein Mean Squared Error kyun use karte hain? Yeh hamesha positive hota hai, bade errors ko penalize karta hai, aur smooth/differentiable hai toh hum ise minimize kar sakte hain.
Linear regression ke liye closed-form slope kya hai? w = ∑ ( x i − x ˉ ) 2 ∑ ( x i − x ˉ ) ( y i − y ˉ ) (covariance/variance).
Gradient descent kya karta hai? Parameters ko loss ke gradient ke ulti direction mein iteratively update karta hai taaki minimum ki taraf neechey ja sake.
Overfitting kya hai? Model training noise memorize karta hai → high train accuracy lekin unseen data par kharab performance.
Data ko train/validation/test mein kyun split karte hain? Model ne jis data par train nahi kiya usPar honest generalization measure karne ke liye.
DNA bases ko one-hot encode kyun karte hain A=1,C=2,G=3,T=4 ki jagah? Integer coding bases ke beech ek false ordering/magnitude invent karta hai jo biology mein nahi hoti.
Genomics mein curse of dimensionality? Bahut saare features (genes) lekin kam samples (patients) hone se overfitting aasaan ho jaati hai.
Recall Feynman: ek 12-saal ke bachche ko explain karo
Socho tum apne dost ko saikdon photos dikhate ho aur kehte ho "yeh cat hai, yeh dog hai." Baad mein woh khud naye photos guess kar sakta hai — usne examples se seekha , tumne use koi rulebook nahi di. Machine learning ek computer ko usi tarah sikhana hai, lekin biology ke saath: usse woh DNA dikhao jo disease cause karta hai aur woh jo nahi karta, aur woh dangerous wale pehchanna seekh jaata hai. Trick yeh hai: use naye wale bhi sahi guess karne chahiye, na sirf jo tumne dikhaye the yaad rakhne — jaise ek student jo samajhta hai answer key memorize karne ki jagah.
"FLOG the model" — F eatures in, L oss ghalat hona measure karta hai, O ptimize (gradient descent), G eneralize (unseen data par test). Agar tumhara model generalize nahi kar sakta, tum galat tarike se FLOG kiya.
Supervised Learning Algorithms — jahan classification/regression models detail mein hain.
Unsupervised Learning & Clustering — cells aur genes ko group karna.
Neural Networks & Deep Learning in Biology — is note ke linear model ka nonlinear extension.
Gene Expression Analysis — ML features ka ek major source.
Protein Structure Prediction (AlphaFold) — ek landmark ML application.
Sequence Alignment — classical (non-ML) pattern matching, contrast ke liye.
Statistics: Covariance and Variance — regression slope ke peeche ka math.
hand rules ke liye bahut complex
function estimate karta hai
one-hot / expression vectors
ghalat hona measure karta hai
Biology numbers ke roop mein encode ki gayi
Linear regression y = wx + b