treeClassEvaluate(modelObj, newdata, origRespName, newRespName,
origPredNames, newPredNames, modelName)
| modelObj | an object of class "arbor". |
| newdata | a data frame to use for the evaluations. It must contain columns with names newRespName and newPredNames. |
| origRespName | a character string naming the response variable used in modelObj. |
| newRespName | a character string naming the response variable in newdata. This is often the same as origRespName. |
| origPredNames | a single character string containing the predictor variables used in modelObj. The values must be tab delimited. |
| newPredNames | a single character string naming the predictor variable in newdata. This is often the same as origPredNames. The values must be tab delimited. |
| modelName | a character string containing the name of the model in Spotfire. This is used to construct the names of the components in the return list. |
| evalSummaryTable | a single column data frame containing summary information for the model evaluation. This includes accuracy and kappa. |
| evalConfusionMatrix | a table containing the confusion matrix for the model predictions. |
| evalPlotData | a data frame containing the predictions, residuals and Normal quantiles of the residuals, all computed from newdata. |
| evalPlotDesc |
a icharacter matrix containing a description of the visualizations that can
be created in Spotfire using the data in evalPlotData.
The columns of the matrix are:
MenuName
the text to appear in the Spotfire menu.
PlotType
the type of visualization to create
Xdatatable
the name of the data table for the x-axis variable.
If the data table is generated by this function (i.e. fitPlotData) the
name will have the prefix modelName_.
Xcolumn
the name of the x-axis column in Xdatatable.
Ydatatable
the name of the data table for the y-axis variable.
If the data table is generated by this function (i.e. fitPlotData) the
name will have the prefix modelName_.
Ycolumn
the name of the y-axis column in Ydatatable.
Title
the title for the visualization.
|
library(Sdatasets) # for the kyphosis data
treeClass <- treeClassFit(Kyphosis ~ Age + Number + Start, data=kyphosis,
modelName="treeExample")
respName <- treeClass$fitSummaryTable[1,1]
predNamesString <- treeClass$fitSummaryTable[2, 1]
predNames <- strsplit(predNamesString, "\t", fixed=TRUE)[[1]]
kyph <- kyphosis[1:30, c(respName, predNames)]
treeEval <- treeClassEvaluate(treeClass$modelObj,
newdata=kyph, respName, respName, predNamesString, predNamesString,
modelName="treeExample")