{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "9d886526-550c-4b67-a9c1-83613f61f07e", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "id": "1d970e00-fb12-483c-90e1-877a97c7c746", "metadata": {}, "outputs": [], "source": [ "df = sns.load_dataset('iris')" ] }, { "cell_type": "code", "execution_count": 3, "id": "a4fafaaa-de34-4989-a807-c4564eab15ab", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | sepal_length | \n", "sepal_width | \n", "petal_length | \n", "petal_width | \n", "species | \n", "
---|---|---|---|---|---|
0 | \n", "5.1 | \n", "3.5 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "
1 | \n", "4.9 | \n", "3.0 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "
2 | \n", "4.7 | \n", "3.2 | \n", "1.3 | \n", "0.2 | \n", "setosa | \n", "
3 | \n", "4.6 | \n", "3.1 | \n", "1.5 | \n", "0.2 | \n", "setosa | \n", "
4 | \n", "5.0 | \n", "3.6 | \n", "1.4 | \n", "0.2 | \n", "setosa | \n", "
\n", " | sepal_length | \n", "sepal_width | \n", "petal_length | \n", "petal_width | \n", "
---|---|---|---|---|
count | \n", "150.000000 | \n", "150.000000 | \n", "150.000000 | \n", "150.000000 | \n", "
mean | \n", "5.843333 | \n", "3.057333 | \n", "3.758000 | \n", "1.199333 | \n", "
std | \n", "0.828066 | \n", "0.435866 | \n", "1.765298 | \n", "0.762238 | \n", "
min | \n", "4.300000 | \n", "2.000000 | \n", "1.000000 | \n", "0.100000 | \n", "
25% | \n", "5.100000 | \n", "2.800000 | \n", "1.600000 | \n", "0.300000 | \n", "
50% | \n", "5.800000 | \n", "3.000000 | \n", "4.350000 | \n", "1.300000 | \n", "
75% | \n", "6.400000 | \n", "3.300000 | \n", "5.100000 | \n", "1.800000 | \n", "
max | \n", "7.900000 | \n", "4.400000 | \n", "6.900000 | \n", "2.500000 | \n", "
\n", " | sepal_length | \n", "sepal_width | \n", "petal_length | \n", "petal_width | \n", "
---|---|---|---|---|
sepal_length | \n", "1.000000 | \n", "-0.117570 | \n", "0.871754 | \n", "0.817941 | \n", "
sepal_width | \n", "-0.117570 | \n", "1.000000 | \n", "-0.428440 | \n", "-0.366126 | \n", "
petal_length | \n", "0.871754 | \n", "-0.428440 | \n", "1.000000 | \n", "0.962865 | \n", "
petal_width | \n", "0.817941 | \n", "-0.366126 | \n", "0.962865 | \n", "1.000000 | \n", "
GridSearchCV(cv=5, estimator=LogisticRegression(),\n", " param_grid={'C': [10, 20, 30, 40, 50], 'max_iter': [100, 200, 300],\n", " 'penalty': ['l1', 'l2', 'elasticnet']},\n", " scoring='accuracy')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GridSearchCV(cv=5, estimator=LogisticRegression(),\n", " param_grid={'C': [10, 20, 30, 40, 50], 'max_iter': [100, 200, 300],\n", " 'penalty': ['l1', 'l2', 'elasticnet']},\n", " scoring='accuracy')
LogisticRegression()
LogisticRegression()