add the none check for data loader & feature output (#577)

This commit is contained in:
Yuante Li
2025-02-10 20:18:01 +08:00
committed by GitHub
parent 216361c640
commit d2baa40fb1
2 changed files with 8 additions and 0 deletions
@@ -38,6 +38,10 @@ def get_column_list(data):
return data.columns.tolist() if isinstance(data, pd.DataFrame) else None
assert X is not None, "The feature engineering function returned None for X."
assert y is not None, "The feature engineering function returned None for y."
assert X_test is not None, "The feature engineering function returned None for X_test."
assert get_length(X_test) == get_length(
test_ids
), f"Mismatch in length of test images and test IDs: X_test ({get_length(X_test)}) and test_ids ({get_length(test_ids)})"
@@ -26,6 +26,10 @@ def get_width(data):
def get_column_list(data):
return data.columns.tolist() if isinstance(data, pd.DataFrame) else None
assert X is not None, "Training data (X) is None."
assert y is not None, "Training labels (y) are None."
assert X_test is not None, "Test data (X_test) is None."
assert test_ids is not None, "Test IDs (test_ids) are None."
assert get_length(X_test) == get_length(
test_ids