Skip to content

fix(cpp/random_forest): remove stray comment characters and check data::Load - #252

Open
dhirenmahajan11 wants to merge 2 commits into
mlpack:masterfrom
dhirenmahajan11:fix/covertype-rf-comments-and-load-check
Open

dhirenmahajan11 wants to merge 2 commits into
mlpack:masterfrom
dhirenmahajan11:fix/covertype-rf-comments-and-load-check

Conversation

@dhirenmahajan11

Copy link
Copy Markdown

Description of Change

Cleaned up cpp/random_forest/covertype-rf.cpp to improve readability, formatting, and error handling in the example:

  • Removed raw \n", escape sequences and stray trailing punctuation from inline comments.
  • Added a check on mlpack::data::Load(...) to log an error to std::cerr and exit cleanly if loading the dataset fails.
  • Wrapped lines cleanly and fixed the accuracy output formatting so the opening parenthesis is included before the percentage.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Cleans up comment formatting artifacts and adds a load-failure check in the random forest covertype example.

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch dhirenmahajan11/examples/fix/covertype-rf-comments-and-load-check

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.

1 participant