The `Regressor` class contains supervised regression models

Details

This class implements models:

lm

Linear model

bcn

see https://www.researchgate.net/publication/380760578_Boosted_Configuration_neural_Networks_for_supervised_classification

extratrees

Extremely Randomized Trees; see https://link.springer.com/article/10.1007/s10994-006-6226-1

glmnet

Elastic Net Regression; see https://glmnet.stanford.edu/

krr

Kernel Ridge Regression; see for example https://www.jstatsoft.org/article/view/v079i03

(but the implementation is different)
ranger

Random Forest; see https://www.jstatsoft.org/article/view/v077i01

ridge

Ridge regression; see https://arxiv.org/pdf/1509.09169

xgboost

a scalable tree boosting system see https://arxiv.org/abs/1603.02754

svm

Support Vector Machines, see https://cran.r-project.org/web/packages/e1071/vignettes/svmdoc.pdf

rvfl

Random Vector Functional Network, see https://www.researchgate.net/publication/332292006_Online_Bayesian_Quasi-Random_functional_link_networks_application_to_the_optimization_of_black_box_functions

Super class

learningmachine::Base -> Regressor

Public fields

name

name of the class

type

type of supervised learning method implemented

model

fitted model

method

supervised learning method in c('lm', 'ranger', 'extratrees', 'ridge', 'bcn', 'glmnet', 'krr', 'xgboost', 'svm')

X_train

training set features; do not modify by hand

y_train

training set response; do not modify by hand

pi_method

type of prediction interval in c("splitconformal", "kdesplitconformal", "bootsplitconformal", "jackknifeplus", "kdejackknifeplus", "bootjackknifeplus", "surrsplitconformal", "surrjackknifeplus")

level

an integer; the level of confidence (default is 95, for 95 per cent) for prediction intervals

B

an integer; the number of simulations when 'level' is not NULL

nb_hidden

number of nodes in the hidden layer, for construction of a quasi- randomized network

nodes_sim

type of 'simulations' for hidden nodes, if nb_hidden > 0; takes values in c("sobol", "halton", "unif")

activ

activation function's name for the hidden layer, in the construction of a quasi-randomized network; takes values in c("relu", "sigmoid", "tanh", " leakyrelu", "elu", "linear")

engine

contains fit and predic lower-level methods for the given method; do not modify by hand

params

additional parameters passed to method when calling fit do not modify by hand

seed

an integer; reproducibility seed for methods that include randomization

Methods

Inherited methods


Method new()

Create a new object.

Usage

Regressor$new(
  name = "Regressor",
  type = "regression",
  model = NULL,
  method = NULL,
  X_train = NULL,
  y_train = NULL,
  pi_method = c("none", "splitconformal", "jackknifeplus", "kdesplitconformal",
    "bootsplitconformal", "kdejackknifeplus", "bootjackknifeplus", "surrsplitconformal",
    "surrjackknifeplus"),
  level = 95,
  B = 100,
  nb_hidden = 0,
  nodes_sim = c("sobol", "halton", "unif"),
  activ = c("relu", "sigmoid", "tanh", "leakyrelu", "elu", "linear"),
  engine = NULL,
  params = NULL,
  seed = 123
)

Returns

A new `Regressor` object.


Method fit()

Fit model to training set

Usage

Regressor$fit(X, y, type_split = c("stratify", "sequential"), ...)

Arguments

X

a matrix of covariates (i.e explanatory variables)

y

a vector, the response (i.e variable to be explained)

type_split

type of data splitting for split conformal prediction: "stratify" (for classical supervised learning) "sequential" (when the data sequential ordering matters)

...

additional parameters to learning algorithm (see vignettes)


Method predict()

Predict model on test set

Usage

Regressor$predict(X, ...)

Arguments

X

a matrix of covariates (i.e explanatory variables)

...

additional parameters


Method fit_predict()

Fit model to training set and predict on test set

Usage

Regressor$fit_predict(
  X,
  y,
  pct_train = 0.8,
  score = ifelse(is.factor(y), yes = function(preds, y_test) mean(preds == y_test), no =
    function(preds, y_test) sqrt(mean((preds - y_test)^2))),
  level = NULL,
  pi_method = c("none", "splitconformal", "jackknifeplus", "kdesplitconformal",
    "bootsplitconformal", "kdejackknifeplus", "bootjackknifeplus", "surrsplitconformal",
    "surrjackknifeplus"),
  B = 100,
  seed = 123,
  graph = FALSE,
  ...
)


Method update()

update model in an online fashion (for now, only implemented for 'rvfl' models")

Usage

Regressor$update(newx, newy, ...)

Arguments

newx

a vector of new covariates (i.e explanatory variables)

newy

a numeric, the new response's observation (i.e variable to be explained)

...

additional parameters to be passed to the underlying model's method `update`


Method clone()

The objects of this class are cloneable with this method.

Usage

Regressor$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.