Answered step by step
Verified Expert Solution
Question
1 Approved Answer
from sklearn.linear _ model import LinearRegression regr = LinearRegression ( ) regr.fit ( genre _ dummies, gross [ ' inflation _ adjusted _ gross' ]
from sklearn.linearmodel import LinearRegression
regr LinearRegression
regr.fitgenredummies, grossinflationadjustedgross'
action regr.intercept
adventure regr.coef
printaction adventure
Next, we will compute confidence intervals for the intercept and coefficients. The confidence intervals for the intercept and coefficient means that the intervals have a probability of to contain the true value and coefficient respectively. If there is a significant relationship between a given genre and the adjusted gross, the confidence interval of its coefficient should exclude We will calculate the confidence intervals using the pairs bootstrap method.
# Import a module
import numpy as np
# Create an array of indices to sample from
inds #CODE HERE
# Initialize replicate arrays
size
bsactionreps #CODE HERE
bsadventurereps #CODE HERE
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