Descriptive Statistics (Mean, Median, Mode, Variance)

Descriptive Statistics data को summarize और describe करने का method है। इस blog में हम Mean, Median, Mode और Variance को detail में सीखेंगे।

📊 Descriptive Statistics (Mean, Median, Mode, Variance)

Data Science में Statistics foundation की तरह काम करता है। किसी भी dataset को समझने के लिए सबसे पहले हमें उसका summary चाहिए होता है। यही summary हमें Descriptive Statistics provide करता है। इसमें हम Mean, Median, Mode और Variance जैसे concepts को calculate करते हैं।

❓ Descriptive Statistics क्यों ज़रूरी है?

  • 📍 Dataset का central tendency समझने के लिए
  • 📍 Data कितना spread या variability show करता है यह जानने के लिए
  • 📍 Outliers और skewness detect करने के लिए
  • 📍 Decision making और Machine Learning pre-analysis के लिए

➕ Mean (औसत)

Mean किसी dataset का arithmetic average होता है।

Formula: Mean = (Σx) / n

Example:
Data = [2, 4, 6, 8, 10]
Mean = (2+4+6+8+10)/5 = 6
    
import numpy as np
data = [2, 4, 6, 8, 10]
print("Mean:", np.mean(data))
    

📍 Median (मध्यिका)

Median वह value है जो dataset को equal halves में divide करती है। यह outliers से कम प्रभावित होता है।

Data = [1, 3, 5, 7, 100]
Mean = 23.2 (outlier की वजह से biased)
Median = 5 (better representative)
    
import numpy as np
data = [1, 3, 5, 7, 100]
print("Median:", np.median(data))
    

🎯 Mode (बहुलक)

Mode वह value है जो dataset में सबसे ज्यादा बार आती है।

Data = [2, 4, 4, 6, 6, 6, 8]
Mode = 6
    
from statistics import mode
data = [2, 4, 4, 6, 6, 6, 8]
print("Mode:", mode(data))
    

📈 Variance (प्रसरण)

Variance data की variability बताता है यानी values mean से कितना अलग हैं। Variance जितना ज़्यादा होगा, data उतना spread होगा।

Formula: Variance = Σ(x - mean)² / n
    
import numpy as np
data = [2, 4, 6, 8, 10]
print("Variance:", np.var(data))
    

⚖️ Summary Table

Measure Definition Best Used For
Mean Arithmetic average Normal distribution data
Median Middle value Skewed data with outliers
Mode Most frequent value Categorical or repeating data
Variance Spread of data Data variability measurement

🌍 Real-Life Applications

  • 📊 Education: Students के average marks निकालना
  • 💰 Finance: Stock market returns का variance measure करना
  • 🏥 Healthcare: Patient age distribution analyze करना
  • 🛒 Business: Customers की purchase pattern study करना

📝 Practice Assignments

  1. Python में dataset [10, 20, 30, 40, 100] का Mean, Median, Mode और Variance निकालिए।
  2. Salary dataset पर variance निकालकर बताइए कि data कितना spread है।
  3. Students marks dataset बनाकर Mean और Median compare कीजिए।
  4. किसी categorical dataset (जैसे favorite fruit) का Mode निकालिए।

🏆 निष्कर्ष

Descriptive Statistics किसी भी dataset का पहला step है। Mean, Median और Mode central tendency बताते हैं, जबकि Variance data की variability बताता है। इन measures को समझना Machine Learning और Data Science के लिए बहुत ज़रूरी है।