Backtick Knowledge Base
  • Backtick Knowledge Base
  • šŸ“ŠStatistics
    • Kernel Density Estimation
    • Tests
  • šŸ‚Machine Learning
    • Fit and predict
    • Encoding
    • Feature Scaling
    • Pipeline
    • Model Evaluation & Selection
      • The Bias-Variance Decomposition
      • Kullback–Leibler Divergence
      • AIC & BIC
      • Cross-Validation
    • Feature Selection
    • Dimensionality Reduction
    • Clustering
    • Pandas
  • 🧠Deep Learning
  • šŸPython
    • Beautiful Data
    • S3
      • List bucket items
      • Delete bucket items
      • Get objects
      • Upload objects
      • Get files
      • Upload files
      • Read .csv-file to dataframe
      • Write dataframe to .csv-file
  • ā˜ļøCloud
    • GCP
    • AWS
      • Users & Policies
        • Basic setup
        • MFA
      • EKS
        • Setup
        • Kube Config
        • Dashboard
      • S3
        • Copying buckets
  • ā– Distributed Computing
    • Map-Reduce
    • Spark
    • Dask
  • āŽˆ Kubernetes
Powered by GitBook
On this page
  • Akaike Information Criterion
  • Bayesian Information Criterion

Was this helpful?

  1. Machine Learning
  2. Model Evaluation & Selection

AIC & BIC

AIC and BIC provide an analytical way, i.e. without using an extra dataset, to estimate how well a model generalizes.

Akaike Information Criterion, AIC, and Bayesian Information Criterion, BIC, are two criteria that represent the tradeoff between the training error and model complexity. The model complexity, in this case, is the effective number of parameters used, i.e. the amount of non-zero parameters fitted by the model.

AIC and BIC differ in their theoretical background but look similar and can be used similarly with two main differences: AIC tends to find the best generalizing model and BIC tends to find the "true" model. This is because BIC punished more complex models slightly harder than AIC.

Akaike Information Criterion

Recall the Kullback-Leibler Divergence discussed in the last page:

KL(P∣∣Q)=Ep[Ā logĀ P(x)]āˆ’Ep[Ā logĀ Q(x)]KL(P||Q)=E_p[\text{ log } P(x)]-E_p[\text{ log }Q(x)]KL(P∣∣Q)=Ep​[Ā logĀ P(x)]āˆ’Ep​[Ā logĀ Q(x)]

Where P is a reference distribution and Q an approximation distribution of P. To further illustrate the point of AIC lets make Q dependent on a set of parameters θ,\theta,θ, i.e. Q(X∣θ)Q(X|\theta)Q(X∣θ). Also, in machine learning the P-distribution is fixed and we often search for the best set of parameters θ\theta θ or even functions Q. As such the best approximation, for a function Q, can be written as:

argminĪø=āˆ’Ep[Ā logĀ Q(X∣θ)]argmin_\theta =-E_p[\text{ log }Q(X|\theta)]argminθ​=āˆ’Ep​[Ā logĀ Q(X∣θ)]

While simpler, it is still not useable as it depends on the expected function w.r.t distribution p. Akaike showed that it can be asymptotically estimated as:

Ep[āˆ’2logQ(X∣θ)]ā‰ˆ2pāˆ’2Ā logĀ Q(X∣θ)E_p[-2logQ(X|\theta)]\approx2p-2\text{ log }Q(X|\theta)Ep​[āˆ’2logQ(X∣θ)]ā‰ˆ2pāˆ’2Ā logĀ Q(X∣θ)

where p is the number of the effective number of parameters. Which motivates the AIC information criteria:

AIC=2pāˆ’2Ā logĀ L(Īø,X)AIC = 2p-2\text{ log }L(\theta,X)AIC=2pāˆ’2Ā logĀ L(Īø,X)

where L is the likelihood function for the data given the parameters theta.

For smaller datasets AIC corrected, AICC, might be a better choice, due to AIC's asymptotical unbiasedness:

AICC=2p2+2pnāˆ’pāˆ’1+AICAICC = \frac{2p^2+2p}{n-p-1} + AICAICC=nāˆ’pāˆ’12p2+2p​+AIC

where n is the sample size.

Bayesian Information Criterion

BIC is motivated as the maximization of the log-likelihood as:

BIC=dĀ logĀ pāˆ’2Ā logĀ L(Īø,X)BIC=d \text{ log } p-2\text{ log }L(\theta,X)BIC=dĀ logĀ pāˆ’2Ā logĀ L(Īø,X)

where d is the dimensionality of the feature space. As such BIC punishes larger models harder than AIC.

Note that both criteria are asymptotically unbiased meaning that they might not be applicable to small datasets. If your dataset is small or intermediate consider using AICC.

Further note that values of AIC and BIC can not be compared other than to the exact same dataset, a value on its own has no meaning. On can thus not proclaim an amazing AIC -score for any problem!

PreviousKullback–Leibler DivergenceNextCross-Validation

Last updated 4 years ago

Was this helpful?

šŸ‚