FedXgbBagging#
- class FedXgbBagging(evaluate_function: Callable[[int, Parameters, Dict[str, bool | bytes | float | int | str]], Tuple[float, Dict[str, bool | bytes | float | int | str]] | None] | None = None, **kwargs: Any)[源代码]#
基类:
FedAvg
Configurable FedXgbBagging strategy implementation.
Methods
aggregate_evaluate
(server_round, results, ...)Aggregate evaluation metrics using average.
aggregate_fit
(server_round, results, failures)Aggregate fit results using bagging.
configure_evaluate
(server_round, parameters, ...)配置下一轮评估。
configure_fit
(server_round, parameters, ...)配置下一轮训练。
evaluate
(server_round, parameters)使用评估函数评估模型参数。
initialize_parameters
(client_manager)初始化全局模型参数。
num_evaluation_clients
(num_available_clients)使用部分可用客户进行评估。
num_fit_clients
(num_available_clients)返回样本大小和所需的可用客户数量。
- aggregate_evaluate(server_round: int, results: List[Tuple[ClientProxy, EvaluateRes]], failures: List[Tuple[ClientProxy, EvaluateRes] | BaseException]) Tuple[float | None, Dict[str, bool | bytes | float | int | str]] [源代码]#
Aggregate evaluation metrics using average.
- aggregate_fit(server_round: int, results: List[Tuple[ClientProxy, FitRes]], failures: List[Tuple[ClientProxy, FitRes] | BaseException]) Tuple[Parameters | None, Dict[str, bool | bytes | float | int | str]] [源代码]#
Aggregate fit results using bagging.
- configure_evaluate(server_round: int, parameters: Parameters, client_manager: ClientManager) List[Tuple[ClientProxy, EvaluateIns]] #
配置下一轮评估。
- configure_fit(server_round: int, parameters: Parameters, client_manager: ClientManager) List[Tuple[ClientProxy, FitIns]] #
配置下一轮训练。
- evaluate(server_round: int, parameters: Parameters) Tuple[float, Dict[str, bool | bytes | float | int | str]] | None [源代码]#
使用评估函数评估模型参数。
- initialize_parameters(client_manager: ClientManager) Parameters | None #
初始化全局模型参数。
- num_evaluation_clients(num_available_clients: int) Tuple[int, int] #
使用部分可用客户进行评估。
- num_fit_clients(num_available_clients: int) Tuple[int, int] #
返回样本大小和所需的可用客户数量。