Repository navigation
Nullable Types: Make Pipeline (Reloaded) - #3129
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3129 +/- ##
=======================================
+ Coverage 99.7% 99.7% +0.1%
=======================================
Files 317 318 +1
Lines 30711 30756 +45
=======================================
+ Hits 30607 30652 +45
Misses 104 104
Continue to review full report at Codecov.
|
e48a177 to
a50a03c
Compare
tamargrey
left a comment
There was a problem hiding this comment.
This looks good to me from a Woodwork perspective
| if "int_null" in column_names: | ||
| logical_types.update({"int_null": "integer_nullable"}) | ||
| if "age_null" in column_names: | ||
| logical_types.update({"age_null": "integer_nullable"}) |
There was a problem hiding this comment.
Should this be "age_nullable"?
| "int_null": [0, 1, 2, np.nan, 4, np.nan, 6] * 2, | ||
| "age_null": [0, 1, 2, np.nan, 4, np.nan, 6] * 2, | ||
| "bool_null": [True, None, False, True, False, None, True] * 2, |
There was a problem hiding this comment.
I think these will have dtypes of either float64 for the integer columns or object for the boolean column when you create this dataframe.
Do you also need to make sure to handle the case where these columns might have the Int64 or boolean dtype, particularly when testing with the pandas version of the input?
"int_null": pd.Series([0, 1, 2, np.nan, 4, np.nan, 6] * 2, dtype="Int64"),
"age_null": pd.Series([0, 1, 2, np.nan, 4, np.nan, 6] * 2, dtype="Int64"),
"bool_null": pd.Series([True, None, False, True, False, None, True] * 2, dtype="boolean"),
There was a problem hiding this comment.
I think it'll be worthwhile to eventually add coverage for pandas dataframes with nullable types that don't have ww initialized (which I think is what this change will give us) but I'm satisfied with the coverage we have now because it covers the most frequent cases we'll run into regarding nullable types I think. Most of our users with nullable types already initialized woodwork on their dataframe.
…sure. Updated the imputer to handle nullable types.
…if it's correct. Added some more testing to do integration testing in isolation.
60c66d1 to
678c415
Compare
freddyaboulton
left a comment
There was a problem hiding this comment.
Thank you for this @chukarsten ! Looks good to me. I think the integration test you have in place is easy to extend as we progress through the epic, which is neat.
| "int_null": [0, 1, 2, np.nan, 4, np.nan, 6] * 2, | ||
| "age_null": [0, 1, 2, np.nan, 4, np.nan, 6] * 2, | ||
| "bool_null": [True, None, False, True, False, None, True] * 2, |
There was a problem hiding this comment.
I think it'll be worthwhile to eventually add coverage for pandas dataframes with nullable types that don't have ww initialized (which I think is what this change will give us) but I'm satisfied with the coverage we have now because it covers the most frequent cases we'll run into regarding nullable types I think. Most of our users with nullable types already initialized woodwork on their dataframe.
| sampler_name=self.sampler_name, | ||
| extra_components=feature_selector, | ||
| extra_components_position="after_preprocessing", | ||
| parameters=self._pipeline_params, |
There was a problem hiding this comment.
Was this a previous bug?
There was a problem hiding this comment.
@freddyaboulton the pipeline parameters should have been passed in through line 201 where it's added in _transform_parameters().
@chukarsten did you notice that the pipeline parameters were not passing in? This should behave the same way as the first batch in IterativeAlgorithm where:
if self._batch_number == 0:
next_batch = [
pipeline.new(
parameters=self._transform_parameters(pipeline, {}),
random_seed=self.random_seed,
)
for pipeline in self.allowed_pipelines
]
Addresses: #3124
This PR should update
make_pipeline()such that it now appropriately addresses the presence of AgeNullable, BooleanNullable, and IntegerNullable dtypes in Woodwork dataframes and adds them into the preprocessing pipelines of these. Added a new integration test file with the intent of adding more integration testing in addition to what's in here.