Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Calculate the mean of the values in x _ train and y _ train, storing the resulting values in variables named mean _ x and
Calculate the mean of the values in xtrain and ytrain, storing the resulting values in variables named meanx and
meany You may use the sum function, as well as the variable ntrain that you defined earlier in the notebook.
Print the results with text output as shown below. Round the displayed value of meanx to decimal places, and round
the displayed value of meany to decimal places. Do not round the actual values stored within the variables
themselves, just the values displayed.
Mean of X xxxx
Mean of Y xxxx
We will now work toward calculating the variance of the values of in the training set as well as the variance of the values
of in the training set. The variance is a measure of how dispersed, or spread out, observations of a particular variable are.
We will calculate the desired variances by first calculating an intermediate result. Specifically, we will calculate the sum of
squared deviations for and which are denoted by and respectively. Formulas for these quantities are
provided below. We will use these values again in later parts of this project.
Create a markdown cell with unformatted text explaining that we will now be calculating and
Calculate and storing the results in variables named Sxx and Syy You will need to use a loop to perform this
task. For the sake of efficient memory usage, you should not create any additional lists when performing these
calculations.
Print the results with text output as shown below. Round the displayed value of Sxx to decimal places and round the
displayed value of Syy to decimal places. Do not round the actual values stored within the variables themselves, just
the values displayed.
Sxx xxxx
Syy xxxx
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started