{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "id": "FP8Kp96zuRU0" }, "outputs": [], "source": [ "from sklearn.model_selection import RandomizedSearchCV, train_test_split, KFold\n", "from sklearn.preprocessing import StandardScaler\n", "from sklearn.linear_model import Ridge\n", "from sklearn.pipeline import Pipeline\n", "import pandas as pd\n", "import numpy as np\n", "from math import floor\n", "from collections import namedtuple as NamedTuple" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 190 }, "id": "GCbKPkDP_Fra", "outputId": "f3cbedc6-1e64-4595-d54f-803cb586eaab" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "RandomizedSearchCV(cv=KFold(n_splits=5, random_state=42, shuffle=True),\n", " estimator=Pipeline(steps=[('standard_scaler',\n", " StandardScaler()),\n", " ('ridge', Ridge())]),\n", " n_iter=150,\n", " param_distributions={'ridge__alpha': array([0.001, 0.012, 0.023, 0.034, 0.045, 0.056, 0.067, 0.078, 0.089,\n", " 0.1 ]),\n", " 'ridge__max_iter': [5000, 10000]},\n", " random_state=42)" ], "text/html": [ "
RandomizedSearchCV(cv=KFold(n_splits=5, random_state=42, shuffle=True),\n",
" estimator=Pipeline(steps=[('standard_scaler',\n",
" StandardScaler()),\n",
" ('ridge', Ridge())]),\n",
" n_iter=150,\n",
" param_distributions={'ridge__alpha': array([0.001, 0.012, 0.023, 0.034, 0.045, 0.056, 0.067, 0.078, 0.089,\n",
" 0.1 ]),\n",
" 'ridge__max_iter': [5000, 10000]},\n",
" random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. RandomizedSearchCV(cv=KFold(n_splits=5, random_state=42, shuffle=True),\n",
" estimator=Pipeline(steps=[('standard_scaler',\n",
" StandardScaler()),\n",
" ('ridge', Ridge())]),\n",
" n_iter=150,\n",
" param_distributions={'ridge__alpha': array([0.001, 0.012, 0.023, 0.034, 0.045, 0.056, 0.067, 0.078, 0.089,\n",
" 0.1 ]),\n",
" 'ridge__max_iter': [5000, 10000]},\n",
" random_state=42)Pipeline(steps=[('standard_scaler', StandardScaler()),\n",
" ('ridge', Ridge(alpha=np.float64(0.1), max_iter=5000))])StandardScaler()
Ridge(alpha=np.float64(0.1), max_iter=5000)