Skip to content

Commit

Permalink
chore: fix flaky HyperOpt NB (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamilton723 authored Apr 10, 2024
1 parent 8e4f326 commit d30d57b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/Explore Algorithms/Hyperparameter Tuning/HyperOpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from sklearn.datasets import fetch_california_housing"
"from sklearn.datasets import fetch_california_housing\n",
"import time"
]
},
{
Expand All @@ -157,7 +158,12 @@
"metadata": {},
"outputs": [],
"source": [
"california = fetch_california_housing()\n",
"try:\n",
" california = fetch_california_housing()\n",
"except EOFError:\n",
" print(\"Encountered EOFError while downloading, retrying once...\")\n",
" time.sleep(5)\n",
" california = fetch_california_housing()\n",
"\n",
"feature_cols = [\"f\" + str(i) for i in range(california.data.shape[1])]\n",
"header = [\"target\"] + feature_cols\n",
Expand Down

0 comments on commit d30d57b

Please sign in to comment.