mallow: Mallow's Cp function

Description Usage Arguments Details Value Author(s) Examples

Description

Mallow's C_p is named for Colin Lingwood Mallows. It is used to assess the fit of regression model, finding the best model involving a subset of predictive variables available for predicting some outcome.

Usage

1
mallow(y, y_pred, y_sub, k, p)

Arguments

y

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

y_pred

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

y_sub

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

k

(int,like 2L)Number of predictive variable(s) used in the model

p

(int,like 2L)Number of predictive variable(s) used in the subset model

Details

C_p = (SSE_k/MSE) - (n - 2k)

Value

mallow_score: float

Author(s)

Ruoqi XU

Examples

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

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