Question: from sklearn.linear _ model import LinearRegression regr = LinearRegression ( ) regr.fit ( genre _ dummies, gross [ ' inflation _ adjusted _ gross' ]

from sklearn.linear_model import LinearRegression
regr = LinearRegression()
regr.fit(genre_dummies, gross['inflation_adjusted_gross'])
action = regr.intercept_
adventure = regr.coef_[[0]][0]
print((action, adventure))
Next, we will compute 95% confidence intervals for the intercept and coefficients. The 95% confidence intervals for the intercept and coefficient means that the intervals have a probability of 95% 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 0. 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 500 replicate arrays
size =500
bs_action_reps =...#CODE HERE
bs_adventure_reps =...#CODE HERE

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!