6.4.12Bioinformatics & Computational Biology

Introduce machine learning in biology

1,992 words9 min readdifficulty · medium

What is Machine Learning?

WHY this matters in biology: biological rules are often unknown or too complex to write by hand (e.g. "which DNA sequences are promoters?"). ML discovers them statistically.

The three learning paradigms


Features and Labels (the vocabulary)

Classification = label is a category. Regression = label is a continuous number.


How does a model "learn"? (Derivation from scratch)

We derive the simplest supervised model — linear regression — because everything else is a generalization of this idea.

WHY we need a loss: "learning" means choosing w,bw,b so predictions y^\hat y are close to true yy. We need a number that measures "wrongness".

Figure — Introduce machine learning in biology

The crucial idea: Generalization, not memorization


Worked Examples


Common Mistakes (Steel-man + fix)


Flashcards

What is machine learning in one line?
Methods that let a program improve at a task by learning patterns from data instead of using hand-coded rules.
Supervised learning uses what kind of data?
Labeled examples (X,y)(X,y); it learns to map inputs to known outputs.
Unsupervised learning uses what?
Only inputs XX (no labels); it finds structure like clusters.
Difference between classification and regression?
Classification predicts a category; regression predicts a continuous number.
What are "features"?
The numerical inputs XX that encode biological data for the model.
Why do we use Mean Squared Error as a loss?
It's always positive, penalizes large errors, and is smooth/differentiable so we can minimize it.
Closed-form slope for linear regression?
w=(xixˉ)(yiyˉ)(xixˉ)2w=\dfrac{\sum(x_i-\bar x)(y_i-\bar y)}{\sum(x_i-\bar x)^2} (covariance/variance).
What does gradient descent do?
Iteratively updates parameters opposite to the gradient of the loss to walk downhill toward a minimum.
What is overfitting?
Model memorizes training noise → high train accuracy but poor performance on unseen data.
Why split data into train/validation/test?
To measure honest generalization on data the model never trained on.
Why one-hot encode DNA bases instead of A=1,C=2,G=3,T=4?
Integer coding invents a false ordering/magnitude between bases that biology doesn't have.
Curse of dimensionality in genomics?
Many features (genes) but few samples (patients) makes overfitting easy.

Recall Feynman: explain to a 12-year-old

Imagine you show a friend hundreds of photos and say "this is a cat, this is a dog." Later they can guess new photos on their own — they learned from examples, you never gave them a rulebook. Machine learning is teaching a computer the same way, but with biology: show it DNA that causes disease and DNA that doesn't, and it learns to spot the dangerous ones. The trick is: it must guess new ones right, not just remember the ones you showed it — like a student who understands instead of memorizing the answer key.

Connections

  • Supervised Learning Algorithms — where classification/regression models are detailed.
  • Unsupervised Learning & Clustering — grouping cells and genes.
  • Neural Networks & Deep Learning in Biology — nonlinear extension of this note's linear model.
  • Gene Expression Analysis — a major source of ML features.
  • Protein Structure Prediction (AlphaFold) — landmark ML application.
  • Sequence Alignment — classical (non-ML) pattern matching for contrast.
  • Statistics: Covariance and Variance — the math behind the regression slope.

Concept Map

too complex for hand rules

estimates function

inputs

outputs

one-hot / expression vectors

paradigm

paradigm

paradigm

category label

continuous label

simplest model

measures wrongness

minimize to learn

Biological big data

Machine Learning

f maps X to y

Features X

Labels y

Biology encoded as numbers

Supervised: labeled X,y

Unsupervised: only X

Reinforcement: rewards

Classification

Regression

Linear regression y = wx + b

MSE loss L w,b

Weights w, bias b

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, biology aaj kal itna zyada data bana rahi hai — poora genome billions of letters ka, har cell mein hazaaron gene expression values — ki koi insaan haath se ye sab analyse nahi kar sakta. Yahin machine learning kaam aata hai: hum computer ko rule likh ke nahi dete, balki examples dikhate hain aur wo khud pattern seekh leta hai. Jaise ek bacche ko cat aur dog ki photos dikhao, wo baad mein nayi photo bhi pehchaan leta hai — same idea.

Do main types samajh lo: supervised (jab hamare paas labels hain, jaise "ye tumor cancer hai / nahi hai"), aur unsupervised (jab labels nahi hain, hum bas similar cells ko group/cluster karte hain). Model ko "seekhna" ka matlab hai — usko numbers mein input (features) do, wo ek function ff dhoondhta hai jo input ko output se jodta hai. Sabse simple model linear regression hai: y^=wx+b\hat y = wx + b, aur w,bw,b ko hum loss (galti) minimize karke nikaalte hain, aksar gradient descent se dheere-dheere neeche utar ke.

Sabse zaroori baat — generalization. Model ka train data pe 99% accuracy hona bekaar hai agar wo naye patient pe fail ho jaaye. Isliye hamesha data ko train/test mein todo aur test set pe honest score dekho. Overfitting matlab ratta maar liya (noise bhi yaad kar liya), underfitting matlab kuch seekha hi nahi. Aur yaad rakhna: ML jo correlation dhoondhe wo causation nahi hai — usko hypothesis maano, phir lab mein verify karo. Bas yahi core intuition FLOG mnemonic mein hai: Features → Loss → Optimize → Generalize.

Test yourself — Bioinformatics & Computational Biology

Connections