Skip to content
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

Remove doctest in xgboost_regressor.py main function #10422

Merged

Conversation

tianyizheng02
Copy link
Contributor

Describe your change:

Contributes to #9718 by removing the doctest from the main function in machine_learning/xgboost_regressor.py. The main function is just driver code, and there's no need to run the driver in builds, especially when it's the bottleneck in this file's doctest runtime.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • 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".

@tianyizheng02 tianyizheng02 changed the title Remove xgboost main doctest Remove doctest in xgboost_regressor.py main function Oct 14, 2023
@tianyizheng02
Copy link
Contributor Author

xgboost_regressor.py's main function is no longer one of the slowest durations:

============================= slowest 10 durations =============================
21.33s call     neural_network/simple_neural_network.py::neural_network.simple_neural_network.forward_propagation
1.53s call     web_programming/get_imdbtop.py::web_programming.get_imdbtop.get_imdb_top_movies
1.04s call     dynamic_programming/integer_partition.py::dynamic_programming.integer_partition.partition
1.01s call     other/dijkstra_bankers_algorithm.py::other.dijkstra_bankers_algorithm.BankersAlgorithm.main
0.96s call     web_programming/fetch_anime_and_play.py::web_programming.fetch_anime_and_play.get_anime_episode
0.91s call     graphs/bidirectional_a_star.py::graphs.bidirectional_a_star.AStar
0.82s call     web_programming/fetch_anime_and_play.py::web_programming.fetch_anime_and_play.search_anime_episode_list
0.79s call     web_programming/fetch_anime_and_play.py::web_programming.fetch_anime_and_play.search_scraper
0.55s call     matrix/count_negative_numbers_in_sorted_matrix.py::matrix.count_negative_numbers_in_sorted_matrix.generate_large_matrix
0.46s call     matrix/count_negative_numbers_in_sorted_matrix.py::matrix.count_negative_numbers_in_sorted_matrix.count_negatives_brute_force
================= 1615 passed, 3 warnings in 69.85s (0:01:09) ==================

@tianyizheng02 tianyizheng02 marked this pull request as ready for review October 14, 2023 08:52
@algorithms-keeper algorithms-keeper bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Oct 14, 2023
@cclauss cclauss enabled auto-merge (squash) October 14, 2023 13:33
Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

I would not have a problem with this test if it was fast but it is not.

@cclauss cclauss merged commit 71b372f into TheAlgorithms:master Oct 14, 2023
3 checks passed
@algorithms-keeper algorithms-keeper bot removed the awaiting reviews This PR is ready to be reviewed label Oct 14, 2023
@tianyizheng02 tianyizheng02 deleted the remove-xgboost-main-doctest branch October 14, 2023 18:00
sedatguzelsemme pushed a commit to sedatguzelsemme/Python that referenced this pull request Sep 15, 2024
…#10422)

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Update xgboost_regressor.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants