Question: I have this function that takes probabilty values and one threshold value. I need to make another function that takes a list of threshold values
I have this function that takes probabilty values and one threshold value. I need to make another function that takes a list of threshold values and loops through each one and print a list for the 5 different list of preds.
thresh = [0.00, 0.25, 0.50, 0.75, 1.00]
def predict(probs, thresh): preds = [] answer = 0 for i in probs: if i < thresh: answer = 0 else: answer = 1 preds.append(answer) return(preds)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
