Skip to content

Commit 7cffe56

Browse files
authored
Merge pull request #39 from jGaboardi/01_blacken_repo
Format repo with `black`
2 parents 4e675c7 + a979556 commit 7cffe56

File tree

12 files changed

+4544
-1174
lines changed

12 files changed

+4544
-1174
lines changed

notebooks/Binomial_GLM.ipynb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
21-
"#Load sample dataset - Subset of london house price dataset\n",
22-
"db = ps.open(ps.get_path('columbus.dbf'),'r')\n",
21+
"# Load sample dataset - Subset of london house price dataset\n",
22+
"db = ps.open(ps.get_path(\"columbus.dbf\"), \"r\")\n",
2323
"\n",
2424
"#Set dependent variable\n",
2525
"y = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,\n",
@@ -73,12 +73,14 @@
7373
"metadata": {},
7474
"outputs": [],
7575
"source": [
76-
"#Estimate Binomial GLM\n",
76+
"# Estimate Binomial GLM\n",
7777
"\n",
78-
"#First instantiate a GLM model object\n",
79-
"model = GLM(y, X, family=Binomial()) #Set family to Binomial family object for Binomial GLM\n",
78+
"# First instantiate a GLM model object\n",
79+
"model = GLM(\n",
80+
" y, X, family=Binomial()\n",
81+
") # Set family to Binomial family object for Binomial GLM\n",
8082
"\n",
81-
"#Then use the fit method to estimate coefficients and compute diagnostics\n",
83+
"# Then use the fit method to estimate coefficients and compute diagnostics\n",
8284
"results = model.fit()"
8385
]
8486
},
@@ -96,7 +98,7 @@
9698
}
9799
],
98100
"source": [
99-
"#Estimated prameters, intercept is always the first column on the left\n",
101+
"# Estimated prameters, intercept is always the first column on the left\n",
100102
"print(results.params)"
101103
]
102104
},
@@ -114,7 +116,7 @@
114116
}
115117
],
116118
"source": [
117-
"#Parameter standard errors\n",
119+
"# Parameter standard errors\n",
118120
"print(results.bse)"
119121
]
120122
},
@@ -132,7 +134,7 @@
132134
}
133135
],
134136
"source": [
135-
"#Parameter t-values\n",
137+
"# Parameter t-values\n",
136138
"print(results.tvalues)"
137139
]
138140
},
@@ -150,7 +152,7 @@
150152
}
151153
],
152154
"source": [
153-
"#Model AIC\n",
155+
"# Model AIC\n",
154156
"print(results.aic)"
155157
]
156158
}
@@ -176,5 +178,5 @@
176178
}
177179
},
178180
"nbformat": 4,
179-
"nbformat_minor": 1
181+
"nbformat_minor": 4
180182
}

notebooks/Gaussian_GLM.ipynb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
20-
"#Load sample dataset - columbus dataset \n",
21-
"db = ps.open(ps.get_path('columbus.dbf'),'r')\n",
20+
"# Load sample dataset - columbus dataset\n",
21+
"db = ps.open(ps.get_path(\"columbus.dbf\"), \"r\")\n",
2222
"\n",
23-
"#Set dependent variable\n",
23+
"# Set dependent variable\n",
2424
"y = np.array(db.by_col(\"HOVAL\"))\n",
25-
"y = np.reshape(y, (49,1))\n",
25+
"y = np.reshape(y, (49, 1))\n",
2626
"\n",
27-
"#Set indepdent varibLES\n",
27+
"# Set indepdent varibLES\n",
2828
"X = []\n",
2929
"X.append(db.by_col(\"INC\"))\n",
3030
"X.append(db.by_col(\"CRIME\"))\n",
@@ -37,12 +37,14 @@
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
40-
"#Estimate Gaussian GLM\n",
40+
"# Estimate Gaussian GLM\n",
4141
"\n",
42-
"#First instantiate a GLM model object\n",
43-
"model = GLM(y, X) #Gaussian is the default family parameter so it doesn't need to be set\n",
42+
"# First instantiate a GLM model object\n",
43+
"model = GLM(\n",
44+
" y, X\n",
45+
") # Gaussian is the default family parameter so it doesn't need to be set\n",
4446
"\n",
45-
"#Then use the fit method to estimate coefficients and compute diagnostics\n",
47+
"# Then use the fit method to estimate coefficients and compute diagnostics\n",
4648
"results = model.fit()"
4749
]
4850
},
@@ -60,7 +62,7 @@
6062
}
6163
],
6264
"source": [
63-
"#Estimated prameters, intercept is always the first column on the left\n",
65+
"# Estimated prameters, intercept is always the first column on the left\n",
6466
"print(results.params)"
6567
]
6668
},
@@ -78,7 +80,7 @@
7880
}
7981
],
8082
"source": [
81-
"#Parameter standard errors\n",
83+
"# Parameter standard errors\n",
8284
"print(results.bse)"
8385
]
8486
},
@@ -96,7 +98,7 @@
9698
}
9799
],
98100
"source": [
99-
"#Parameter t-values\n",
101+
"# Parameter t-values\n",
100102
"print(results.tvalues)"
101103
]
102104
},
@@ -114,7 +116,7 @@
114116
}
115117
],
116118
"source": [
117-
"#Model AIC\n",
119+
"# Model AIC\n",
118120
"print(results.aic)"
119121
]
120122
}

