FederatedAI / FATE

An Industrial Grade Federated Learning Framework
Apache License 2.0
5.57k stars 1.54k forks source link

2.0版本FlowClient如何获取训练组件的all metric? #5621

Open Sadirry opened 2 weeks ago

Sadirry commented 2 weeks ago

1.10版本FlowClient提供了component = api.Component()的接口,可以实现获取训练过程metric的详细数据:

    def metric_all(self, job_id, role, party_id, component_name):
        kwargs = locals()
        config_data, dsl_data = preprocess(**kwargs)
        check_config(config=config_data,
                     required_arguments=['job_id', 'component_name', 'role', 'party_id'])
        return self._post(url='tracking/component/metric/all', json=config_data)

请问在2.0/2.1版本中,是否提供了这样的接口?

mgqa34 commented 1 week ago

1.10版本FlowClient提供了component = api.Component()的接口,可以实现获取训练过程metric的详细数据:

    def metric_all(self, job_id, role, party_id, component_name):
        kwargs = locals()
        config_data, dsl_data = preprocess(**kwargs)
        check_config(config=config_data,
                     required_arguments=['job_id', 'component_name', 'role', 'party_id'])
        return self._post(url='tracking/component/metric/all', json=config_data)

请问在2.0/2.1版本中,是否提供了这样的接口?

可以使用query_metric接口: https://github.com/FederatedAI/FATE-Client/blob/main/python/fate_client/flow_sdk/api/output.py#L40

Sadirry commented 1 week ago

query_metric 接口只提供了最终的auc,没有中间结果,请问2.1版本是不在提供这样的接口了吗?

mgqa34 commented 1 week ago

这是因为没有集成训练时对每一轮的评估,这个是算法内部流程决定的,和接口关系不大,接口只是提供数据库查询功能。