Classifier.Rd
Create a classifier object for Probabilistic Machine Learning
classifier(
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,
seed = 123
)
Input matrix or data frame of features
Vector of target values
Model to use for classification
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
Reproducibility seed for randomization
Additional arguments passed to Classifier$new()
A classifier object of class "classifier"
X <- iris[, -5]
y <- iris$Species
X_train <- X[1:100, ]
y_train <- y[1:100]
X_test <- X[101:150, ]
y_test <- y[101:150]
clf <- classifier(X_train, y_train, pi_method = "kdesplitconformal", level = 95)
#> Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent
predict(clf, newx = X_test)
#> Error: object 'clf' not found
print(mean(y_test == predict(clf, newx = X_test)))
#> 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': object 'clf' not found