-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: fix filtering of NaNs in Prophet preprocessing #219
Conversation
WalkthroughThe pull request addresses the handling of NaN values in the Prophet forecasting library by introducing a new Changes
Assessment against linked issues
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
crates/augurs-prophet/src/data.rs (2)
141-179
: Efficient and clean NaN filtering logic.This implementation properly filters out NaN entries in the y vector, updates corresponding fields, and keeps the data structure coherent. The use of a helper retain function is concise.
• Consider if the caller needs feedback on the number of removed rows or warnings (e.g. for large fraction of NaNs).
• Adding extra tests for edge cases, such as all NaNs or multiple consecutive NaNs, could further improve reliability.
347-362
: Test covers a basic NaN scenario.The test checks that a single NaN is filtered from both the y vector and ds. Consider adding broader test coverage (e.g., multiple NaNs or no NaNs).
crates/augurs-prophet/src/prophet.rs (1)
866-877
: Test ensures no panic with NaN entries.“fit_with_nans” successfully validates that including a NaN in the y column won’t crash the process. It matches the PR objective of robustly handling NaNs.
• You could extend coverage to verify the final fitted model state or that the resulting set of data is correct in length.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
crates/augurs-prophet/src/data.rs
(2 hunks)crates/augurs-prophet/src/forecaster.rs
(1 hunks)crates/augurs-prophet/src/prophet.rs
(1 hunks)crates/augurs-prophet/src/prophet/prep.rs
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/augurs-prophet/src/forecaster.rs
🔇 Additional comments (2)
crates/augurs-prophet/src/data.rs (1)
135-140
: Documentation is nice and clear.
These doc comments thoroughly describe the intent and outcome of removing NaN values from the y column and the corresponding entries in others. The mention that “NaN values in other columns are retained” ensures clarity in known behavior.
crates/augurs-prophet/src/prophet/prep.rs (1)
Line range hint 197-210
: Great integration of “filter_nans” into preprocess.
Calling “data.filter_nans()” ensures the dataset is cleansed before proceeding. This matches Issue #209 and PR 219 objectives for robust Prophet preprocessing.
• The direct call is straightforward; be sure any upstream code that depends on “n” is now consistent with the filtered size.
Fixes #209.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation