Skip to content

Conversation

Dhairya-A-Mehra
Copy link

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

Summary of Changes:

  1. Bug Fixes: Resolved issues in the implementations of the XGBoost Classifier and Regressor by correcting data handling, model training, and prediction functionalities.
  2. Doctests: Added and updated doctests for both algorithms to ensure proper functionality and ease of understanding.
  3. Code Optimization: Improved code readability and organization, adhering to Python naming conventions and best practices.

Detailed Explanation:

In this pull request, I have made significant modifications to both the xgboost_classifier.py and xgboost_regressor.py files:

  1. XGBoost Classifier:

    • Corrected the data_handling function to ensure it properly splits the dataset into features and targets, now returning a tuple of appropriate types.
    • Fixed the xgboost function to ensure it correctly fits the model with the provided features and target data, ensuring it utilizes the XGBoost library appropriately.
    • Updated the main function to include proper handling and display of the confusion matrix, providing visual insights into model performance.
  2. XGBoost Regressor:

    • Similar updates were made to the data_handling function to handle input data correctly.
    • Adjusted the xgboost function to ensure proper training of the regression model and make predictions on the test dataset.
    • Enhanced the main function to calculate and display mean absolute error and mean square error for model evaluation.

These changes enhance the functionality of the algorithms, providing a more robust and reliable implementation for users.

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 1, 2024
@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 1, 2024
@Dhairya-A-Mehra Dhairya-A-Mehra changed the title Implement XGBoost Classifier and Regressor from Scratch Implement XGBoost Classifier and Regressor from Scratch [Pls label me for Hacktoberfest-24] Oct 1, 2024
@cclauss
Copy link
Member

cclauss commented Oct 22, 2024

Closing tests_are_failing PRs to prepare for Hacktoberfest

@cclauss cclauss closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants