CBRBase {CaseBasedReasoning} | R Documentation |
Root class for common functionality of this package
Root class for common functionality of this package
model
the statistical model
data
training data
model_fit
trained object
formula
Object of class formula or character describing the model fit
terms
terms of the formula
endPoint
Target variable
distMat
A matrix with distances
orderMat
A matrix with the order indices for similar cases search
new()
Initialize object for searching similar cases
CBRBase$new(formula, data)
formula
Object of class formula or character describing the model fit
data
fit()
Fit the Model
CBRBase$fit()
x
Training data of class data.frame
calc_distance_matrix()
Calculates the distance matrix
CBRBase$calc_distance_matrix(query = NULL)
query
Query data of class data.frame
x
Training data of class data.frame
get_similar_cases()
Extracts similar cases
CBRBase$get_similar_cases(query, k = 1, addDistance = T, merge = F)
query
Query data of class data.frame
k
number of similar cases
addDistance
Add distance to result data.frame
merge
Add query data to matched cases data.frame
clone()
The objects of this class are cloneable with this method.
CBRBase$clone(deep = FALSE)
deep
Whether to make a deep clone.