nvflare.app_common.workflows.lr.np_persistor module
- class LRModelPersistor(model_dir='models', model_name='weights.npy', n_features=13, source_ckpt_file_full_name: str | None = None)[source]
Bases:
NPModelPersistorThis 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 LRModelPersistor.
- 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.
source_ckpt_file_full_name – Full path to source checkpoint file (.npy). This path may not exist locally (server-side path). If provided and exists at runtime, it takes priority over the default model.