predict.DMR: predict.DMR

View source: R/predict.DMR.R

predict.DMRR Documentation

predict.DMR

Description

Makes predictions from a DMR object.

Usage

## S3 method for class 'DMR'
predict(
  object,
  newx,
  df = NULL,
  type = "link",
  unknown.factor.levels = "error",
  ...
)

Arguments

object

Fitted DMR object.

newx

Data frame of new values for X at which predictions are to be made. The intercept column should NOT be passed in a call to predict.

df

Number of parameters in the model for which predictions are required. Default is the entire sequence of models for df=1 to df=p.

type

One of: "link", "response", "class". For family="gaussian" for all values of type it gives the fitted values. For family="binomial" and type="link" it returns the linear predictors, for type="response" it returns the fitted probabilities and for type="class" it produces the class labels corresponding to the maximum probability.

unknown.factor.levels

The way of handling factor levels in test data not seen while training a model. One of "error" (the default - throwing an error) or "NA" (returning NA in place of legitimate value for problematic rows).

...

Further arguments passed to or from other methods.

Details

Similar to other predict methods, this function predicts fitted values from a fitted DMR object.

Value

Vector or matrix of predictions.

Examples

data(miete)
ytr <- miete[1:1500,1]
Xtr <- miete[1:1500,-1]
Xte <- miete[1501:2053,-1]
m <- DMR(Xtr, ytr)
ypr <- predict(m, newx = Xte, df = 11)

DMRnet documentation built on Aug. 7, 2023, 5:11 p.m.