Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds regression tests for #2020 #2021

Merged
merged 17 commits into from
May 11, 2022
Merged

Adds regression tests for #2020 #2021

merged 17 commits into from
May 11, 2022

Conversation

geoffreyangus
Copy link
Collaborator

Adds regression tests for #2020, a PR that implemented a fix for NaNs introduced via an outer join concat in the dask df engine.

While writing these tests, I found that PandasEngine.df_like was also doing an outer join of proc_cols (implicitly through pd.DataFrame init) instead of an inner join, similarly leading to NaN values in columns whose preprocessing step called for dropping rows (typically OutputFeature features). This is remedied through an inner join concat. We would like to be able to implement an inner join concat in the dask df engine in the future. It is not currently possible in the dask df engine due to the parallel nature of dask dataframes.

@github-actions
Copy link

github-actions bot commented May 11, 2022

Unit Test Results

       6 files  ±0         6 suites  ±0   1h 43m 28s ⏱️ + 11m 49s
2 774 tests ±0  2 741 ✔️ +1    33 💤 ±0  0  - 1 
8 322 runs  ±0  8 219 ✔️ +1  103 💤 ±0  0  - 1 

Results for commit 6c98b34. ± Comparison against base commit 2c3fe2e.

♻️ This comment has been updated with latest results.

@@ -520,7 +520,18 @@ def run_api_experiment(input_features, output_features, data_csv):
shutil.rmtree(output_dir, ignore_errors=True)


def create_data_set_to_use(data_format, raw_data):
def read_csv_with_nan(path, nan_percent=0.0):
Copy link
Collaborator Author

@geoffreyangus geoffreyangus May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function converts nan_percent of samples in each row of the CSV into NaN. This is important for tests that drop rows for exactly one feature– with this change, one has guarantees about the number of rows that will be dropped.

Example:
In a unit test, we are simulating predicting the targets column which is missing 10% of samples. We choose to drop rows missing a value for targets. With this sampling scheme, we know we will have exactly 90% of samples left.

@geoffreyangus geoffreyangus merged commit 9ae57a9 into master May 11, 2022
@geoffreyangus geoffreyangus deleted the add-dask-nans-test branch May 11, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants