small.csv X1,X2,Y S,-0.1,19.19 S,2.53,22.74 S,4.86,23.91 M,0.26,7.07 M,2.55,7.93 M,4.87,8.93 L,0.08,20.63 L,2.62,23.46 L,5.09,25.75 __MACOSX/._small.csv part2.csv Month,Year,sales January,2012,...

1 answer below »
pdf format


small.csv X1,X2,Y S,-0.1,19.19 S,2.53,22.74 S,4.86,23.91 M,0.26,7.07 M,2.55,7.93 M,4.87,8.93 L,0.08,20.63 L,2.62,23.46 L,5.09,25.75 __MACOSX/._small.csv part2.csv Month,Year,sales January,2012, February,2012, March,2012, April,2012, May,2012, June,2012, July,2012, August,2012, September,2012,1.71 October,2012,1.9 November,2012,2.74 December,2012,4.2 January,2013,1.45 February,2013,1.8 March,2013,2.03 April,2013,1.99 May,2013,2.32 June,2013,2.2 July,2013,2.13 August,2013,2.43 September,2013,1.9 October,2013,2.13 November,2013,2.56 December,2013,4.16 January,2014,2.31 February,2014,1.89 March,2014,2.02 April,2014,2.23 May,2014,2.39 June,2014,2.14 July,2014,2.27 August,2014,2.21 September,2014,1.89 October,2014,2.29 November,2014,2.83 December,2014,4.04 January,2015,2.31 February,2015,1.99 March,2015,2.42 April,2015,2.45 May,2015,2.57 June,2015,2.42 July,2015,2.4 August,2015,2.5 September,2015,2.09 October,2015,2.54 November,2015,2.97 December,2015,4.35 January,2016,2.56 February,2016,2.28 March,2016,2.69 April,2016,2.48 May,2016,2.73 June,2016,2.37 July,2016,2.31 August,2016,2.23 September,2016, October,2016, November,2016, December,2016, __MACOSX/._part2.csv categoricals.pptx CATEGORICAL VARIABLES -ENCODING- 1 We will use data visualization To understand the results of regression models with a categorical variable And to show the model performance EXAMPLES Example 1 EXAMPLES Consider the following dataset Numerical Categorical Predictors – EXAMPLE X1X2Y S-0.1019.19 S2.5322.74 S4.8623.91 M0.267.07 M2.557.93 M4.878.93 L0.0820.63 L2.6223.46 L5.0925.75 Increase size of table numbers 4 Consider the following dataset LABEL ENCODING X1X2Y S-0.1019.19 S2.5322.74 S4.8623.91 M0.267.07 M2.557.93 M4.878.93 L0.0820.63 L2.6223.46 L5.0925.75 X1X2Y 0-0.1019.19 02.5322.74 04.8623.91 10.267.07 12.557.93 14.878.93 20.0820.63 22.6223.46 25.0925.75 Numerical Categorical Predictors – EXAMPLE 5 X1 and X2 in the model as continuous variables R2 is close to 0.05, the explained variation of the response about the fitted equation is negligible The Adjusted R-squared is negative and equal to -0.23632 Both predictors X1 and X2 seem not to be useful for predicting Y. Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 15.1678 5.6816 2.670 0.037 * x1 0.6019 3.4742 0.173 0.868 x2 0.7769 1.4275 0.544 0.606 Residual standard error: 8.505 on 6 degrees of freedom Multiple R-squared: 0.05259, Adjusted R-squared: -0.2632 F-statistic: 0.1665 on 2 and 6 DF, p-value: 0.8504 Numerical Categorical Predictors – EXAMPLE X1 and X2 in the model as continuous variables Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 15.1678 5.6816 2.670 0.037 * x1 0.6019 3.4742 0.173 0.868 x2 0.7769 1.4275 0.544 0.606 Residual standard error: 8.505 on 6 degrees of freedom Multiple R-squared: 0.05259, Adjusted R-squared: -0.2632 F-statistic: 0.1665 on 2 and 6 DF, p-value: 0.8504 Numerical Categorical Predictors – EXAMPLE 7 X1 and X2 in the model as continuous variables Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 15.1678 5.6816 2.670 0.037 * x1 0.6019 3.4742 0.173 0.868 x2 0.7769 1.4275 0.544 0.606 Residual standard error: 8.505 on 6 degrees of freedom Multiple R-squared: 0.05259, Adjusted R-squared: -0.2632 F-statistic: 0.1665 on 2 and 6 DF, p-value: 0.8504 Numerical Categorical Predictors – EXAMPLE 8 The fitted plane is 0.7769 X2 Numerical Categorical Predictors – EXAMPLE Replace X1 with binary variables X11 and X12 ONE-HOT ENCODING X11X12X2Y 00-0.1019.19 002.5322.74 004.8623.91 100.267.07 102.557.93 104.878.93 010.0820.63 012.6223.46 015.0925.75 X1X2Y S-0.1019.19 S2.5322.74 S4.8623.91 M0.267.07 M2.557.93 M4.878.93 L0.0820.63 L2.6223.46 L5.0925.75 Numerical Categorical Predictors – EXAMPLE 10 . Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 19.9650 0.5802 34.413 3.90e-07 *** x11 -14.0760 0.6703 -20.998 4.54e-06 *** x12 1.1974 0.6705 1.786 0.13418 x2 0.8155 0.1378 5.920 0.00196 ** Residual standard error: 0.8207 on 5 degrees of freedom Multiple R-squared: 0.9926, Adjusted R-squared: 0.9882 F-statistic: 225 on 3 and 5 DF, p-value: 9.416e-06 Numerical Categorical Predictors – EXAMPLE Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 19.9650 0.5802 34.413 3.90e-07 *** x11 -14.0760 0.6703 -20.998 4.54e-06 *** x12 1.1974 0.6705 1.786 0.13418 x2 0.8155 0.1378 5.920 0.00196 ** Residual standard error: 0.8207 on 5 degrees of freedom Multiple R-squared: 0.9926, Adjusted R-squared: 0.9882 F-statistic: 225 on 3 and 5 DF, p-value: 9.416e-06 Numerical Categorical Predictors – EXAMPLE The fitted equations for each level are Numerical Categorical Predictors – EXAMPLE What encoding is better? Numerical Categorical Predictors – EXAMPLE LABEL ENCODING ONE-HOT ENCODING X11X12X2Y 00-0.1019.19 002.5322.74 004.8623.91 100.267.07 102.557.93 104.878.93 010.0820.63 012.6223.46 015.0925.75 X1X2Y 0-0.1019.19 02.5322.74 04.8623.91 10.267.07 12.557.93 14.878.93 20.0820.63 22.6223.46 25.0925.75 Numerical Categorical Predictors – EXAMPLE 15 LABEL ONE-HOT ENCODINGENCODING R-squared0.052590.9926 Adjusted R-squared: -0.26320.9882 Numerical Categorical Predictors – EXAMPLE 16 Why are the models different? Numerical Categorical Predictors – EXAMPLE Label encoding prediction equation 0.7769 X2 One-hot encoding prediction equations Numerical Categorical Predictors – EXAMPLE label encoding results in a regression plane one-hot encoding results in a set of regression lines (one for each category of the categorical variable) Numerical Categorical Predictors – EXAMPLE If the observations are close to a plane then label encoding and one-hot encoding results are good Numerical Categorical Predictors – EXAMPLE With a large number of variables in the model it is not possible to have a display like this We may relay on R2 or cross-validation error to choose the best model Numerical Categorical Predictors – EXAMPLE Example 2 Forecasting Consider the following demand data EXAMPLE 2 Increase size of table numbers 23 Consider the following demand data EXAMPLE 2 Increase size of table numbers 24 Wide format to long format EXAMPLE 2 Increase size of table numbers 25 Model 1 Linear Regression Use linear regression predict sales using time as predictor EXAMPLE 2 Increase size of table numbers 27 EXAMPLE 2 – LINEAR REGRESION MODEL 1 Increase size of table numbers 28 sales vs Period EXAMPLE 2 – LINEAR REGRESION MODEL 1 Increase size of table numbers 29 Model 2 Categorical variable and label encoding predict sales using Year and Month EXAMPLE 2 – MODEL 2 Increase size of table numbers 31 predict sales using Year and Month label encode Month EXAMPLE 2 – MODEL 2 Increase size of table numbers 32 predict sales using Year and Month label encode Month EXAMPLE 2 – MODEL 2 Increase size of table numbers 33 predict sales using Year and Month label encode Month EXAMPLE 2 – MODEL 2 Increase size of table numbers 34 predict sales using Year and Month label encode Month model sales using Year and Period (both numeric) EXAMPLE 2 – MODEL 2 Increase size of table numbers 35 EXAMPLE 2 – MODEL 2 Increase size of table numbers 36 sales vs Year and Period EXAMPLE 2 – MODEL 2 Increase size of table numbers 37 Model 3 Categorical variable and one-hot encoding predict sales using Year and Month one-hot encode Month EXAMPLE 2 – MODEL 3 Increase size of table numbers 39 EXAMPLE 2 – MODEL 3 Increase size of table numbers 40 sales vs Year and Month EXAMPLE 2 – MODEL 3 Increase size of table numbers 41 __MACOSX/._categoricals.pptx Day 6.docx Day 6: Assignment  Submit Assignment · Submitting a file upload · File Types pdf, doc, and docx Instructions Write and run the code developed in class to predict the total sales from file sales.csv and submit the jupyter notebook in pdf format. Submission Click on the blue button in the top right corner to submit your assignment.    Click Next (below) to progress through the course. Rubric Assignment Rubric Assignment Rubric Criteria Ratings Pts This criterion is linked to a Learning OutcomeCoding 60.0 to >30.0 pts Full Marks No coding errors 30.0 to >20.0 pts No Marks More than three coding errors 20.0 to >0 pts Partial Marks One to three coding errors 60.0 pts This criterion is linked to a Learning OutcomeFormat & Editing 40.0 to >20.0 pts Full Marks Code is clear and easy to follow. Plots display effective visualization.
Answered Same DayMay 26, 2021

