Skip to content

Commit

Permalink
add case label in filename
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar committed Nov 7, 2024
1 parent 2b2721e commit 51d1960
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/Emulator/G-function/emulate-test-n-features.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ function main()


cases = ["Prior", "GP", "RF-scalar"]
case = cases[3]
case = cases[2]
decorrelate = true
nugget = Float64(1e-12)

n_features_vec = [25, 50, 100, 200, 400, 800] # < data points ideally as output dim = 1
ttt = zeros(length(n_features_vec),n_repeats)
train_err = zeros(length(n_features_vec),n_repeats)
test_err = zeros(length(n_features_vec),n_repeats)
n_cross_val_sets = 2


for (f_idx, n_features_opt) in enumerate(n_features_vec)
Expand All @@ -117,7 +118,7 @@ function main()
# "localization" => SEC(0.1),#,Doesnt help much tbh
# "accelerator" => NesterovAccelerator(),
"n_ensemble" => 100,
"n_cross_val_sets" => 2,
"n_cross_val_sets" => n_cross_val_sets,
)
if case == "Prior"
# don't do anything
Expand All @@ -132,7 +133,7 @@ function main()
gppackage = Emulators.SKLJL()
pred_type = Emulators.YType()
mlt = GaussianProcess(gppackage; prediction_type = pred_type, noise_learn = false)

n_cross_val_sets = 0
elseif case ["RF-scalar", "Prior"]
rank = n_dimensions #<= 10 ? n_dimensions : 10
kernel_structure = SeparableKernel(LowRankFactor(rank, nugget), OneDimFactor())
Expand Down Expand Up @@ -166,7 +167,7 @@ function main()
test_err[f_idx,rep_idx] = sqrt(sum((y_pred[ind_test] - y[ind_test]).^2))/length(ind_test)

JLD2.save(
joinpath(output_directory, "diff_n_features_GFunction_$(n_dimensions)_ntest-$(Int(n_train_pts/5))_cv-$(n_cross_val_sets).jld2"),
joinpath(output_directory, "diff_n_features_GFunction_$(case)_$(n_dimensions)_ntest-$(Int(n_train_pts/5))_cv-$(n_cross_val_sets).jld2"),
"n_features_vec", n_features_vec,
"timings", ttt,
"train_err", train_err,
Expand Down

0 comments on commit 51d1960

Please sign in to comment.