CBRBase {CaseBasedReasoning}R Documentation

Root class for common functionality of this package

Description

Root class for common functionality of this package

Root class for common functionality of this package

Public fields

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

Methods

Public methods


Method new()

Initialize object for searching similar cases

Usage
CBRBase$new(formula, data)
Arguments
formula

Object of class formula or character describing the model fit

data

Method fit()

Fit the Model

Usage
CBRBase$fit()
Arguments
x

Training data of class data.frame


Method calc_distance_matrix()

Calculates the distance matrix

Usage
CBRBase$calc_distance_matrix(query = NULL)
Arguments
query

Query data of class data.frame

x

Training data of class data.frame


Method get_similar_cases()

Extracts similar cases

Usage
CBRBase$get_similar_cases(query, k = 1, addDistance = T, merge = F)
Arguments
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


Method clone()

The objects of this class are cloneable with this method.

Usage
CBRBase$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package CaseBasedReasoning version 0.3 Index]