Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Machine Learning) expand_more
Machine Learning / Production

Single prediction API shape

Learn Single prediction API shape in Machine Learning with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Advanced
machine-learning-060.py
python
def predict_one(payload):
    row=[[payload["age"],payload["income"],payload["visits"]]]
    return {"risk":float(model.predict_proba(row)[0,1])}
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content