fix: train valid purged ML artifacts
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ml import optimizer
|
||||
|
||||
|
||||
@@ -72,3 +74,16 @@ def test_run_out_of_sample_comparison_scores_only_validation_rows_with_fold_weig
|
||||
|
||||
caution_equal = next(bucket for bucket in comparison["equal_weight"] if bucket["label"] == "CAUTION — OVERHEATED")
|
||||
assert caution_equal["days"] == 2
|
||||
|
||||
|
||||
def test_classification_splits_skip_training_windows_with_one_class():
|
||||
y = np.array([1, 1, 1, 0, 1, 0])
|
||||
splits = [
|
||||
(np.array([0, 1]), np.array([2, 3])),
|
||||
(np.array([0, 1, 3, 4]), np.array([5])),
|
||||
]
|
||||
|
||||
viable = list(optimizer.viable_classification_splits(y, splits))
|
||||
|
||||
assert len(viable) == 1
|
||||
assert viable[0][0].tolist() == [0, 1, 3, 4]
|
||||
|
||||
Reference in New Issue
Block a user