Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lab2 #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/lab2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 26 additions & 27 deletions correlation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"brainFrame = pd.read_csv(?, delimiter='\\t')"
"brainFrame = pd.read_csv('titanic.csv', delimiter=',')"
]
},
{
Expand All @@ -102,7 +102,7 @@
"metadata": {},
"outputs": [],
"source": [
"brainFrame.?()"
"brainFrame.head()"
]
},
{
Expand All @@ -118,7 +118,7 @@
"metadata": {},
"outputs": [],
"source": [
"brainFrame.head(?)"
"brainFrame.head(10)"
]
},
{
Expand All @@ -134,7 +134,7 @@
"metadata": {},
"outputs": [],
"source": [
"?"
"brainFrame.tail(8)"
]
},
{
Expand All @@ -159,7 +159,7 @@
"metadata": {},
"outputs": [],
"source": [
"brainFrame.?()"
"brainFrame.describe()"
]
},
{
Expand All @@ -176,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -195,12 +195,12 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"menDf = brainFrame[?]\n",
"womenDf = brainFrame[?]"
"menDf = brainFrame[brainFrame['Sex'] == 'male']\n",
"womenDf = brainFrame[brainFrame['Sex'] == 'female']"
]
},
{
Expand Down Expand Up @@ -244,11 +244,10 @@
"source": [
"# Ячейка для кода № 7\n",
"# Постройка графика диаграммы рассеяния для кадра данных с женскими записями\n",
"womenMeanSmarts = ???\n",
"plt.scatter(???)\n",
"\n",
"#\n",
"#"
"womenMeanSmarts =womenDf[[\"PIQ\", \"FSIQ\", \"VIQ\"]].mean(axis=1)\n",
"plt.scatter(womenMeanSmarts, womenDf[\"MRI_Count\"])\n",
"plt.show()\n",
"%matplotlib inline\n"
]
},
{
Expand All @@ -272,7 +271,7 @@
"metadata": {},
"outputs": [],
"source": [
"brainFrame.?(method='pearson')"
"brainFrame.corr(method='pearson')"
]
},
{
Expand All @@ -286,7 +285,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(ответ)"
" Корреляция переменной с самой собой всегда равна 1, потому что это полная линейная зависимость"
]
},
{
Expand All @@ -300,7 +299,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(ответ)"
"Корреляция между переменными A и B также равна корреляции между переменными B и A"
]
},
{
Expand All @@ -316,7 +315,7 @@
"metadata": {},
"outputs": [],
"source": [
"womenDf.?(method='pearson')"
"womenDf.corr(method='pearson')"
]
},
{
Expand All @@ -332,7 +331,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Используйте corr() для расчёта критерия корреляции Пирсона для кадра данных с мужчинами\n"
"menDf.corr(method='pearson')\n"
]
},
{
Expand Down Expand Up @@ -404,10 +403,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Ячейка для кода № 14\n",
"mcorr = ???\n",
"#\n",
"#"
"import seaborn as sns\n",
"\n",
"mcorr = menDf.corr()\n",
"sns.heatmap(wcorr)"
]
},
{
Expand All @@ -421,7 +420,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(ответ)"
"Это означает, что между этими переменными нет линейной зависимости"
]
},
{
Expand All @@ -435,7 +434,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"(ответ)"
"Для удобного анализа"
]
},
{
Expand Down Expand Up @@ -470,7 +469,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
Loading