{ "cells": [ { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n" ] }, { "cell_type": "code", "execution_count": 87, "metadata": {}, "outputs": [], "source": [ "df=pd.read_csv(\"new_pcos_dataset.csv\")\n" ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | PCOS (Y/N) | \n", "Follicle No. (R) | \n", "Follicle No. (L) | \n", "Skin darkening (Y/N) | \n", "hair growth(Y/N) | \n", "Weight gain(Y/N) | \n", "Cycle length(days) | \n", "AMH(ng/mL) | \n", "Fast food (Y/N) | \n", "Cycle(R/I) | \n", "FSH/LH | \n", "PRL(ng/mL) | \n", "Pimples(Y/N) | \n", "Age (yrs) | \n", "BMI | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "0 | \n", "3 | \n", "3 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "2.07 | \n", "1.0 | \n", "0 | \n", "2.160326 | \n", "45.16 | \n", "0 | \n", "28 | \n", "19.3 | \n", "
| 1 | \n", "0 | \n", "5 | \n", "3 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "1.53 | \n", "0.0 | \n", "0 | \n", "6.174312 | \n", "20.09 | \n", "0 | \n", "36 | \n", "24.9 | \n", "
| 2 | \n", "1 | \n", "15 | \n", "13 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "6.63 | \n", "1.0 | \n", "0 | \n", "6.295455 | \n", "10.52 | \n", "1 | \n", "33 | \n", "25.3 | \n", "
| 3 | \n", "0 | \n", "2 | \n", "2 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "1.22 | \n", "0.0 | \n", "0 | \n", "3.415254 | \n", "36.90 | \n", "0 | \n", "37 | \n", "29.7 | \n", "
| 4 | \n", "0 | \n", "4 | \n", "3 | \n", "0 | \n", "0 | \n", "0 | \n", "5 | \n", "2.26 | \n", "0.0 | \n", "0 | \n", "4.422222 | \n", "30.09 | \n", "0 | \n", "25 | \n", "20.1 | \n", "
LogisticRegression(max_iter=1000, random_state=0)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
LogisticRegression(max_iter=1000, random_state=0)
GridSearchCV(cv=StratifiedKFold(n_splits=10, random_state=0, shuffle=True),\n",
" estimator=LogisticRegression(random_state=0), n_jobs=-1,\n",
" param_grid={'C': [0.01, 0.1, 1.0, 10.0],\n",
" 'class_weight': ['balanced'],\n",
" 'max_iter': [100, 200, 300],\n",
" 'penalty': ['l1', 'l2', 'elasticnet'],\n",
" 'solver': ['liblinear', 'saga']},\n",
" scoring='f1_weighted')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. GridSearchCV(cv=StratifiedKFold(n_splits=10, random_state=0, shuffle=True),\n",
" estimator=LogisticRegression(random_state=0), n_jobs=-1,\n",
" param_grid={'C': [0.01, 0.1, 1.0, 10.0],\n",
" 'class_weight': ['balanced'],\n",
" 'max_iter': [100, 200, 300],\n",
" 'penalty': ['l1', 'l2', 'elasticnet'],\n",
" 'solver': ['liblinear', 'saga']},\n",
" scoring='f1_weighted')LogisticRegression(C=0.1, class_weight='balanced', random_state=0,\n",
" solver='liblinear')LogisticRegression(C=0.1, class_weight='balanced', random_state=0,\n",
" solver='liblinear')LogisticRegression(C=0.1, class_weight='balanced', random_state=0,\n",
" solver='liblinear')In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. LogisticRegression(C=0.1, class_weight='balanced', random_state=0,\n",
" solver='liblinear')