Answer To: small.csv X1,X2,Y S,-0.1,19.19 S,2.53,22.74 S,4.86,23.91 M,0.26,7.07 M,2.55,7.93 M,4.87,8.93...

Kshitij answered on May 28 2021
136 Votes
day-6archive-qu3zg0my-gk010hyi/.ipynb_checkpoints/Day6-checkpoint.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# importing libraires \n",
"import pandas as pd\n",
"import numpy as np\n",
"from matplotlib import pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Example 1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
X1X2Y
0S-0.1019.19
1S2.5322.74
2S4.8623.91
3M0.267.07
4M2.557.93
\n",
"
"
],
"text/plain": [
" X1 X2 Y\n",
"0 S -0.10 19.19\n",
"1 S 2.53 22.74\n",
"2 S 4.86 23.91\n",
"3 M 0.26 7.07\n",
"4 M 2.55 7.93"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#loading small data\n",
"df = pd.read_csv('small.csv')\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 93,
"metadata": {},
"outputs": [],
"source": [
"# loading the statsmodel library \n",
"import statsmodels.formula.api as smf\n",
"import statsmodels.api as sm\n",
"from sklearn.preprocessing import LabelEncoder"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# sklearn's label encoder\n",
"labelencoder = LabelEncoder()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
X1X2Y
02-0.1019.19
122.5322.74
224.8623.91
310.267.07
412.557.93
514.878.93
600.0820.63
702.6223.46
805.0925.75
\n",
"
"
],
"text/plain": [
" X1 X2 Y\n",
"0 2 -0.10 19.19\n",
"1 2 2.53 22.74\n",
"2 2 4.86 23.91\n",
"3 1 0.26 7.07\n",
"4 1 2.55 7.93\n",
"5 1 4.87 8.93\n",
"6 0 0.08 20.63\n",
"7 0 2.62 23.46\n",
"8 0 5.09 25.75"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# encoding of labels\n",
"df['X1'] = labelencoder.fit_transform(df['X1'])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"X = df[['X1', 'X2']] \n",
"y = df['Y']"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\kaush\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\numpy\\core\\fromnumeric.py:2542: FutureWarning: Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.\n",
" return ptp(axis=axis, out=out, **kwargs)\n",
"c:\\users\\kaush\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\scipy\\stats\\stats.py:1535: UserWarning: kurtosistest only valid for n>=20 ... continuing anyway, n=9\n",
" \"anyway, n=%i\" % int(n))\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
" \n",
"\n",
"
OLS Regression Results
Dep. Variable: Y R-squared: 0.053
Model: OLS Adj. R-squared: -0.263
Method: Least Squares F-statistic: 0.1665
Date: Thu, 28 May 2020 Prob (F-statistic): 0.850
Time: 05:12:53 Log-Likelihood: -30.212
No. Observations: 9 AIC: 66.42
Df Residuals: 6 BIC: 67.02
Df Model: 2
Covariance Type:nonrobust
\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
coefstd errtP>|t|[0.0250.975]
const 16.3716 5.831 2.808 0.031 2.104 30.639
X1 -0.6019 3.474 -0.173 0.868 -9.103 7.899
X2 0.7769 1.428 0.544 0.606 -2.716 4.270
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
Omnibus: 3.603 Durbin-Watson: 0.961
Prob(Omnibus): 0.165 Jarque-Bera (JB): 1.553
Skew:-0.704 Prob(JB): 0.460
Kurtosis: 1.530 Cond. No. 7.65


Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified."
],
"text/plain": [
"\n",
"\"\"\"\n",
" OLS Regression Results \n",
"==============================================================================\n",
"Dep. Variable: Y R-squared: 0.053\n",
"Model: OLS Adj. R-squared: -0.263\n",
"Method: Least Squares F-statistic: 0.1665\n",
"Date: Thu, 28 May 2020 Prob (F-statistic): 0.850\n",
"Time: 05:12:53 Log-Likelihood: -30.212\n",
"No. Observations: 9 AIC: 66.42\n",
"Df Residuals: 6 BIC: 67.02\n",
"Df Model: 2 \n",
"Covariance Type: nonrobust \n",
"==============================================================================\n",
" coef std err t P>|t| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"const 16.3716 5.831 2.808 0.031 2.104 30.639\n",
"X1 -0.6019 3.474 -0.173 0.868 -9.103 7.899\n",
"X2 0.7769 1.428 0.544 0.606 -2.716 4.270\n",
"==============================================================================\n",
"Omnibus: 3.603 Durbin-Watson: 0.961\n",
"Prob(Omnibus): 0.165 Jarque-Bera (JB): 1.553\n",
"Skew: -0.704 Prob(JB): 0.460\n",
"Kurtosis: 1.530 Cond. No. 7.65\n",
"==============================================================================\n",
"\n",
"Warnings:\n",
"[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
"\"\"\""
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# fitting our model and printing the summery.\n",
"X = sm.add_constant(X)\n",
"model = sm.OLS(y, X).fit()\n",
"model.summary()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# part 2"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# one hot coding for our labels\n",
"df = pd.concat([df,pd.get_dummies(df['X1'], prefix='X1',drop_first=True)],axis=1).drop(['X1'],axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
X2YX1_1X1_2
0-0.1019.1901
12.5322.7401
24.8623.9101
30.267.0710
42.557.9310
54.878.9310
60.0820.6300
72.6223.4600
85.0925.7500
\n",
"
"
],
"text/plain": [
" X2 Y X1_1 X1_2\n",
"0 -0.10 19.19 0 1\n",
"1 2.53 22.74 0 1\n",
"2 4.86 23.91 0 1\n",
"3 0.26 7.07 1 0\n",
"4 2.55 7.93 1 0\n",
"5 4.87 8.93 1 0\n",
"6 0.08 20.63 0 0\n",
"7 2.62 23.46 0 0\n",
"8 5.09 25.75 0 0"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"X = df[['X1_1', 'X1_2','X2']] \n",
"y = df['Y']"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
" \n",
"\n",
"
OLS Regression Results
Dep. Variable: Y R-squared: 0.993
Model: OLS Adj. R-squared: 0.988
Method: Least Squares F-statistic: 225.0
Date: Thu, 28 May 2020 Prob (F-statistic): 9.42e-06
Time: 05:12:53 Log-Likelihood: -8.3472
No. Observations: 9 AIC: 24.69
Df Residuals: 5 BIC: 25.48
Df Model: 3
Covariance Type:nonrobust
\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
coefstd errtP>|t|[0.0250.975]
const 21.1624 0.594 35.645 0.000 19.636 22.689
X1_1 -15.2734 0.670 -22.792 0.000 -16.996 -13.551
X1_2 -1.1974 0.671 -1.786 0.134 -2.921 0.526
X2 0.8155 0.138 5.920 0.002 0.461 1.170
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
Omnibus: 0.672 Durbin-Watson: 1.798
Prob(Omnibus): 0.715 Jarque-Bera (JB): 0.529
Skew: 0.003 Prob(JB): 0.768
Kurtosis: 1.812 Cond. No. 11.4


Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified."
],
"text/plain": [
"\n",
"\"\"\"\n",
" OLS Regression Results \n",
"==============================================================================\n",
"Dep. Variable: Y R-squared: 0.993\n",
"Model: OLS Adj. R-squared: 0.988\n",
"Method: Least Squares F-statistic: 225.0\n",
"Date: Thu, 28 May 2020 Prob (F-statistic): 9.42e-06\n",
"Time: 05:12:53 Log-Likelihood: -8.3472\n",
"No. Observations: 9 AIC: 24.69\n",
"Df Residuals: 5 BIC: 25.48\n",
"Df Model: 3 \n",
"Covariance Type: nonrobust \n",
"==============================================================================\n",
" coef std err t P>|t| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"const 21.1624 0.594 35.645 0.000 19.636 22.689\n",
"X1_1 -15.2734 0.670 -22.792 0.000 -16.996 -13.551\n",
"X1_2 -1.1974 0.671 -1.786 0.134 -2.921 0.526\n",
"X2 0.8155 0.138 5.920 0.002 0.461 1.170\n",
"==============================================================================\n",
"Omnibus: 0.672 Durbin-Watson: 1.798\n",
"Prob(Omnibus): 0.715 Jarque-Bera (JB): 0.529\n",
"Skew: 0.003 Prob(JB): 0.768\n",
"Kurtosis: 1.812 Cond. No. 11.4\n",
"==============================================================================\n",
"\n",
"Warnings:\n",
"[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
"\"\"\""
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# again fiting data but with one hot coded labels\n",
"X = sm.add_constant(X)\n",
"model2 = sm.OLS(y, X).fit()\n",
"model2.summary()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Example 2"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
MonthYearsales
0January2012NaN
1February2012NaN
2March2012NaN
3April2012NaN
4May2012NaN
\n",
"
"
],
"text/plain": [
" Month Year sales\n",
"0 January 2012 NaN\n",
"1 February 2012 NaN\n",
"2 March 2012 NaN\n",
"3 April 2012 NaN\n",
"4 May 2012 NaN"
]
},
"execution_count": 62,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# loading data for second part\n",
"df = pd.read_csv('part2.csv')\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [],
"source": [
"# gnearting period data \n",
"k=list(range(1, len(df.Month)+1))"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
MonthYearsalesPeriod
0January2012NaN1
1February2012NaN2
2March2012NaN3
3April2012NaN4
4May2012NaN5
\n",
"
"
],
"text/plain": [
" Month Year sales Period\n",
"0 January 2012 NaN 1\n",
"1 February 2012 NaN 2\n",
"2 March 2012 NaN 3\n",
"3 April 2012 NaN 4\n",
"4 May 2012 NaN 5"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[\"Period\"]=k\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [],
"source": [
"# formulating our model based on data frame column names \n",
"mod = smf.ols(formula='sales ~ Period', data=df)"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [],
"source": [
"# fitting our model\n",
"res = mod.fit()"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
" \n",
"\n",
"
OLS Regression Results
Dep. Variable:sales R-squared: 0.044
Model: OLS Adj. R-squared: 0.023
Method: Least Squares F-statistic: 2.121
Date: Thu, 28 May 2020 Prob (F-statistic): 0.152
Time: 05:32:38 Log-Likelihood: -42.960
No. Observations: 48 AIC: 89.92
Df Residuals: 46 BIC: 93.66
Df Model: 1
Covariance Type:nonrobust
\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
coefstd errtP>|t|[0.0250.975]
Intercept 2.1355 0.223 9.590 0.000 1.687 2.584
Period 0.0092 0.006 1.456 0.152 -0.004 0.022
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
Omnibus:34.103 Durbin-Watson: 1.733
Prob(Omnibus): 0.000 Jarque-Bera (JB): 71.518
Skew: 2.147 Prob(JB): 2.95e-16
Kurtosis: 7.161 Cond. No. 90.2


Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified."
],
"text/plain": [
"\n",
"\"\"\"\n",
" OLS Regression Results \n",
"==============================================================================\n",
"Dep. Variable: sales R-squared: 0.044\n",
"Model: OLS Adj. R-squared: 0.023\n",
"Method: Least Squares F-statistic: 2.121\n",
"Date: Thu, 28 May 2020 Prob (F-statistic): 0.152\n",
"Time: 05:32:38 Log-Likelihood: -42.960\n",
"No. Observations: 48 AIC: 89.92\n",
"Df Residuals: 46 BIC: 93.66\n",
"Df Model: 1 \n",
"Covariance Type: nonrobust \n",
"==============================================================================\n",
" coef std err t P>|t| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"Intercept 2.1355 0.223 9.590 0.000 1.687 2.584\n",
"Period 0.0092 0.006 1.456 0.152 -0.004 0.022\n",
"==============================================================================\n",
"Omnibus: 34.103 Durbin-Watson: 1.733\n",
"Prob(Omnibus): 0.000 Jarque-Bera (JB): 71.518\n",
"Skew: 2.147 Prob(JB): 2.95e-16\n",
"Kurtosis: 7.161 Cond. No. 90.2\n",
"==============================================================================\n",
"\n",
"Warnings:\n",
"[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
"\"\"\""
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# summery\n",
"res.summary()"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {},
"outputs": [],
"source": [
"# predicting our sales based on period\n",
"prediction = res.predict(df['Period'])\n",
"df['Prediction']=prediction"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
MonthYearsalesPeriodPrediction
0January2012NaN12.144635
1February2012NaN22.153814
2March2012NaN32.162992
3April2012NaN42.172170
4May2012NaN52.181348
\n",
"
"
],
"text/plain": [
" Month Year sales Period Prediction\n",
"0 January 2012 NaN 1 2.144635\n",
"1 February 2012 NaN 2 2.153814\n",
"2 March 2012 NaN 3 2.162992\n",
"3 April 2012 NaN 4 2.172170\n",
"4 May 2012 NaN 5 2.181348"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmQAAAE9CAYAAACleH4eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOzdd1yV5f/H8dd1DnvLUEAQEJEtIEtTs6wcuRo23CBmZnvXt9Ky+v5s7zRz4KosG5rasrRsyFIciAMnihMFFURE798fYN80VFTgPofzeT4ePL7guc+539D5nvM5131dn0tpmoYQQgghhNCPQe8AQgghhBCWTgoyIYQQQgidSUEmhBBCCKEzKciEEEIIIXQmBZkQQgghhM6kIBNCCCGE0JmVXif29PTUAgMD9Tq9EEIIIUSd5eTkHNQ0zauhHl+3giwwMJDs7Gy9Ti+EEEIIUWdK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TvDuLwW4O9qQ0qlxt80xZz169KBHjx5n/VtCQgIvvfTSv449M3oGEBsby2+//favY37//fd6z2gOpCATQghh8ZRS/PfmaErKT/L8t+tp5mhD/9iWescSFkTaXgghhBCAldHAuwPjSA5y59HPV/PrpgN6RxIWRAoyIYQQooadtZGPhycQ0sKZ0bNyWLXzsN6RhIWQgkwIIYT4Bxc7a2aMSMTL2ZbU9CwK9h/VO5KwAFKQCSGEEOdo7mzHrLQkrAwGhk7NpKjkuN6RRBMnBZkQQghRiwAPR2aMSORYRRVDp2ZwuKxS70iiCdOtICs+dkKvUwshhBB1EunrysfDEyg8fJzU9CzKTlTpHcnkGI1GYmNjiYqK4rbbbqO8vPyyH2vZsmX06dMHgAULFjBhwoTzHltSUsKHH374989FRUX/akBrTnQryIpKK/hlwz69Ti+EEELUSYfWHrw3MI41u0q4Z85KKqtO6x3JpNjb25Obm8u6deuwsbH514bgmqZx+vSl/8369evHU089dd7bzy3IfH19mTdv3iWfx1ToesnyhW/XU3HylJ4RhBBCiIvqEenNhFva8dumAzz2xWpOn9b0jmSSunTpQkFBAdu3byc8PJwxY8bQvn17CgsL+fHHH+nYsSPt27fntttu49ixYwB8//33hIWF0blzZ7766qu/Hys9PZ377rsPgH379nHzzTcTExNDTEwMf/75J0899RRbtmwhNjaWxx9/nO3btxMVFQVARUUFqampREdHExcXx9KlS/9+zFtuuYWePXsSEhLCE0880ch/ofPTtSDbUVzOlOVb9YwgzMD+IxXy4ieE0N3tif482TOMBauLGL9wPZomr0v/VFVVxXfffUd0dDQAGzduZNiwYaxatQpHR0deeukllixZwsqVK0lISODNN9+koqKCu+66i2+//Zbly5ezd+/eWh/7gQceoGvXrqxevZqVK1cSGRnJhAkTCA4OJjc3l9dee+2s4z/44AOgelunTz/9lOHDh/+9wXlubi5z585l7dq1zJ07l8LCwgb8q9Sdbp36DUrRK8qb95cWcHN7P1q62esVRZiwE1Wn6PLqUm6IaMG7d8ZhMJjnpr9CiKZhdNfWFB87wZTft+HhaMP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aqXevLRDrUClr6GuiBhbLA8BzgHKrkDtqHqpNy/tUC8VvoYScDMwu1h1OvBoydDe10rq29UKp1A79PYI8HDxmAuMoXau0/ri5/7dfucp4BXgDWqd4wxqHWOidnLdznk+VYw/D1jY7fcvo9Z1r6PkisNWeDQ7L8DHgDXUruRYCZybOwcNzst44KfFPGuAa4Au66W+vLRDvVSVk/fMOZluV4B1cq3Um5d2qJUq80LtirqHur2Grqa4Iq6T66XevLRDvVT5GgIOBu4t5rqH2se1/a4V79QvSZKUmXfqlyRJysyGTJIkKTMbMkmSpMxsyCRJkjKzIZMkScrMhkxSy4ua+yLirG7rzo+IO3LGJUlV8bYXktpCRBxJ7a7YxwKDqd1H6MyU0pP9mLMrpbS9ohAlqc9syCS1jYj4BrCF2g0rN6eUroiIC4E/BYYCDwAXp5R2RMRial9pshdwQ0ppYTHHRuDvgTOBq1JKN2Z4KpL0/3TlDkCSemEBtTuBvw3MKo6afQT4QEppe9GEXUDtO/cuTSm9Unyd1NKI+EFKaedXnGxJKZ2c4wlIUhkbMkltI6W0JSJuAN5IKb0VEWcAJwAral9Vx17AM8XwT0TEH1H7OzeR2lfB7GzIbmhu5JK0ZzZkktrNjuIBEMB1KaXLuw+IiKnAZ4ATU0qvRsS/AcO7DdnSlEglqU5eZSmpnd0NnB8RYwEiYkxEHATsA2wGXo+ICcCcjDFKUo88QiapbaWU/jciFgB3R8Qg4B3g08AKah9PrgY2APfni1KSeuZVlpIkSZn5kaUkSVJmNmSSJEmZ2ZBJkiRlZkMmSZKUmQ2ZJElSZjZkkiRJmdmQSZIkZWZDJkmSlNn/AcVemUjaPPU0AAAAAElFTkSuQmCC\n",
"text/plain": [
"
"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# ploting the prediction and sales with respect to year. \n",
"df.plot(x='Year', y=['sales', 'Prediction'], figsize=(10,5))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# model using year and period "
]
},
{
"cell_type": "code",
"execution_count": 75,
"metadata": {},
"outputs": [],
"source": [
"# now formulating our model on period and year as predictors and sales as target\n",
"mod = smf.ols(formula='sales ~ Period + Year', data=df)"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {},
"outputs": [],
"source": [
"# fitting our model\n",
"res = mod.fit()"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"\n",
"\n",
" \n",
"\n",
"
OLS Regression Results
Dep. Variable:sales R-squared: 0.343
Model: OLS Adj. R-squared: 0.314
Method: Least Squares F-statistic: 11.75
Date: Thu, 28 May 2020 Prob (F-statistic): 7.86e-05
Time: 05:42:34 Log-Likelihood: -33.960
No. Observations: 48 AIC: 73.92
Df Residuals: 45 BIC: 79.53
Df Model: 2
Covariance Type:nonrobust
\n",
"\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
coefstd errtP>|t|[0.0250.975]
Intercept 2325.9544 513.588 4.529 0.000 1291.534 3360.374
Period 0.1075 0.022 4.807 0.000 0.062 0.153
Year -1.1553 0.255 -4.525 0.000 -1.670 -0.641
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
Omnibus:12.873 Durbin-Watson: 1.313
Prob(Omnibus): 0.002 Jarque-Bera (JB): 13.627
Skew: 1.076 Prob(JB): 0.00110
Kurtosis: 4.478 Cond. No. 1.41e+07


Warnings:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
[2] The condition number is large, 1.41e+07. This might indicate that there are
strong multicollinearity or other numerical problems."
],
"text/plain": [
"\n",
"\"\"\"\n",
" OLS Regression Results \n",
"==============================================================================\n",
"Dep. Variable: sales R-squared: 0.343\n",
"Model: OLS Adj. R-squared: 0.314\n",
"Method: Least Squares F-statistic: 11.75\n",
"Date: Thu, 28 May 2020 Prob (F-statistic): 7.86e-05\n",
"Time: 05:42:34 Log-Likelihood: -33.960\n",
"No. Observations: 48 AIC: 73.92\n",
"Df Residuals: 45 BIC: 79.53\n",
"Df Model: 2 \n",
"Covariance Type: nonrobust \n",
"==============================================================================\n",
" coef std err t P>|t| [0.025 0.975]\n",
"------------------------------------------------------------------------------\n",
"Intercept 2325.9544 513.588 4.529 0.000 1291.534 3360.374\n",
"Period 0.1075 0.022 4.807 0.000 0.062 0.153\n",
"Year -1.1553 0.255 -4.525 0.000 -1.670 -0.641\n",
"==============================================================================\n",
"Omnibus: 12.873 Durbin-Watson: 1.313\n",
"Prob(Omnibus): 0.002 Jarque-Bera (JB): 13.627\n",
"Skew: 1.076 Prob(JB): 0.00110\n",
"Kurtosis: 4.478 Cond. No. 1.41e+07\n",
"==============================================================================\n",
"\n",
"Warnings:\n",
"[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
"[2] The condition number is large, 1.41e+07. This might indicate that there are\n",
"strong multicollinearity or other numerical problems.\n",
"\"\"\""
]
},
"execution_count": 78,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# summery\n",
"res.summary()"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {},
"outputs": [],
"source": [
"# predicting the sales based on period and year. \n",
"prediction2 = res.predict(df[['Period','Year']])\n",
"df['Prediction2']=prediction2"
]
},
{
"cell_type": "code",
"execution_count": 83,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
MonthYearsalesPeriodPredictionPrediction2
0January2012NaN12.1446351.550586
1February2012NaN22.1538141.658089
2March2012NaN32.1629921.765593
3April2012NaN42.1721701.873097
4May2012NaN52.1813481.980600
\n",
"
"
],
"text/plain": [
" Month Year sales Period Prediction Prediction2\n",
"0 January 2012 NaN 1 2.144635 1.550586\n",
"1 February 2012 NaN 2 2.153814 1.658089\n",
"2 March 2012 NaN 3 2.162992 1.765593\n",
"3 April 2012 NaN 4 2.172170 1.873097\n",
"4 May 2012 NaN 5 2.181348 1.980600"
]
},
"execution_count": 83,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 84,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 84,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png":...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here