मॉडल की तुलना

Python में Generalized Linear Models

Ita Cirovic Donev

Data Science Consultant

Deviance

  • सूत्र $$ D = -2LL(\beta) $$

  • त्रुटि का माप

  • कम deviance $\rightarrow$ बेहतर मॉडल फिट
  • तुलना का बेंचमार्क null deviance $\rightarrow$ केवल intercept वाला मॉडल
  • मूल्यांकन करें
    • एक रैंडम नॉइज़ वैरिएबल जोड़ने से औसतन deviance 1 घटेगी
    • मॉडल में $p$ predictors जोड़ने पर deviance $p$ से अधिक घटनी चाहिए
Python में Generalized Linear Models

Python में deviance

मॉडल 'y ~ distance100' के summary आउटपुट में log-likelihood और deviance statistic हाइलाइट किए गए हैं.

Python में Generalized Linear Models

Deviance compute करें

  • null-deviance और deviance निकालें
    # Extract null deviance
    print(model.null_deviance)
    
4118.0992
# Extract model deviance
print(model.deviance)
4076.2378
  • log likelihood से deviance compute करें
    print(-2*model.llf)
    
4076.2378
  • deviance में 41.86 की कमी
  • distance100 जोड़ने से फिट बेहतर हुआ
Python में Generalized Linear Models

मॉडल जटिलता

  • model_1 और model_2, जहाँ
    • $L1 > L2$
    • पैरामीटर्स की संख्या model_2 में अधिक है
  • model_2 overfitting कर रहा है
Python में Generalized Linear Models

अभ्यास करते हैं!

Python में Generalized Linear Models

Preparing Video For Download...