A demo of federated random forest algorithm. The demo includes local training-inference and remote training (with ip and port) parts.
The following code runs in root path.
To run the local demo, simply run demo_local.py
.
For the remote version:
With start network topology, coordinator is deployed on a server which connect all the clients. In this case, one could run a training process demo as the following:
-
create a config file (for example
config.py
). A demo config file is included asconfig.py
-
create 3 terminals (either local or remote), run the following command to create 3 clients (one for each terminal):
python demos/random_forest/client.py -I 0 -C demos/random_forest/config.py
python demos/random_forest/client.py -I 1 -C demos/random_forest/config.py
python demos/random_forest/client.py -I 2 -C demos/random_forest/config.py
-
create a new terminal, run the following command to create coordinator:
python demos/random_forest/coordinator.py -C demos/random_forest/config.py
In this experimental code, coordinator is combined with active client so that the framework can support potentially any network topology. In this case, one could run a training process demo as the following:
-
create a config file (for example
config.py
). A demo config file is included asconfig.py
-
run the following command to create 3 clients:
python demos/random_forest/client.py -I 1 -C demos/random_forest/config.py
python demos/random_forest/client.py -I 2 -C demos/random_forest/config.py
python demos/random_forest/client.py -I 0 -C demos/random_forest/config.py -F T
Notice that client0 should be the last one to start.
TBA