Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have to create a loop that makes predictons. if the value is less than the threshold value the prediciton should be 0. If the

I have to create a loop that makes predictons. if the value is less than the threshold value the prediciton should be 0. If the threshold value is greater than the prediction should be 1. this is what i have but it isnt coming out right.

The predictions are = 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

threshold = 0.5

def predict(): probs = input("Input list of prediction probabilities: ") thresh = input("Input threshold value: ") list1 = probs.split(",") list2 = [] answer = [] for i in list1: if i < thresh: answer == 0 elif i > thresh: answer == 1 preds = list2.append(answer) print("Model Predictions: ", preds)

this is what i have but it is not working

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

5 The mechanics of the circular flow model.

Answered: 1 week ago

Question

1 The difference between a command system and a market system.

Answered: 1 week ago

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago