predict.graper {graper} | R Documentation

## Predict response on new data

### Description

Function to predict the response on a new data set using a fitted graper model.

### Usage

    ## S3 method for class 'graper'
    predict(object, newX, type = c("inRange", "response",
    "link"), ...)

### Arguments

`object` | fitted graper model as obtained from `graper`
`newX` | Predictor matrix of size n_test (number of new test samples) x p (number of predictors) (same feature structure as used in `graper`)
`type` | type of prediction returned, either: response:returns the linear predictions for linear regression and class probabilities for logistic regression link:returns the linear predictions inRange:returns linear predictions for linear and class memberships for logistic regression
`...` | other arguments

### Value

A vector with predictions.

### Examples

    # create data
    dat <- makeExampleData()
    ntrain <- dat$n/2
    fit <- graper(dat$X[seq_len(ntrain),],
    dat$y[seq_len(ntrain)], dat$annot)
    ypred <- predict(fit, dat$X[seq_len(ntrain) + dat$n/2,])

    dat <- makeExampleData(response="bernoulli")
    ntrain <- dat$n/2
    fit <- graper(dat$X[seq_len(ntrain),],
    dat$y[seq_len(ntrain)], dat$annot, family = "binomial")
    ypred <- predict(fit, dat$X[seq_len(ntrain) + dat$n/2,])

[Package graper version 1.0.0 Index]