cla_tune: Classification Tune

View source: R/cla_tune.R

cla_tuneR Documentation

Classification Tune

Description

Classification Tune

Usage

cla_tune(base_model, folds = 10, metric = "accuracy")

Arguments

base_model

base model for tuning

folds

number of folds for cross-validation

metric

metric used to optimize

Value

a cla_tune object.

Examples

# preparing dataset for random sampling
sr <- sample_random()
sr <- train_test(sr, iris)
train <- sr$train
test <- sr$test

# hyper parameter setup
tune <- cla_tune(cla_mlp("Species", levels(iris$Species)))
ranges <- list(size=c(3:5), decay=c(0.1))

# hyper parameter optimization
model <- fit(tune, train, ranges)

# testing optimization
test_prediction <- predict(model, test)
test_predictand <- adjust_class_label(test[,"Species"])
test_eval <- evaluate(model, test_predictand, test_prediction)
test_eval$metrics

daltoolbox documentation built on May 29, 2024, 1:57 a.m.