Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor vertical FL module for XGB-base #482

Merged
merged 17 commits into from
Jan 17, 2023
Prev Previous commit
minor fix
  • Loading branch information
xieyxclack committed Jan 16, 2023
commit 92d3d032e327ea8e7ce0832e5556eb34c0322fcf
2 changes: 1 addition & 1 deletion federatedscope/vertical_fl/dataloader/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def load_vertical_data(config=None, generate=False):
else:
args = {'normalization': False, 'standardization': False}

dataset_class = VERTICAL_DATASET[dataset_name]
if not generate:
dataset_class = VERTICAL_DATASET[dataset_name]
dataset = dataset_class(root=config.data.root,
num_of_clients=config.federate.client_num,
feature_partition=config.vertical.dims,
Expand Down
10 changes: 5 additions & 5 deletions tests/test_xgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from federatedscope.core.auxiliaries.utils import setup_seed
from federatedscope.core.auxiliaries.logging import update_logger
from federatedscope.core.configs.config import global_cfg
from federatedscope.core.fed_runner import FedRunner
from federatedscope.core.auxiliaries.runner_builder import get_runner


class XGBTest(unittest.TestCase):
Expand Down Expand Up @@ -60,10 +60,10 @@ def test_XGBFL(self):
init_cfg.merge_from_other_cfg(modified_config)
self.assertIsNotNone(data)

Fed_runner = FedRunner(data=data,
server_class=get_server_cls(init_cfg),
client_class=get_client_cls(init_cfg),
config=init_cfg.clone())
Fed_runner = get_runner(data=data,
server_class=get_server_cls(init_cfg),
client_class=get_client_cls(init_cfg),
config=init_cfg.clone())
self.assertIsNotNone(Fed_runner)
test_results = Fed_runner.run()
init_cfg.merge_from_other_cfg(backup_cfg)
Expand Down