Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please include code where asked to write code and codes output screenshot. Please include code where asked to write code and code's output screenshot. 1-

Please include code where asked to write code and codes output screenshot. image text in transcribed
image text in transcribed
image text in transcribed
Please include code where asked to write code and code's output screenshot. 1- Say you want to write python code that calculates x modulo y wherex and y are two integer variables. Then it assigns the value of y to x and the modulo result to y. It also prints the values of x and y. A python code segment (one line) with a missing line is given below. Write that missing line. x=200y=100#Missinglineprint((fx:{x},y:{y}) 2- You are given with a string variable x= "Hello World". Write a python code segment that prints "eoo" 3- Consider the following python code to print integer number from 0 to 10 . for j in range (0,10) print(j) This code has some issues, mention those issues. 4- Write a python code that takes an integer from a keyboard (denoted by variable x ). If the number is less than 99 and even, your program calculates its factorial (x !) and prints the factorial value in your screen. If the number is less than 99 and is odd, your program prints, "this is an odd number". If the number isgreater than 99 , it prints "the number is too big". 5- Consider you have the set of data comprising the heights (in meters) ofa group of people and their corresponding weights (in kg ) given in Table 1. Table 1: Height and actual weight. a. Using python, plot a chart/graph height vs weight. x-axis should be "height in m" and y-axis should be "Weights in Kgs. b. From your plotted chart/graph, do you see any correlation between the weights and the heights for this group of people? If yes, mention what kind of correlation you observe. c. Now say you want to use the data in the table and predict the weight of another person based on his/her height that is given to you. In order to do so, one option is that you draw 6-a straight line through the points in your plotted graph and use that line to predict the weight of another person given his/her height. This is called linear regression which is a linear approach for modelling the relationship between a scalar dependent variable of Y ("weight" in this case) and one or more explanatory variables (or independent variables, X ) which is "height" in this case. In order to draw a straight line, you can use the equation: Y=aX+b. Assuming values for a=103 and b=104, using Python plot a straight line in the same chart/graph height vs weight that you plotted for Question a. d. Using Y=aX+b where a=103 and b=104, predict weights (Y) corresponding to following heights (X) and fill in column 2 of Table 2 given below. Table 2: Height vs predicted weights e. Do you observe any error i.e., the difference between actual weight in Table 1 and predicted weight in Table 2 for given heights in Table 1 ? Write down errors for each height given in Table 1. If you use another set of values of a and b, what is your opinion about the errors? Will they be changed or not? If like, you can check by repeating Questions d) and e) with another set of values of a and b

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

Step: 3

blur-text-image

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

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

More Books

Students also viewed these Databases questions

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago