Description Usage Arguments Value See Also Examples
The main purpose of this function is internal use within cv_sgdnet()
,
where it is used to score the performance over folds in cross-validation.
It can, however, be used on its own to measure performance against a
validation set, for instance by training the model via cv_sgdnet()
and holding out a validation set for
use with this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | score(fit, ...)
## S3 method for class 'sgdnet_gaussian'
score(fit, x, y, type.measure = c("deviance",
"mse", "mae"), s = fit$lambda, ...)
## S3 method for class 'sgdnet_binomial'
score(fit, x, y, type.measure = c("deviance",
"mse", "mae", "class", "auc"), s = fit$lambda, ...)
## S3 method for class 'sgdnet_multinomial'
score(fit, x, y,
type.measure = c("deviance", "mse", "mae", "class"), s = fit$lambda,
...)
## S3 method for class 'sgdnet_mgaussian'
score(fit, x, y, type.measure = c("deviance",
"mse", "mae"), s = fit$lambda, ...)
## S3 method for class 'cv_sgdnet'
score(fit, x, y, type.measure, s = c("lambda_1se",
"lambda_min"), ...)
|
fit |
the model fit |
... |
arguments passed on to |
x |
a feature matrix of new data |
y |
response(s) for new data |
type.measure |
the type of measure |
s |
lambda |
Returns the prediction error along the lambda path.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.