Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Data Programming with Python
In this set of exercises we will fit some regression models and create a stepwise AIC function. As
we learnt in lectures to fit a regression model, we need to create a DataFrame X and Series y.
X should contain the standardised version of all of the explanatory/ exogenous variables and y
should contain the standardised version of the response/ endogenous variable. To fit the intercept,
X must have an additional column of ones.
Each question asks you to write a function with a specific set of input arguments. The .py template
defines the function name and inputs for each question, do not change these. Be sure you test
your functions before you submit your code to make sure that they are outputting the correct
answer. Unless otherwise stated, all functions must have a return value. This week you should test
your code using both the prostate and diamonds datasets. Testing your functions with multiple
datasets should catch any error related to leaving the DataFrame names inside your function.
Include the import statements for all packages used within your code. Additionally, please include
the package prefixes (pd, np, etc.) for functions/methods from these packages, even if the command
runs in Canopy without the prefix.