ssrosa / ds-reg-int

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scenario: Broken Student Code

A student comes to you with the following notebook while learning about regression. They can't get the code to work. Fix the code, and use this as an opportunity to teach them about the causes of (and solutions to) any underlying mistakes.

At minimum, you should get the regression to run, and then help them interpret the results. The interviewer will also walk through some follow-up questions, which may require further code to answer.

import pandas as pd
import numpy as np
np.random.seed(0)
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import statsmodels.api as sm
df = pd.read_csv('interview_dataset.csv')
target = df.target
predictors = df.drop('target', axis=1, inplace=False)
regression_model = sm.OLS(target, predictors)

About

License:Other


Languages

Language:Jupyter Notebook 100.0%