notebooks/Poisson_GLM.ipynb

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"metadata": {},
1919
"outputs": [],
2020
"source": [
21-
"#Load sample dataset - columbus dataset \n",
22-
"db = ps.open(ps.get_path('columbus.dbf'),'r')\n",
21+
"# Load sample dataset - columbus dataset\n",
22+
"db = ps.open(ps.get_path(\"columbus.dbf\"), \"r\")\n",
2323
"\n",
24-
"#Set dependent variable\n",
24+
"# Set dependent variable\n",
2525
"y = np.array(db.by_col(\"HOVAL\"))\n",
26-
"y = np.reshape(y, (49,1))\n",
27-
"#Round dependent variable and convert to integer for the example since Poisson is for discrete data\n",
26+
"y = np.reshape(y, (49, 1))\n",
27+
"# Round dependent variable and convert to integer for the example since Poisson is for discrete data\n",
2828
"y = np.round(y).astype(int)\n",
2929
"\n",
30-
"#Set indepdent varibLES\n",
30+
"# Set indepdent varibLES\n",
3131
"X = []\n",
3232
"X.append(db.by_col(\"INC\"))\n",
3333
"X.append(db.by_col(\"CRIME\"))\n",
@@ -40,12 +40,14 @@
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
43-
"#Estimate Poisson GLM\n",
43+
"# Estimate Poisson GLM\n",
4444
"\n",
45-
"#First instantiate a GLM model object\n",
46-
"model = GLM(y, X, family=Poisson()) #Set family to Poisson family object for Poisson GLM\n",
45+
"# First instantiate a GLM model object\n",
46+
"model = GLM(\n",
47+
" y, X, family=Poisson()\n",
48+
") # Set family to Poisson family object for Poisson GLM\n",
4749
"\n",
48-
"#Then use the fit method to estimate coefficients and compute diagnostics\n",
50+
"# Then use the fit method to estimate coefficients and compute diagnostics\n",
4951
"results = model.fit()"
5052
]
5153
},
@@ -63,7 +65,7 @@
6365
}
6466
],
6567
"source": [
66-
"#Estimated prameters, intercept is always the first column on the left\n",
68+
"# Estimated prameters, intercept is always the first column on the left\n",
6769
"print(results.params)"
6870
]
6971
},
@@ -81,7 +83,7 @@
8183
}
8284
],
8385
"source": [
84-
"#Parameter standard errors\n",
86+
"# Parameter standard errors\n",
8587
"print(results.bse)"
8688
]
8789
},
@@ -99,7 +101,7 @@
99101
}
100102
],
101103
"source": [
102-
"#Parameter t-values\n",
104+
"# Parameter t-values\n",
103105
"print(results.tvalues)"
104106
]
105107
},
@@ -117,7 +119,7 @@
117119
}
118120
],
119121
"source": [
120-
"#Model AIC\n",
122+
"# Model AIC\n",
121123
"print(results.aic)"
122124
]
123125
}

spglm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '1.0.8'
1+
__version__ = "1.0.8"
22

33
from . import glm
44
from . import family

0 commit comments

Comments
 (0)