Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4956a51
add test and fix for switch of ground truth and predictions
LennartPurucker Feb 20, 2023
fc642c1
undo import optimization
LennartPurucker Feb 20, 2023
2da1109
fix bug with model passing to function
LennartPurucker Feb 20, 2023
0583668
fix order in other tests
LennartPurucker Feb 20, 2023
1fe8bc9
Merge branch 'openml:develop' into develop
LennartPurucker Feb 20, 2023
14cbd04
update progress.rst
LennartPurucker Feb 21, 2023
ceb1d53
new unit test for run consistency and bug fixed
LennartPurucker Feb 21, 2023
37500a7
clarify new assert
LennartPurucker Feb 21, 2023
921cf10
Merge pull request #1 from LennartPurucker/develop_ext
LennartPurucker Feb 22, 2023
3e97992
Merge branch 'openml:develop' into develop
LennartPurucker Feb 22, 2023
9f47b91
minor loop refactor
LennartPurucker Feb 22, 2023
14d4299
Merge remote-tracking branch 'origin/develop' into develop
LennartPurucker Feb 22, 2023
8686317
refactor default to None
LennartPurucker Feb 22, 2023
8adb0bd
directly test prediction data equal
LennartPurucker Feb 23, 2023
04ca611
Update tests/test_runs/test_run.py
LennartPurucker Feb 23, 2023
f996c0a
Merge branch 'develop' into develop
LennartPurucker Feb 23, 2023
3dac7a7
Mark sklearn tests (#1202)
PGijsbers Feb 23, 2023
1bf8c0e
add test and fix for switch of ground truth and predictions
LennartPurucker Feb 20, 2023
74e9c38
undo import optimization
LennartPurucker Feb 20, 2023
794cce8
Merge branch 'develop' of https://github.com/openml/openml-python int…
LennartPurucker Feb 23, 2023
b4c2030
fix mask error resulting from rebase
LennartPurucker Feb 23, 2023
3c5ff3e
make dummy classifier strategy consistent to avoid problems as a resu…
LennartPurucker Feb 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor loop refactor
  • Loading branch information
LennartPurucker committed Feb 22, 2023
commit 9f47b913e5055dac28cbc7e2c917ebc8f31d0e92
13 changes: 6 additions & 7 deletions tests/test_runs/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,27 +235,26 @@ def _get_models_tasks_for_tests():
@staticmethod
def assert_run_prediction_data(task, run, model):
# -- Get y_pred and y_true as it should be stored in the run
fold_map = np.full(int(task.get_dataset().qualities["NumberOfInstances"]), -1)
s_d = task.get_split_dimensions()
if (s_d[0] > 1) or (s_d[2] > 1):
raise ValueError("Test does not support this task type's split dimensions.")

for fold_id in range(s_d[1]):
_, test_indices = task.get_train_test_split_indices(repeat=0, fold=fold_id, sample=0)
fold_map[test_indices] = fold_id

X, y = task.get_X_and_y()

# Check correctness of y_ture and y_pred in run
for fold_id in range(s_d[1]):
# Get data for fold
Comment thread
LennartPurucker marked this conversation as resolved.
test_indices = np.where(fold_map == fold_id)[0]
train_mask = np.full(len(fold_map), True)
_, test_indices = task.get_train_test_split_indices(repeat=0, fold=fold_id, sample=0)
train_mask = np.full(len(X), True)
train_mask[test_indices] = False

# Get train / test
X_train = X[train_mask]
y_train = y[train_mask]
X_test = X[test_indices]
y_test = y[test_indices]

# Get y_pred
y_pred = model.fit(X_train, y_train).predict(X_test)

# Get stored data for fold
Expand Down