Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

Commit 22f34d9

Browse files
committed
Update P2-example.ipynb
1 parent 9fdc22e commit 22f34d9

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

P2-example.ipynb

-13
Original file line numberDiff line numberDiff line change
@@ -248,24 +248,13 @@
248248
" ids = list(ids.flatten())\n",
249249
" \n",
250250
" regression = LinearRegression()\n",
251-
"# regression = ElasticNet(alpha=1e-3)\n",
252251
"\n",
253252
" X_subtrain = X_train[ids]\n",
254253
" y_subtrain = y_train[ids]\n",
255254
" \n",
256255
" def transform(X):\n",
257256
" grade = np.array([avg_price_by_grade[g - 3] for g in X['grade']])\n",
258257
" \n",
259-
"# return np.vstack([\n",
260-
"# np.log(X['sqft_basement'] + 1),\n",
261-
"# np.log(X['sqft_above'] + 1),\n",
262-
"# np.log(grade + 1),\n",
263-
"# np.log(grade * X['sqft_lot'] + 1),\n",
264-
"# np.log(X['waterfront'] + 1),\n",
265-
"# np.log(X['condition'] * X['sqft_living'] + 1),\n",
266-
"# (X['yr_built'] >= 2012)\n",
267-
"# ]).T \n",
268-
"\n",
269258
" return np.vstack([\n",
270259
" X['sqft_basement'],\n",
271260
" X['sqft_above'],\n",
@@ -283,8 +272,6 @@
283272
" \n",
284273
" y_predict.append(y[0])\n",
285274
" \n",
286-
"print((np.abs(y_test - y_predict)/y_test).mean())\n",
287-
" \n",
288275
"with open('y_solution.csv', 'w') as out:\n",
289276
" print('Id,Price', file=out)\n",
290277
" for pair in enumerate(y_predict, 1):\n",

0 commit comments

Comments
 (0)