MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / format_recs

Function format_recs

python/seldon/microservice/recommend.py:36–43  ·  view source on GitHub ↗
(recs)

Source from the content-addressed store, hash-verified

34 return input
35
36def format_recs(recs):
37 formatted_recs_list=[]
38 for (item,score) in recs:
39 formatted_recs_list.append({
40 "item": item,
41 "score": score
42 })
43 return { "recommended": formatted_recs_list }
44
45def get_data_set(raw_data):
46 return set(json.loads(raw_data))

Callers 1

do_recommendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected