Horizontal Logistic Regression
Introduction
Horizontal logistic regression is a model obtained by building logistic regression model on the horizontal federated learning system.
Parameter List
identity: str Federated identity of the party, should be one of “label_trainer” or “assist trainer”.
- model_info:
name:
strModel name, should be “horizontal_logistic_regression”.- config:
input_dim:
intNumber of features of input data, can be Null.bias:
boolWhether having a learnable additive bias.
- input:
- trainset:
type:
strTrain dataset file type, such as “csv”.path:
strFolder path of train dataset.name:
strFile name of train dataset.has_label:
boolWhether dataset has label column.has_id:
boolWhether dataset has id column.
- valset:
type:
strValidation dataset file type, such as “csv”.path:
strFolder path of Validation dataset.name:
strFile name of Validation dataset.has_label:
boolWhether dataset has label column.has_id:
boolWhether dataset has id column.
- output:
- model:
type:
strModel output file format.path:
strFolder path of output model.name:
strFile name of output model.
- metrics:
type:
strMetrics output file format.path:
strFolder path of output metrics.header:
boolWhether to include the column name.
- evaluation:
type:
strEvaluation output file format.path:
strFolder path of output Evaluation.header:
boolWhether to include the column name.
- train_info:
device:
strDevice on which the algorithm runs, support “cpu”.- 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”, “fedprox” and “scaffold”.- encryption:
method:
strEncryption method, recommend “otp”.key_bitlength:
intKey length of one time pad encryption, support 64 and 128. 128 is recommended for better security.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 “BCEWithLogitsLoss”.
- metric_config: Support multiple metrics.
accuracy: Accuracy.
precision: Precision.
recall: Recall.
f1_score: F1 score.
auc: Area Under Curve.
ks: Kolmogorov-Smirnov (KS) Statistics.