def main(config='../../config.yaml', namespace=''):
    if isinstance(config, str):
        config = load_job_config(config)
    parties = config.parties
    guest = parties.guest[0]
    host = parties.host[0]
    arbiter = parties.arbiter[0]
    backend = config.backend
    work_mode = config.work_mode
    guest_train_data = {'name': 'breast_homo_guest', 'namespace': f'experiment{namespace}'}
    host_train_data = {'name': 'breast_homo_host', 'namespace': f'experiment{namespace}'}
    pipeline = PipeLine()
    pipeline.set_initiator(role='guest', party_id=guest)
    pipeline.set_roles(guest=guest, host=host, arbiter=arbiter)
    reader_0 = Reader(name='reader_0')
    reader_0.get_party_instance(role='guest', party_id=guest).component_param(table=guest_train_data)
    reader_0.get_party_instance(role='host', party_id=host).component_param(table=host_train_data)
    dataio_0 = DataIO(name='dataio_0', with_label=True, output_format='dense')
    scale_0 = FeatureScale(name='scale_0')
    param = {'penalty': 'L2', 'optimizer': 'sgd', 'tol': 1e-05, 'alpha': 0.01, 'max_iter': 3, 'early_stop': 'diff', 'batch_size': 320, 'learning_rate': 0.15, 'decay': 1.0, 'decay_sqrt': True, 'init_param': {'init_method': 'zeros'}, 'encrypt_param': {'method': None}, 'cv_param': {'n_splits': 5, 'shuffle': True, 'random_seed': 33, 'need_cv': True}}
    homo_lr_0 = HomoLR(name='homo_lr_0', **param)
    pipeline.add_component(reader_0)
    pipeline.add_component(dataio_0, data=Data(data=reader_0.output.data))
    pipeline.add_component(scale_0, data=Data(data=dataio_0.output.data))
    pipeline.add_component(homo_lr_0, data=Data(train_data=scale_0.output.data))
    pipeline.compile()
    job_parameters = JobParameters(backend=backend, work_mode=work_mode)
    pipeline.fit(job_parameters)
    print(json.dumps(pipeline.get_component('homo_lr_0').get_summary(), indent=4, ensure_ascii=False))
def main(config='../../config.yaml', namespace=):
    if isinstance(config, str):
        config = load_job_config(config)
    parties = config.parties
    guest = parties.guest[0]
    host = parties.host[0]
    arbiter = parties.arbiter[0]
    backend = config.backend
    work_mode = config.work_mode
    guest_train_data = {'name': 'breast_homo_guest', 'namespace': f'experiment{namespace}'}
    host_train_data = {'name': 'breast_homo_host', 'namespace': f'experiment{namespace}'}
    pipeline = PipeLine()
    pipeline.set_initiator(role='guest', party_id=guest)
    pipeline.set_roles(guest=guest, host=host, arbiter=arbiter)
    reader_0 = Reader(name='reader_0')
    reader_0.get_party_instance(role='guest', party_id=guest).component_param(table=guest_train_data)
    reader_0.get_party_instance(role='host', party_id=host).component_param(table=host_train_data)
    dataio_0 = DataIO(name='dataio_0', with_label=True, output_format='dense')
    scale_0 = FeatureScale(name='scale_0')
    param = {'penalty': 'L2', 'optimizer': 'sgd', 'tol': 1e-05, 'alpha': 0.01, 'max_iter': 3, 'early_stop': 'diff', 'batch_size': 320, 'learning_rate': 0.15, 'decay': 1.0, 'decay_sqrt': True, 'init_param': {'init_method': 'zeros'}, 'encrypt_param': {'method': None}, 'cv_param': {'n_splits': 5, 'shuffle': True, 'random_seed': 33, 'need_cv': True}}
    homo_lr_0 = HomoLR(name='homo_lr_0', **param)
    pipeline.add_component(reader_0)
    pipeline.add_component(dataio_0, data=Data(data=reader_0.output.data))
    pipeline.add_component(scale_0, data=Data(data=dataio_0.output.data))
    pipeline.add_component(homo_lr_0, data=Data(train_data=scale_0.output.data))
    pipeline.compile()
    job_parameters = JobParameters(backend=backend, work_mode=work_mode)
    pipeline.fit(job_parameters)
    print(json.dumps(pipeline.get_component('homo_lr_0').get_summary(), indent=4, ensure_ascii=False))