# To add a new markdown cell, type '# %% [markdown]'
# %% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting
"from sklearn.metrics import matthews_corrcoef as mcc, make_scorer, auc, precision_score\n",
"\n",
"def create_param_grid(params):\n",
" keys, values = zip(*params.items())\n",
" experiments = [dict(zip(keys, v)) for v in itertools.product(*values)]\n",
" grid = dict([(i, d) for i, d in enumerate(experiments)])\n",
" return(grid)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(2445, 512)\n",
"Done preprocessing\n",
"(2445, 512) (2445, 512)\n",
"Remove correlated\n",
"(2445, 512) (2445, 512)\n",
"Done univariate\n",
"(2445, 512) (2445, 512)\n",
"{'C': 0.001, 'kernel': 'linear'}\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/utente/anaconda3/envs/dappertf/lib/python3.6/site-packages/sklearn/utils/deprecation.py:66: DeprecationWarning: Class Imputer is deprecated; Imputer was deprecated in version 0.20 and will be removed in 0.22. Import impute.SimpleImputer from sklearn instead.\n",
/home/utente/anaconda3/envs/dappertf/lib/python3.6/site-packages/sklearn/utils/deprecation.py:66: DeprecationWarning: Class Imputer is deprecated; Imputer was deprecated in version 0.20 and will be removed in 0.22. Import impute.SimpleImputer from sklearn instead.