Skip to contents

y_hat = theta_0 + sum_j theta_j x_j.

Usage

morie_geron_ch4_linear_regression_prediction(theta, x)

Arguments

theta

Length n+1 parameters, theta[1] the bias.

x

Instance vector or (m, n) batch.

Value

List with prediction, contributions (single instance only), bias.

Examples

morie_geron_ch4_linear_regression_prediction(c(1, 2, -0.5), matrix(c(1,
    4, 2, 0), 2, byrow = TRUE))
#> $prediction
#> [1] 1 5
#> 
#> $contributions
#> NULL
#> 
#> $bias
#> [1] 1
#> 
#> $estimate
#> [1] 1 5
#> 
#> $n
#> [1] 2
#>