Repository navigation
DatetimeFormatDataCheck for equal interval and sorting - #2603
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2603 +/- ##
=======================================
+ Coverage 99.9% 99.9% +0.1%
=======================================
Files 295 297 +2
Lines 26895 27027 +132
=======================================
+ Hits 26851 26983 +132
Misses 44 44
Continue to review full report at Codecov.
|
| y_train = infer_feature_types(y_train) | ||
| problem_type = handle_problem_types(problem_type) | ||
|
|
||
| datetime_column = None |
There was a problem hiding this comment.
Depending on the outcome of our time series discussions, we can change this if we want to consider the index as the default placement of datetime data for time series. Until then, we'd need the user to pass in a minimum of date_index for time series default objectives.
| y = infer_feature_types(y) | ||
|
|
||
| if self.datetime_column != "index": | ||
| datetime_values = X[self.datetime_column] |
There was a problem hiding this comment.
We're not trying to extract every datetime column, just the one that indexes the datetime information
| datetime_values = X.index | ||
| if not isinstance(datetime_values, pd.DatetimeIndex): | ||
| datetime_values = y.index | ||
| if not isinstance(datetime_values, pd.DatetimeIndex): |
There was a problem hiding this comment.
This allows the user to just specify index, and we can check the X index first followed by the y index.
| def __init__(self, problem_type, objective, n_splits=3): | ||
| def __init__(self, problem_type, objective, n_splits=3, datetime_column="index"): | ||
| default_checks = self._DEFAULT_DATA_CHECK_CLASSES | ||
| data_check_params = {} |
There was a problem hiding this comment.
Changed the layout of this to make it cleaner and more easily understandable as to what data checks and params are being passed across different problem_types.
|
|
||
| @pytest.mark.parametrize("input_type", ["pd", "ww"]) | ||
| @pytest.mark.parametrize( | ||
| "uneven,type_errors", [(True, False), (False, True), (False, False)] |
There was a problem hiding this comment.
Checks across uneven frequencies and incorrect datetime types
freddyaboulton
left a comment
There was a problem hiding this comment.
@ParthivNaresh This looks great! I think there are two changes I'd like to make before merge though. The first is disallowing monotonic decreasing columns, the second is returning DataCheckErrors rather than raising TypeErrors in the data check.
…yx/evalml into DataCheck-For-Equal-Interval
Fixes: #2124