Feature Engineering: A Key Step in Machine Learning
"feature" ka matlab dataset mein woh columns hote hain jo specific information ko represent karte hain. Yani, feature kisi bhi characteristic ya attribute ko define karta hai jo aapke analysis ke liye important hai.
Example ke liye:
Agar aap ek dataset lete hain jo kisi school ke students ke bare mein hai, toh usme kuch features ho sakte hain:
Name: Student ka naam (Feature)
Age: Student ki umar (Feature)
Grade: Student ka grade (Feature)
Gender: Student ka gender (Feature)
Connection with Column Name:
Toh, aap keh sakte hain ki feature aur column name mein connection hai. Har feature ek column ko represent karta hai, aur woh column ka naam hi feature ka naam hota hai. Isliye, jab hum data analysis karte hain, toh hum in features (ya columns) ke through data ko analyze karte hain.
Summary:
Feature = Data ka specific characteristic ya attribute (jaise Age, Name, etc.)
Column Name = Dataset mein feature ko represent karne wala naam.
Isliye, jab aap kisi dataset ki baat karte hain, toh features woh columns hote hain jinmein data store hota hai.
Feature engineering ka matlab hai apne dataset mein naye features banana ya existing features ko badalna taaki model better perform kar sake. Yaha kuch common techniques hain, lekin mai unhe aasan shabdo mein samjhata hoon:
1. One-hot Encoding
Kya hota hai? Jab aapke paas categories hote hain (jaise "Male", "Female"), toh unhe binary numbers (0 ya 1) mein convert karte hain.
Example: "Gender" ke liye, "Male" ko 1 aur "Female" ko 0 assign kar sakte hain. Agar 3 categories hain (jaise "Red", "Blue", "Green"), toh har color ko alag column mein 1 ya 0 se represent karte hain.
2. Label Encoding
Kya hota hai? Categories ko numbers assign karte hain.
Example: "Small", "Medium", "Large" ko 1, 2, aur 3 number de sakte hain. Har category ko ek specific number mil jata hai.
3. Mean Encoding
Kya hota hai? Categories ko unke mean target value ke saath replace karte hain.
Example: Agar "City" feature ka target sales hai, toh har city ko us city ki average sales value se replace kar dete hain.
4. Binning
Kya hota hai? Continuous numbers (jaise age) ko chhoti groups (bins) mein divide karte hain.
Example: Agar kisi ki age 25 hai aur aapke bins 0-20, 21-40, 41-60 hain, toh 25 age wale ko "21-40" group mein daal diya jayega.
5. Log Transformation
Kya hota hai? Skewed (asymmetric) data ko normal (symmetrical) banane ke liye log use karte hain.
Example: Agar kuch numbers bahut chhote ya bahut bade hain (jaise income data), toh un numbers ko compress karne ke liye log use karte hain, taaki zyada evenly spread ho sake.
6. Polynomial Features
Kya hota hai? Existing features ko multiply karke naye features banate hain.
Example: Agar ek feature "X" hai, toh aap "X²" ya "X*Y" (do features ka product) jaisa naya feature bana sakte hain.
7. Interaction Features
Kya hota hai? Do ya zyada features ke interaction ko pakadte hain aur naye features banate hain.
Example: Agar aapke paas "Height" aur "Weight" features hain, toh in dono ko multiply karke ek naya feature "Body Mass Index (BMI)" bana sakte hain.
Summary:
Feature engineering mein hum apne data ke features ko is tarah modify karte hain ya naye features banate hain taaki model kaam ko samajh sake aur better predict kar sake.
Subscribe to my newsletter
Read articles from Sandhya Kondmare directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Sandhya Kondmare
Sandhya Kondmare
Aspiring DevOps Engineer with 2 years of hands-on experience in designing, implementing, and managing AWS infrastructure. Proven expertise in Terraform for infrastructure as code, automation tools, and scripting languages. Adept at collaborating with development and security teams to create scalable and secure architectures. Hands-on in AWS, GCP, Azure and Terraform best practices.