aic: AIC function

Description Usage Arguments Details Value Author(s) Examples

Description

AIC stands for Akaike’s Information Criterion. It estimates the quality of a model, relative to each of other models. The lower AIC score is, the better the model is. Therefore, a model with lowest AIC - in comparison to others, is chosen.

Usage

1
aic(y, y_pred, p)

Arguments

y

True target variable(s) - array-like of shape = (n_samples) or (n_samples, n_outputs)

y_pred

Fitted target variable(s) obtained from your regression model - array-like of shape = (n_samples) or (n_samples, n_outputs)

p

Number of predictive variable(s) used in the model - int

Details

AIC = n*log(residual sum of squares/n) + 2K where: - n: number of observations - K: number of parameters (including intercept)

Value

double

Author(s)

Ha Dinh

Examples

1
2
3
4
5
library(regscoreR)
y <-c(1,2,3,4)
y_pred <- c(5,6,7,8)
p <- 3
regscoreR::aic(y, y_pred, p)

UBC-MDS/regscoreR documentation built on May 25, 2019, 1:36 p.m.