WHAT hai problem? Ek linear SVM ek separating hyperplane w⊤x+b=0 dhundtha hai. Lekin concentric circles jaisa data (inner class vs outer ring) ko koi bhi straight line separate nahi kar sakti.
WHY lifting help karti hai? Agar hum x12+x22 (origin se distance-squared) jaisi ek feature add karein, toh inner points ko ek chotti value milti hai aur outer ring ko ek badi value — ab us nayi axis par ek flat threshold unhe perfectly separate kar deta hai.
HOW bina cost explode kiye?n features par ek degree-d polynomial map mein O(nd) nayi features hoti hain. Unhe explicitly compute karna expensive hai (ya infinite-dimensional!). Kernel trick isse sidestep karti hai: SVM ka math sirf dot products⟨xi,xj⟩ use karta hai, toh agar hum ⟨ϕ(xi),ϕ(xj)⟩ ko ek shortcut function se cheaply compute kar sakein, toh hum ϕ(x) kabhi bhi nahi banaate.
Chalo prove karte hain ki polynomial kernel ek bade space mein ek dot product hai. 2D inputs x=(x1,x2), z=(z1,z2) lo aur function
K(x,z)=(x⊤z)2.
Step 1 — expand karo.Kyun? Hum dekhna chahte hain ki kya yeh ϕ(x)⊤ϕ(z) ke roop mein factor hota hai.
(x1z1+x2z2)2=x12z12+2x1x2z1z2+x22z22.
Step 2 — dot product ke roop mein regroup karo.Kyun? Terms ko group karo taaki har summand (function of x)×(same function of z) ho.
=(x12)(z12)+(2x1x2)(2z1z2)+(x22)(z22).
Step 3 — ϕ padho.Kyun? Yeh ab literally ϕ(x)⊤ϕ(z) hai jahan
ϕ(x)=(x12,2x1x2,x22).
Kab ek function K ek valid kernel hai?Mercer's theorem ke anusaar: tabhi jab K symmetric ho aur Gram matrix [K(xi,xj)] har dataset ke liye positive semidefinite ho. PSD guarantee karta hai ki koi feature map ϕ exist karti hai.
RBF infinite-dimensional kyun hai?e2γx⊤z ko Taylor series ∑kk!(2γx⊤z)k ke roop mein expand karo: isme har degree ke polynomial terms hain. Har degree features add karti hai, isliye ϕ mein infinitely many features hain — explicitly compute karna impossible hai, kernel ke roop mein evaluate karna trivial hai. Isliye kernel trick sirf convenient nahi, balki essential hai.
Socho tum ek circle ke andar red marbles aur bahar blue marbles ko alag karne ki koshish kar rahe ho, sab ek table par flat rakhe hain. Koi seedhi stick unhe split nahi kar sakti. Ab table ke beech ko pahad ki tarah upar uthao — reds oopar uthte hain, blues neeche rehte hain. Ab ek flat card unke beech slide kar sakta hai! Kernel trick ek jaadu ki ruler hai jo batata hai ki marbles uthane ke baad kitne door honge, bina kabhi pahad banaye. Tumhe answer free mein milta hai.