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

How to train a random forests model? #52

Open
hy101 opened this issue Nov 21, 2022 · 4 comments
Open

How to train a random forests model? #52

hy101 opened this issue Nov 21, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@hy101
Copy link

hy101 commented Nov 21, 2022

Random forests model is mentioned in the FedTree draft paper, could you please add some example code for that

@Ch33s3Burger
Copy link

Ch33s3Burger commented Nov 28, 2022

You have to set the "bagging" option to 1. It is not mentioned in the docs

@QinbinLi QinbinLi added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 1, 2022
@QinbinLi
Copy link
Member

QinbinLi commented Dec 2, 2022

Hi @hy101 and @Ch33s3Burger ,

Currently random forest is implemented by merging all trees trained by different parties in the federated setting. There is no performance guarantee for the federated random forest. If setting bagging=1, FedTree takes the average of the output of each tree as the prediction value. More features (e.g., instance and feature bagging) and documentation will come in the future.

@Ch33s3Burger
Copy link

Those are the parameters i set to train a random forest model. Are those parameters correct to simulate the training of a federated forest model with the data?

clf = FLRegressor(n_trees=1, n_parties=NUM_CLIENTS, mode="horizontal",
                  max_depth=MAX_DEPTH, objective="reg:linear", bagging=1, n_parallel_trees=NUM_TREES)
clf.fit(x_train, y_train)

@QinbinLi
Copy link
Member

QinbinLi commented Dec 3, 2022

Hi @Ch33s3Burger ,

No, your code will only train a single tree. FedTree does not support n_parallel_trees currently. I'll let you know when this parameter is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants