Skip to content

Xgboost#405

Draft
s0nicboOm wants to merge 9 commits intomainfrom
xgboost
Draft

Xgboost#405
s0nicboOm wants to merge 9 commits intomainfrom
xgboost

Conversation

@s0nicboOm
Copy link
Contributor

  1. Add Xgboost
  2. Add Covariates Transformer

Note: We will have to revisit on how to optimize imports for xgboost and darts

Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
@codecov
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 88.33333% with 14 lines in your changes missing coverage. Please review.

Project coverage is 92.02%. Comparing base (eb9ceb1) to head (32bd2e2).

Files Patch % Lines
numalogic/models/forecast/variants/xgboost.py 89.61% 4 Missing and 4 partials ⚠️
numalogic/tools/data.py 64.70% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
- Coverage   92.11%   92.02%   -0.10%     
==========================================
  Files          97       99       +2     
  Lines        4782     4900     +118     
  Branches      430      442      +12     
==========================================
+ Hits         4405     4509     +104     
- Misses        279      289      +10     
- Partials       98      102       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Signed-off-by: Kushal Batra <i.kushalbatra@gmail.com>
Copy link
Member

@ab93 ab93 left a comment

Choose a reason for hiding this comment

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

Few comments


def _check_data_format(df) -> bool:
if not isinstance(df, pd.DataFrame):
raise TypeError("df should be of type pd.DataFrame")
Copy link
Member

Choose a reason for hiding this comment

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

Can you cover these lines with tests?

def predict_horizon(self, df: pd.DataFrame) -> np.ndarray:
_check_data_format(df)
transformed_test_data = CovariatesGenerator().transform(df)
_LOGGER.info("Predicting the horizon")
Copy link
Member

Choose a reason for hiding this comment

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

remove log

Copy link
Member

Choose a reason for hiding this comment

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

or maybe use debug

pyproject.toml Outdated
pydruid = { version = "^0.6", optional = true }
PyMySQL = { version = "^1.1.0", optional = true }
xgboost = "^2.1.0"
darts = "^0.30.0"
Copy link
Member

Choose a reason for hiding this comment

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

change this to use a lighter version. Also add a TODO to remove this

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.

2 participants