Regressor.Rd
Create a regressor object for Probabilistic Machine Learning
regressor(
x,
y,
model = c("ranger", "extratrees", "ridge", "bcn", "glmnet", "krr", "xgboost", "svm"),
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,
type_split = c("stratify", "sequential"),
seed = 123
)
Input matrix or data frame of features
Vector of target values
Model to use for regression
Method to use for conformal prediction
Confidence level for conformal prediction
Number of simulations for conformal prediction
Number of nodes in the hidden layer
Type of simulations for hidden nodes
Activation function for hidden layer
Engine to use for fitting the model
Additional parameters passed to the model
Type of data splitting for split conformal prediction: "stratify" (for classical supervised learning) "sequential" (when the data sequential ordering matters)
Reproducibility seed for randomization
Additional arguments passed to Regressor$new()
A regressor object of class "regressor"
X <- mtcars[, -1]
y <- mtcars$mpg
X_train <- X[1:25, ]
y_train <- y[1:25]
X_test <- X[26:32, ]
y_test <- y[26:32]
reg <- regressor(X_train, y_train, pi_method = "splitconformal", level = 95)
print(sqrt(mean((y_test - predict(reg, newx = X_test))^2)))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'print': error in evaluating the argument 'x' in selecting a method for function 'mean': non-numeric argument to binary operator