Skip to main content
. 2023 Dec 17;11(24):3185. doi: 10.3390/healthcare11243185
Algorithm 2 Global Model Training
  •   1: 

    Input: List of client models [Client1,Client2,,ClientN]

  •   2: 

    Input: Number of clients N

  •   3: 

    Output: Global federated model Federated_Model

  •   4: 

    Initialize an empty list predictions

  •   5: 

    for i1 to N do

  •   6:

        predictionsiClienti.predict(X)           ▹ Make predictions on validation data

  •   7:

        predictions.append(predictionsi)                 ▹ Aggregate predictions

  •   8: 

    end for

  •   9: 

    combined_predictionssum(predictions)             ▹ Sum predictions across clients

  • 10: 

    final_predictionsargmax(combined_predictions) ▹ Select class with the highest probability

  • 11: 

    Initialize the global federated model FederatedModel

  • 12: 

    Return  FederatedModel