Conversation
| @@ -0,0 +1,6 @@ | |||
| from featuretools.primitives import * | |||
Codecov Report
@@ Coverage Diff @@
## main #2128 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 143 143
Lines 16869 16907 +38
=======================================
+ Hits 16737 16775 +38
Misses 132 132
Continue to review full report at Codecov.
|
|
|
||
| def get_function(self): | ||
| def part_of_day(vals): | ||
| return vals.apply(lambda x: self.get_part_of_day(x.hour)) |
There was a problem hiding this comment.
Can we see if there is a faster way to implement this primitive? Can we vectorize it or look for a faster approach? Perhaps a pd.merge?
There was a problem hiding this comment.
It also might be worth doing performance checking and using the fastest approach
There was a problem hiding this comment.
Sounds good, I will look into it right now
There was a problem hiding this comment.
I'm still trying to get it to work -- haven't been able to find a way that doesn't involve a map of some kind (because the output is not boolean). Does anyone have any tips? Right now it's about 4x slower than something like IsWeekend().
Merge branch 'part-of-day' of https://github.com/alteryx/featuretools into part-of-day
docs/source/release_notes.rst
Outdated
| * Enhancements | ||
| * Add ``DayOfYear``, ``DaysInMonth``, ``Quarter``, ``IsLeapYear``, ``IsQuarterEnd``, ``IsQuarterStart`` transform primitives (:pr:`2110`, :pr:`2117`) | ||
| * Add ``IsMonthEnd``, ``IsMonthStart`` transform primitives (:pr:`2121`) | ||
| * Add ``IsMonthEnd``, ``IsMonthStart`` transform primitives (:pr:`2121`, :pr:`2128`) |
There was a problem hiding this comment.
Shouldn't there be a new line with PartOfDay and this PR # ?
| ) | ||
| answer = [i if not pd.isna(i) else None for i in answer] | ||
| correct_answer = [i if not pd.isna(i) else None for i in correct_answer] | ||
| np.testing.assert_array_equal(answer, correct_answer) |
There was a problem hiding this comment.
a nit, but convention is to compare expected and actual, not answer and correct_answer
Merge branch 'part-of-day' of https://github.com/alteryx/featuretools into part-of-day
| return month | ||
|
|
||
|
|
||
| class PartOfDay(TransformPrimitive): |
There was a problem hiding this comment.
Sorry, just thought of this, but can you add boundaries of all different types in the doc string?
fixes #2059