Question: I have this function... def predict(): probs = input(Input list of prediction probabilities: ) thresh = input(Input threshold value: ) list1 = probs.split(,) list2 =
I have this function...
def predict(): probs = input("Input list of prediction probabilities: ") thresh = input("Input threshold value: ") list1 = probs.split(",") list2 = [] answer = 0 for i in list1: if i < thresh: answer = 0 else: answer = 1 list2.append(answer) print("Model Predictions: ", list2)
I do not want to have to ask for the inputs in the function. I want it to be like this...but i am not sure how to do that. I have the values but do i put those within the function or do i do that after I call it.
def predict(probs, thresh):
probs = 0.886,0.375,0.174,0.817,0.574,0.319,0.812,0.314,0.098,0.741,0.847,0.202,0.31,0.073,0.179,0.917,0.64,0.388,0.116,0.72 thresh = 0.5 predict(probs, thresh)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
