mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
Rename scipy.stats.reciprocal with loguniform, fixes #44
This commit is contained in:
@@ -2186,10 +2186,10 @@
|
||||
],
|
||||
"source": [
|
||||
"from sklearn.model_selection import RandomizedSearchCV\n",
|
||||
"from scipy.stats import reciprocal, uniform\n",
|
||||
"from scipy.stats import loguniform, uniform\n",
|
||||
"\n",
|
||||
"param_distrib = {\n",
|
||||
" \"svc__gamma\": reciprocal(0.001, 0.1),\n",
|
||||
" \"svc__gamma\": loguniform(0.001, 0.1),\n",
|
||||
" \"svc__C\": uniform(1, 10)\n",
|
||||
"}\n",
|
||||
"rnd_search_cv = RandomizedSearchCV(svm_clf, param_distrib, n_iter=100, cv=5,\n",
|
||||
@@ -2472,12 +2472,12 @@
|
||||
"source": [
|
||||
"from sklearn.svm import SVR\n",
|
||||
"from sklearn.model_selection import RandomizedSearchCV\n",
|
||||
"from scipy.stats import reciprocal, uniform\n",
|
||||
"from scipy.stats import loguniform, uniform\n",
|
||||
"\n",
|
||||
"svm_clf = make_pipeline(StandardScaler(), SVR())\n",
|
||||
"\n",
|
||||
"param_distrib = {\n",
|
||||
" \"svr__gamma\": reciprocal(0.001, 0.1),\n",
|
||||
" \"svr__gamma\": loguniform(0.001, 0.1),\n",
|
||||
" \"svr__C\": uniform(1, 10)\n",
|
||||
"}\n",
|
||||
"rnd_search_cv = RandomizedSearchCV(svm_clf, param_distrib,\n",
|
||||
|
||||
Reference in New Issue
Block a user