Question: Question 4 / Vraag 4 You have a dataset containing 4 measured parameters of wine, namely acidity, sugar, sulphates and alcohol content. Each wine also

Question 4/Vraag 4
You have a dataset containing 4 measured
parameters of wine, namely acidity, sugar,
sulphates and alcohol content. Each wine also
has a quality score between 0 and 10, based on
a professional tasting You wish to use muitiple
linear regression to predict the score of a wine,
for a given set of these parameters.
(a) The first wine in the dataset has
{7.4,1.9,0.56,9.4} for the four pa-
rameters listed above. It has a quality
score of 5. The second wine in the dataset
has {11.2,1.9,0.58,9.8} for the same
parameters, and has a quality score of 6.
Write down the design matrix x(includ-
ing a bias term) and the target vector y for
just these two data points.
(b) Next, you read 4000 wines' data into the
design matrix. In your Python program
this is stored as a matrix variable X. You
have also read all the target values into
the vector variable y. Write Python-like
pseudocode to show how you would use
the normal equation to solve for the co-
efficients of the linear regression, w. It is
not necessary to write syntactically cor-
rect Python code, but it should be clear
from your solution what you are trying to
do.
(c) Assume that, after performing multiple
linear regression, you find that hat(w)=
{16.7,0.284,-0.518,-3.63,-0.727}. You
are given a new wine that has parameters
{6,1.9,0.57,9.5}. What would the pre-
dicted quality score for this wine be?
U het 'n datastel wat 4 gemete parameters vas
wyn beval, naamlik suurvlak, suiker, sulfate en
alkeholinhoud. Elke wyn het ook 'n kwaliteits -
punt tussen 0 en 10, gebaseet op 'is professio-
nele proesessie. U wil veelvuldige linere regres-
sie gebrulk om die kwaliteitspunt van 'n wyn te
voorspel, vir 'n gegewe stel van hierdie parame-
ters.
(a) Die cerste wyn in die datastel het
(7.4,1.9,0.56,9.4} vir die vier para-
meters wat hierbo gelys is. Dit het 'n
kwaliteitspunt van 5. Die tweede wyn in
die datastel het {11.2,1.9,0.58,9.8} vir
dieselfde parameters, en het 'n kwaliteits-
punt van 6. Skryf die ontwerpsmatriks X
(Instuitende die afsetterm) en die teiken-
vektor y vir net hierdie twee datapunte
nees.
(b) Volgende lees 44000 wyne se data in die
ontwerpsmatriks in. In u Python-program
word dit gestoor as 'n matriksverander-
like x. U het ook al die teikenwaardes in-
gelees in die vektorveranderlike y. Skryf
Python-styl-pseudokode om te wys hoe u
die normaalvergelyking sou gebruik om
op te los vir die koffisiente van die line-
re regressie, hat(w). Dit is nie nodig om sin-
takties korrekte Python-kode te skryf nie,
maar die moet duidelik wees vanuit u op-
lossing wat u probeer regkry.
(c) Aanvaar dat i na afloop van die
linere regressie vind dat hat(w)*=
16.7,0.284,-0.518,-3.63,-0.727.
U word 'n nuwe wyn gegee met para-
meters {6,1.9,0.57,9.5}. Wat sou die
voorspelde kwaliteitspunt vir hierdie wyn
wees?
 Question 4/Vraag 4 You have a dataset containing 4 measured parameters

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!