nvflare.app_common.workflows.lr.np_persistor module

class LRModelPersistor(model_dir='models', model_name='weights.npy', n_features=13)[source]

Bases: NPModelPersistor

This class defines the persistor for Logistics Regression model.

A persistor controls the logic behind initializing, loading and saving of the model / parameters for each round of a federated learning process.

In the Logistics Regression with Newton Raphson, a model is just a 1-D numpy vector containing the parameters for logistic regression. The length of the parameter vector is defined by the number of features in the dataset.

Init function for NewtonRaphsonModelPersistor.

Parameters:
  • model_dir – sub-folder name to save and load the global model between rounds.

  • model_name – name to save and load the global model.

  • n_features – number of features for the logistic regression. For the UCI ML heart Disease dataset, this is 13.