Skip to content

Conversation

@Patschkowski
Copy link
Contributor

Pull-Request for #3820

@shrit
Copy link
Member

shrit commented Nov 11, 2024

@Patschkowski thank you for this PR, looking forward to having this feature added, could you please fix the error that is happening on the Mac CI infrastructure?

Many thanks

@Patschkowski
Copy link
Contributor Author

@shrit builds are now OK but the documentation build complains about a dead link that is unrelated to my changes. How to handle?

@shrit
Copy link
Member

shrit commented Nov 13, 2024

not a problem, we can merge it with this one failing, many thanks.

@shrit shrit requested a review from rcurtin November 13, 2024 11:55
Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

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

Thanks for the working on this @Patschkowski! I think it will be nice functionality to add. I have a handful of comments; I hope they are helpful. Let me know if I can clarify any of them. Other things to handle before merge (small issues but I want to write them down at least):

  • update HISTORY.md to point out the addition
  • add a comment to random_forest.hpp in the definition of RandomForest to indicate that UseWeights will go away in mlpack 5.0.0
  • add your name to the list of contributors if you want :)

@Patschkowski
Copy link
Contributor Author

Patschkowski commented Nov 22, 2024

@shrit , @rcurtin , how can I fix the macOS build? It looks like it is failing already at the installation of the build dependencies. (c.f. #3837 for a fix)

@shrit
Copy link
Member

shrit commented Nov 27, 2024

@Patschkowski OS X failure is not related, we are trying to fix this in another PR

Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @Patschkowski! I am sure you are getting tired of these reviews by now but there are a couple more small things to handle. Most specifically the example in the documentation doesn't compile for two reasons: one of them is something wrong in the code itself, and the other is something wrong in code that I wrote a long time ago that happens to impact yours.

If you can add these changes to your PR and fix the other issues in the example then that should build correctly:

https://gist.github.com/rcurtin/92bb8bf09b301da3975002fdd0dfcdb7

I left instructions in the comments on how you can build locally, but if you prefer, I'm happy to test that myself when you push changes. (Normally the documentation snippet build job would get this, but that is currently not working as I fix it in another branch. Until then I don't mind checking by hand.)

Thanks again. These last comments really are just wrapping up, as soon as we can get the documentation to build correctly and the example to be clear then let's merge.

@Patschkowski
Copy link
Contributor Author

Patschkowski commented Mar 1, 2025

@rcurtin , hope we are there now. Waiting your review

Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

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

Thanks @Patschkowski! Let's get this merged finally. :)

I pushed one commit that makes a couple small changes:

  • The lack of a newline at the end of random_forest.md actually breaks the scripts/test-docs.sh script... I could fix the script, or I could add a newline at the end of the file, which is a good thing anyway, so added the newline.
  • For the test code to compile, there is no using namespace mlpack anywhere, so I had to fully qualify all the names with mlpack::.
  • I also fixed a comment that wrapped but didn't have a leading //.
  • Lastly I also made the example give a little bit of output so that if a user runs it they at least get something.

Thanks so much for the hard work on this! I appreciate your dedication to the effort.

cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.29")
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
endif()
Copy link
Member

Choose a reason for hiding this comment

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

@shrit just FYI, this looks necessary for older CMake versions. If you want to update mlpack.cmake downstream in the examples repo, once this is merged you could pull the change here.

Copy link
Member

Choose a reason for hiding this comment

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

yes for sure, make sense.

const double minGainSplit,
arma::vec& splitInfo,
AuxiliarySplitInfo& aux);
static double SplitIfBetter(const double bestGain,
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch! This does need to be static indeed.

static size_t CalculateDirection(
const ElemType& point,
const double& splitInfo,
const arma::vec& splitInfo,
Copy link
Member

Choose a reason for hiding this comment

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

Thanks also for this fix!

b_int (0),
state(0),
a_int(0),
b_int(0),
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for these fixes also---I know it was not directly a part of your PR. (And all the other builds should be fixed very shortly... I'm just finishing up #3893 this morning...)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Second approval provided automatically after 24 hours. 👍

@shrit shrit merged commit b5e3284 into mlpack:master Mar 10, 2025
10 checks passed
@rcurtin
Copy link
Member

rcurtin commented Mar 10, 2025

Thanks @Patschkowski! Glad to finally have this merged 👍

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.

5 participants