Skip to content

Commit 8df91c3

Browse files
committed
Allow alpha selector with custom val proportion
1 parent d593ed8 commit 8df91c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/conformist/alpha_selector.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def __init__(self,
2121
max_alpha=0.5,
2222
increment_alpha=0.05,
2323
n_runs_per_alpha=1000,
24+
val_proportion=0.1
2425
):
2526
self.create_output_dir(base_output_dir)
2627
self.cop_class = cop_class
@@ -29,6 +30,7 @@ def __init__(self,
2930
self.max_alpha = max_alpha
3031
self.increment_alpha = increment_alpha
3132
self.n_runs_per_alpha = n_runs_per_alpha
33+
self.val_proportion = val_proportion
3234

3335
# Initialize lists
3436
self.alphas = []
@@ -50,7 +52,8 @@ def run(self):
5052
self.increment_alpha):
5153
alpha = round(a, 2)
5254
cop = self.cop_class(self.prediction_dataset, alpha=alpha)
53-
trial = cop.do_validation_trial(n_runs=self.n_runs_per_alpha)
55+
trial = cop.do_validation_trial(n_runs=self.n_runs_per_alpha,
56+
val_proportion=self.val_proportion)
5457

5558
# Store values for graphing
5659
self.alphas.append(alpha)

0 commit comments

Comments
 (0)