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

Integrate C++ ranger in larger C++ program #644

Open
CopyOfA opened this issue Nov 17, 2022 · 2 comments
Open

Integrate C++ ranger in larger C++ program #644

CopyOfA opened this issue Nov 17, 2022 · 2 comments

Comments

@CopyOfA
Copy link

CopyOfA commented Nov 17, 2022

I am hoping to use C++ ranger in my C++ program, but the way the ranger codebase works now, I would need to initialize a forest model each time I want to use the model against different datasets. Moreover, the model expects the input data to be a file. What I am hoping to do is:

  1. initialize a model from a .forest file, without data (I don't need any of the training parameters either, e.g., mtry, splitrule, sample_with_replacement)
  2. pass an array into the model and collect model output
  3. repeat 2 for an arbitrary number of arrays
  4. free memory from model

The ranger codebase is extensive, so I'm wondering if someone has done this before, so I don't need to develop new methods within ranger. If not, I don't mind developing this, but I'll need some guidance on where best to make changes.

@mnwright
Copy link
Member

mnwright commented Dec 1, 2022

Yes, implementing a proper library with a common API would be a great improvement. See also #304, #349, #420.

@CopyOfA
Copy link
Author

CopyOfA commented Dec 1, 2022

In my application, I only need the classification forest, so I'll see what I can do on this. My plan is to write a derived class from ForestClassification and write all new initialization and data loading methods in that class, so I don't mess with the original code.

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

No branches or pull requests

2 participants