S4 class structure of the xnet package"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(xnet)

slotsToRmd <- function(class){
  slots <- getSlots(class)

  txt <- paste0(" * `",names(slots), "` : object of type **", slots, "**")
  cat(txt, sep = "\n")
}

This document describes the S4 class structure used in the xnet package. It's mainly a reference for package developers. Users are advised to use the appropriate functions for extracting the information they need.

Virtual classes

The xnet package has three virtual classes that each define a number of slots necessary for that specific type of model:

  1. the class tskrr for general two step kernel ridge regressions
  2. the class tskrrTune for tuned two step kernel ridge regressions
  3. the class tskrrImpute for two step kernel ridge regressions with imputed data.

Each of these classes defines the necessary slots for that specific type of action. The actual classes returned by the functions tskrr(), tune() and impute() inherit from (a combination of) these virtual classes.

Actual classes

Inheritance from tskrr

After using the function tskrr(), one of the following classes is returned:

These classes have similar slots, but the homogeneous models don't need information on the column kernel matrix. The slots are listed below. In general the following design principles hold:

Slots defined by tskrrHomogeneous

slotsToRmd("tskrrHomogeneous")

Slots defined by tskrrHeterogeneous

slotsToRmd("tskrrHeterogeneous")

Both classes inherit directly from the class tskrr. But these classes also function as parent classes from which tune() related and impute() related classes inherit.

Inheritance from tskrrTune

When using the function tune(), you get one of the following classes:

Apart from the slots of the respective tskrr class, the inheritance from tskrrTune adds the following slots:

slotsToRmd("tskrrTune")

These slots use the following design principles:

Inheritance from tskrrImpute

When using the function impute(), you get one of the following classes:

Apart from the slots of the respective tskrr class, the inheritance from tskrrImpute adds the following slots:

slotsToRmd("tskrrImpute")

The slot imputeid treats the Y matrix as a vector and stores the position of the imputed values as a integer vector. The other two slots just store the settings used during imputation.



Try the xnet package in your browser

Any scripts or data that you put into this service are public.

xnet documentation built on Feb. 4, 2020, 9:10 a.m.