Skip to content

Commit 42dcbfb

Browse files
committed
updated scikit-learn API calls to support model params
1 parent baa4608 commit 42dcbfb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sklearn/fml/fml_client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _post_msg(self, uri, data):
2222
print(res.status_code)
2323
return res.json()
2424

25-
def publish(self, model, metric_name, metric_value, dataset):
25+
def publish(self, model, metric_name, metric_value, dataset, params=None):
2626
"""
2727
Publishes the data collected to the federated meta learning API
2828
"""
@@ -35,6 +35,16 @@ def publish(self, model, metric_name, metric_value, dataset):
3535
data['metric_name'] = metric_name
3636
data['metric_value'] = metric_value
3737
data['dataset_hash'] = dataset_hash
38+
if params != None:
39+
model_params = []
40+
for key, value in params.items():
41+
new_param = {}
42+
new_param['param_name'] = str(key)
43+
new_param['param_value'] = str(value)
44+
model_params.append(new_param)
45+
data['params'] = model_params
46+
else:
47+
data['params'] = ""
3848

3949
return self._post_msg(URI().post_metric(), data)
4050

0 commit comments

Comments
 (0)