predict.htt | R Documentation |
Compute predictions from htt
object.
## S3 method for class 'htt'
predict(object, newdata,
type = c("response", "prob", "node"),
...)
object |
fitted model object of class |
newdata |
an optional data frame in which to look for variables with which to predict, if omitted, the fitted values are used. |
type |
a character string denoting the type of predicted value returned.
For |
... |
additional print arguments. |
This function is a method for the generic function predict
for class htt
. It can be invoked by calling predict
for an
object
of the appropriate class, or directly by calling predict.htt
regardless of the class of the object.
A list of predictions, possibly simplified to a numeric vector, numeric matrix or factor.
If type = "response"
:
the mean of a numeric response and
the predicted class for a categorical response is returned.
If type = "prob"
:
the matrix of class probabilities
is returned for a categorical response.
If type = "node"
:
an integer vector of terminal node identifiers is returned.
predict
, htt.object
irishtt <- HTT(Species ~., data = iris)
## the predicted class
predict(irishtt, type = "response")
## class probabilities
predict(irishtt, type = "prob")
## terminal node identifiers
predict(irishtt, type = "node")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.