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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!