Horizontal Linear Regression
Introduction
Horizontal linear regression is a model obtained by building linear regression model on the horizontal federated learning system.
Parameter List
identity: str Federated identity of the party, should be one of label_trainer, trainer or assist trainer.
- model_info:
name:
strModel name, should be horizontal_linear_regression.- config:
input_dim:
intSize of each input sample.bias:
intWhether having a learnable additive bias.
- input:
- trainset:
type:
strTrain dataset type, support csv.path:
strIf type is csv, folder path of train dataset.name:
boolIf type is csv, file name of train dataset.has_id:
boolIf type is csv, whether dataset has id column.has_label:
boolIf type is csv, whether dataset has label column.
- valset:
type:
strValidation dataset type, support csv.path:
strIf type is csv, folder path of validation dataset.name:
boolIf type is csv, file name of validation dataset.has_id:
boolIf type is csv, whether dataset has id column.has_label:
boolIf type is csv, whether dataset has label column.
- output:
- model:
type:
strModel output format, support “file”.path:
strFolder path of output model.name:
strFile name of output model.
- train_info:
device:
strDevice on which the algorithm runs, support cpu.- interaction_params:
save_frequency:
intFrequency (per global_epoch) to save model, set to -1 for not saving model.
- params:
global_epoch:
intGlobal training epoch.local_epoch:
intLocal training epoch of involved parties.batch_size:
intBatch size of samples in local and global process.- aggregation_config:
type:
strAggregation method, support “fedavg”.- encryption:
method:
strEncryption method, recommend “otp”.key_bitlength:
intKey length of one time pad encryption,support 64 and 128.data_type:
strInput data type, support torch.Tensor and numpy.ndarray, depending on model data type.- key_exchange:
key_bitlength:
intBit length of paillier key, recommend to be greater than or equal to 2048.optimized:
boolWhether to use optimized method.
- csprng:
name:
strPseudo-random number generation method.method:
strCorresponding hash method.
- optimizer_config: Support optimizers and their parameters defined in pytorch or registered by user. For example:
- Adam:
lr:
floatOptimizer learning rate.amsgrad:
boolWhether to use the AMSGrad variant.
- lr_scheduler_config: Support lr_scheduler and their parameters defined in pytorch or registered by user. For example:
- StepLR:
step_size:
intPeriod of learning rate decay.gamma:
floatMultiplicative factor of learning rate decay.
lossfunc_config: Loss function configuration, support L1Loss and MAPEloss.
- metric_config: Support multiple metrics.
mae: Mean absolute error.
mse: Mean square error.
mape: Mean absolute percentage error.