# pseudocode for cross-validation
all_folds = split_into_k_parts(all_training_data)
for set_p in hyperparameter_sets:
model = InstanceFromModelFamily()
for fold_k in all_folds:
training_folds = all_folds besides fold_k
fit model on training_folds using set_p
fold_k_performance = evaluate model on fold_k
set_p_performance = average all k fold_k_performances for set_p
select set from hyperparameter_sets with best set_p_performance
# eudocode for selecting model family
training_data, test_data = randomly_split(all_data)
list_of_families = logistic regression,
decision tree,
SVM,
neural network, etc...
for model_family in list_of_families:
best_model = tuned with cross-validation on training_data
evaluate best_model from each model_family on test_data
select final model
# pseudocode for building a simple ensemble modal
training_data, test_data = randomly_split(all_data)
list_of_families = logistic regression,
decision tree,
SVM,
neural network, etc...
for model_family in list_of_families:
best_model = tuned with cross-validation on training_data
average predictions by best_model from each model_family
... profit! (often)
欢迎光临 智客公社 (http://bbs.cnaiplus.com/) | Powered by Discuz! X3.4 |