This algoithm is part of the vantage6 solution. Vantage6 allowes to execute computations on federated datasets. This repository provides a boilerplate for new algorithms.
First clone the repository.
# Clone this repository
git clone https://github.com/IKNL/v6-boilerplate-py
Rename the directories to something that fits your algorithm, we use the convention v6-{name}-{language}
. Then you can edit the following files:
Update the ARG PKG_NAME=...
to the name of your algorithm (preferable the same as the directory name).
Determine which license suits your project.
Contains all the methods that can be called at the nodes. All regular definitions in this file that have the prefix RPC_
are callable by an external party. If you define a master method, it should not contain the prefix! The master and regular definitions both have there own signature. Master definitions have a client and data argument (and possible some other arguments), while the regular definition only has the data argument. The data argument is a pandas dataframe and the client argument is a ClientContainerProtocol
or ClientMockProtocol
from the vantage6-toolkit. The master and regular definitions signatures should look like:
def some_master_name(client, data, *args, **kwargs):
# do something
pass
def RPC_some_regular_method(data, *args, **kwargs):
# do something
pass
In order for the Docker image to find the methods the algorithm needs to be installable. Make sure the name matches the ARG PKG_NAME
in the Dockerfile.
See the documentation for detailed instructions on how to install and use the server and nodes.