An Introduction to Statistical Learning: with Applications in R (Springer Texts in Statistics)
13th Edition
ISBN: 9781461471370
Author: Gareth James
Publisher: SPRINGER NATURE CUSTOMER SERVICE
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 3, Problem 4E
a.
Explanation of Solution
Relationship between X and Y being linear
- Without knowing more details about the training data, it is difficult to know which training RSS is lower between linear or cubic...
b.
Explanation of Solution
Relationship between X and Y being linear
- In this case the test RSS depends upon the test data, so we have not enough information to conclude...
c.
Explanation of Solution
Relationship between X and Y being non-linear
- Polynomial regression has lower train RSS than the linear fit because of higher flexibility...
d.
Explanation of Solution
Relationship between X and Y being non-linear
- There is not enough information to tell which test RSS would be lower for either regression given the problem statement is defined as not knowing “how far it is from linear”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
We create a simple regression model and call the
fit function as follows:
Im=LinearRegression()
Im.fit(X,Y)
in a multilinear model we proceed in the same
way:
mlm=LinearRegression()
mlm.fit(Z,Y)
How does the linear regression model knows if we
are doing a simple or multiple linear regression?
Answer:
"When conducting a binary regression with
a skewed predictor, it is often easiest to
assess the need for x and log(x) by including
them both in the model so that their relative
contributions can be assessed directly."
Show that indeed the log odds are a
function of x and log(x) for the gamma
distribution.
Now suppose that you have two versions of your model with different parameters(e.g., different regularization) or even different model families (e.g., logistic regression versus random forest). Which one is better?
Chapter 3 Solutions
An Introduction to Statistical Learning: with Applications in R (Springer Texts in Statistics)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- In R, write a function that produces plots of statistical power versus sample size for simple linear regression. The function should be of the form LinRegPower(N,B,A,sd,nrep), where N is a vector/list of sample sizes, B is the true slope, A is the true intercept, sd is the true standard deviation of the residuals, and nrep is the number of simulation replicates. The function should conduct simulations and then produce a plot of statistical power versus the sample sizes in N for the hypothesis test of whether the slope is different than zero. B and A can be vectors/lists of equal length. In this case, the plot should have separate lines for each pair of A and B values (A[1] with B[1], A[2] with B[2], etc). The function should produce an informative error message if A and B are not the same length. It should also give an informative error message if N only has a single value. Demonstrate your function with some sample plots. Find some cases where power varies from close to zero to near…arrow_forwardYou run a logistic regression model in R using the glm() function. The dependent variable is the factor variable Y and independent variables are X1 and X2 (in other words, the formula is Y~X1+X2). In the model output, the coefficient of the constant term is a0, the coefficient of X1 is a1, and the coefficient of X2 is a2. Assuming a cutoff = 0.5, which of the following defines the equation of a decision boundary? a0 + a1X1 + a2X2 = 0.5 exp(-(a0 + a1X1 + a2X2)) = 0 a0 + a1X1 + a2X2 = 0 O exp(-(a0 + a1X1 + a2X2)) = 0.5arrow_forwardThe following are all benefits of generalized additive models (GAMS), EXCEPT: GAMS are less computationally demanding than linear regression. GAMS can model non-linear relationships that standard linear regression will miss. GAMS can potentially make more accurate predictions of the response than linear regression can. One can examine the effect of each predictor on the response individually while holding all of the other predictors fixed.arrow_forward
- Consider a linear regression setting. Given a model's weights W E RD, we incorporate regularisation into the loss function by adding an la regularisation function of the form-W;|*. Select all true statements from below. a. When q = 1, a solution to this problem tends to be sparse. I.e., most weights are driven to zero with only a few weights that are not close to zero. b. When q = 2, a solution to this problem tends to be sparse. I.e., most weights are driven to zero with only a few weights that are not close to zero. c. When q = 1, the problem can be solved analytically as in closed form. d. When q = 2, the problem can be solved analytically as in closed form.arrow_forwardYou have been hired by the European Space Agency to build a model that predicts the amount of oxygen that an astronaut consumes when performing five minutes of intense physical work. The descriptive features for the model will be the age of the astronaut and their average heart rate throughout the work. The regression model is OXYCON = w[0] + w[1] × AGE + w[2] × HEARTRATEarrow_forwardDevelop a simple linear regression model (univariate model) using gradient descent method for experience-salary datasets as it is shown on the following table. Once you got the model, check how close the predicted values against the ground truth and calculate the total error (mean square error) and the accuracy R^2.arrow_forward
- Question 1: In class we went over the derivation for linear regression on the white board. Starting with = the step where you have E (Y – XW)¹ (Y – XW) write the derivation to get to the step W = (XTX)-¹XTY. Explain the math used in each step.arrow_forwardSay that you have the following initial settings for binary logistic regression: x = [1, 1, 3] w = [0, -2, 0.75] b = 0.5 2. Given that x's label is 1, what is the value of w_1, w_2, and w_3 at time t + 1 if the learning rate is 1? For this problem, you may ignore the issue of updating the bias term. 3. What is the value of P(y = 1 | x) given your updated weights from the previous question? 4. Given that x's label is 1, what is the value of the bias term at time t + 1 if the learning rate is 1? 5. What is the value of P(y = 1 | x) given both your updated weights and your updated bias term? 6. Given that x's label is 0, what is the value of P(y = 0| x) at time t + 1 if the learning rate is 0.1? Round your answer to the nearest 1000th as a number [0, 1].arrow_forwardIn linear regression, 8 tells us how meaningful the corresponding x is in predicting the output. This means, ...... O if a particular 8-value is very small compared to others, the corresponding x plays a little role in predicting the output. O if a particular 8-value is very large compared to others, the corresponding x plays a little role in predicting the output.arrow_forward
- This is a binary classification problem, y has two values (0 or 1), and X (feature) has three dimensions. • Use a logistic regression model to project X to y (classify X into two categories: 0 or 1). • The initialization is: w1 = 0, w2 = 0, w3 = 0, b = 0, Learning rate is 2. • You must use Gradient Descent for logistic regression in this question. • The regression should stop after one iteration. Calculation process and formulas must be included in your answer! You must answer this question by manual calculation, but not programming.arrow_forwardFor logistic regression, the gradient of the cost function is given by J(0) = (i) E (he (x) – y')x;). Write down mathematical expression(s) for the correct m gradient descent update for logistic regression with a learning rate of a. (In the expression, he(x^) should be replaced by the sigmoid function.)arrow_forwardSuppose you are running gradient descent to fit a logistic regression model with 0 E R+1, Which of the following is a reasonable way to make sure the learning rate c is set properly and that gradient descent is running correctly? Plot J(0) as a function of 0 and make sure it is convex. O b. Plot J(8) as a function of 0 and make sure it is decreasing on every iteration. O* Plot /(0) = -E [y®logho(x") + (1 – y®) log (1 – ħø(x"))] a a function of the number of iterations and make sure J(0) is decreasing on every iteration. O d. Plot J(8) =E(h,(x®) – y®)² as a function of the number of iterations (i.e. the horizontal axis is the iteration number) and make sure J(8) is decreasing on every iteration.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education