knitr::opts_chunk$set(echo = TRUE) library(forester)
data(adult) adult_sm <- adult[1:1000, ]
adult_prep <- custom_preprocessing(data = adult_sm, y = 'salary', na_indicators = c(''), removal_parameters = list( active_modules = c(duplicate_cols = TRUE, id_like_cols = TRUE, static_cols = TRUE, sparse_cols = TRUE, corrupt_rows = TRUE, correlated_cols = TRUE), id_names = c('id', 'nr', 'number', 'idx', 'identification', 'index'), static_threshold = 0.99, sparse_columns_threshold = 0.3, sparse_rows_threshold = 0.3, high_correlation_threshold = 0.7 ), imputation_parameters = list( imputation_method = 'median-other', k = 10, m = 5 ), feature_selection_parameters = list( feature_selection_method = 'none', max_features = 'default', nperm = 1, cutoffPermutations = 20, threadsNumber = NULL, method = 'estevez' ), verbose = FALSE)
train_out <- train(data = adult_sm, y = 'salary', time = NULL, status = NULL, type = "auto", engine = c("ranger", "xgboost", "decision_tree", "lightgbm", "catboost"), verbose = TRUE, train_test_split = c(0.6, 0.2, 0.2), split_seed = NULL, bayes_iter = 0, random_evals = 2, metrics = "auto", sort_by = "auto", metric_function = NULL, metric_function_name = NULL, metric_function_decreasing = TRUE, best_model_number = 5, custom_preprocessing = NULL )
train_out_1 <- train(data = adult_prep$data, y = 'salary', time = NULL, status = NULL, type = "auto", engine = c("ranger", "xgboost", "decision_tree", "lightgbm", "catboost"), verbose = TRUE, train_test_split = c(0.6, 0.2, 0.2), split_seed = NULL, bayes_iter = 0, random_evals = 2, metrics = "auto", sort_by = "auto", metric_function = NULL, metric_function_name = NULL, metric_function_decreasing = TRUE, best_model_number = 5, custom_preprocessing = adult_prep )
train_out_2 <- train(data = adult_prep$data, y = 'salary', time = NULL, status = NULL, type = "auto", engine = c("ranger", "xgboost", "decision_tree", "lightgbm", "catboost"), verbose = TRUE, train_test_split = c(0.6, 0.2, 0.2), split_seed = NULL, bayes_iter = 4, random_evals = 0, metrics = "auto", sort_by = "auto", metric_function = NULL, metric_function_name = NULL, metric_function_decreasing = TRUE, best_model_number = 5, custom_preprocessing = adult_prep )
report(train_output = train_out_1, output_file = 'binary_classification_test_1', output_dir = getwd(), check_data = TRUE)
report(train_output = train_out_2, output_file = 'binary_classification_test_2', output_dir = getwd(), check_data = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.