Description Usage Arguments Value Examples
Creates a valid autograde file when supplied with predictions
1 | gen_ag_csv(yhat, prob, prob.dir = getwd())
|
yhat |
A |
prob |
A |
prob.dir |
A |
A .csv
named by the problem name alongside the date and time
the predictions were made where the observations are aligned on each new
line written to the working directory given by getwd()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Set seed for reproducibility
set.seed(1337)
# Simulate values
n = 100
beta = 2.5
x = beta*rnorm(n, 0, 1)
y = x + rnorm(n, 1, 2)
# Create a regression model
mod = lm(y~x)
## Predict under model
yhat = predict(mod)
gen_ag_csv(yhat, "test-proj")
## Predict under new data
new = data.frame(x = seq(-3, 3, 0.5))
yhat2 = predict(mod, new)
gen_ag_csv(yhat2, "test-proj")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.