diff --git a/public/Buttons/21aib05 prasanna/code.html b/public/Buttons/21aib05 prasanna/code.html new file mode 100644 index 000000000..4940753f7 --- /dev/null +++ b/public/Buttons/21aib05 prasanna/code.html @@ -0,0 +1,10 @@ + + + + Animated Button + + + + + + \ No newline at end of file diff --git a/public/Buttons/21aib05 prasanna/style.css b/public/Buttons/21aib05 prasanna/style.css new file mode 100644 index 000000000..2b0ee6b09 --- /dev/null +++ b/public/Buttons/21aib05 prasanna/style.css @@ -0,0 +1,26 @@ +.animated-button { + background-color: #0051ff; + border: none; + color: rgb(255, 0, 0); + padding: 10px 20px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + transition-duration: 0.4s; +} + +.animated-button:hover { + background-color: rgb(138, 51, 51); + color: #5900ff; + box-shadow: 0 0 20px #ff00ff; +} + +.animated-button:active { + background-color: #d0ff00; + color: rgb(0, 247, 255); + transform: translateY(2px); + box-shadow: 0 0 10px #ff00aa; +} diff --git a/z_test_21aib05.ipynb b/z_test_21aib05.ipynb new file mode 100644 index 000000000..a0b3ed7e2 --- /dev/null +++ b/z_test_21aib05.ipynb @@ -0,0 +1,638 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "authorship_tag": "ABX9TyP7dql9lzww47RjB0wh3EMG", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "T2lWKhJ4HiZa", + "outputId": "23ec173b-c722-400f-f800-4068904acd94" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "mean=110.44 stdv=2.20\n", + "Reject Null Hypothesis\n" + ] + } + ], + "source": [ + "# imports\n", + "import math\n", + "import numpy as np\n", + "from numpy.random import randn\n", + "from statsmodels.stats.weightstats import ztest\n", + "\n", + "# Generate a random array of 50 numbers having mean 110 and sd 15\n", + "# similar to the IQ scores data we assume above\n", + "mean_iq = 110\n", + "sd_iq = 15/math.sqrt(50)\n", + "alpha =0.05\n", + "null_mean =100\n", + "data = sd_iq*randn(50)+mean_iq\n", + "# print mean and sd\n", + "print('mean=%.2f stdv=%.2f' % (np.mean(data), np.std(data)))\n", + "\n", + "# now we perform the test. In this function, we passed data, in the value parameter\n", + "# we passed mean value in the null hypothesis, in alternative hypothesis we check whether the\n", + "# mean is larger\n", + "\n", + "ztest_Score, p_value= ztest(data,value = null_mean, alternative='larger')\n", + "# the function outputs a p_value and z-score corresponding to that value, we compare the\n", + "# p-value with alpha, if it is greater than alpha then we do not null hypothesis\n", + "# else we reject it.\n", + "\n", + "if(p_value < alpha):\n", + " print(\"Reject Null Hypothesis\")\n", + "else:\n", + " print(\"Fail to Reject NUll Hypothesis\")" + ] + }, + { + "cell_type": "code", + "source": [ + "import pandas as pd\n", + "from statsmodels.stats import weightstats as stests\n", + " \n", + "\n", + "df=pd.read_csv(\"train.csv\")\n", + " \n", + "\n", + "df.head()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 548 + }, + "id": "z4um1aFtHj9R", + "outputId": "41b5cbc0-5478-40dd-e632-418f2b73cf25" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " PassengerId Survived Pclass \\\n", + "0 1 0 3 \n", + "1 2 1 1 \n", + "2 3 1 3 \n", + "3 4 1 1 \n", + "4 5 0 3 \n", + "\n", + " Name Sex Age SibSp \\\n", + "0 Braund, Mr. Owen Harris male 22.0 1 \n", + "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 \n", + "2 Heikkinen, Miss. Laina female 26.0 0 \n", + "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 \n", + "4 Allen, Mr. William Henry male 35.0 0 \n", + "\n", + " Parch Ticket Fare Cabin Embarked \n", + "0 0 A/5 21171 7.2500 NaN S \n", + "1 0 PC 17599 71.2833 C85 C \n", + "2 0 STON/O2. 3101282 7.9250 NaN S \n", + "3 0 113803 53.1000 C123 S \n", + "4 0 373450 8.0500 NaN S " + ], + "text/html": [ + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
PassengerIdSurvivedPclassNameSexAgeSibSpParchTicketFareCabinEmbarked
0103Braund, Mr. Owen Harrismale22.010A/5 211717.2500NaNS
1211Cumings, Mrs. John Bradley (Florence Briggs Th...female38.010PC 1759971.2833C85C
2313Heikkinen, Miss. Lainafemale26.000STON/O2. 31012827.9250NaNS
3411Futrelle, Mrs. Jacques Heath (Lily May Peel)female35.01011380353.1000C123S
4503Allen, Mr. William Henrymale35.0003734508.0500NaNS
\n", + "
\n", + " \n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n", + " " + ] + }, + "metadata": {}, + "execution_count": 2 + } + ] + }, + { + "cell_type": "code", + "source": [ + "df.shape" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "VmgFM1hbHytC", + "outputId": "2d6f1e4f-b91a-4501-fffd-fa387a500732" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "(891, 12)" + ] + }, + "metadata": {}, + "execution_count": 3 + } + ] + }, + { + "cell_type": "code", + "source": [ + "df[['Age','Ticket']].describe()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 300 + }, + "id": "V3mWueCFH5Q-", + "outputId": "e4f903e0-e2c4-471d-bd80-45c360cddb48" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " Age\n", + "count 714.000000\n", + "mean 29.699118\n", + "std 14.526497\n", + "min 0.420000\n", + "25% 20.125000\n", + "50% 28.000000\n", + "75% 38.000000\n", + "max 80.000000" + ], + "text/html": [ + "\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Age
count714.000000
mean29.699118
std14.526497
min0.420000
25%20.125000
50%28.000000
75%38.000000
max80.000000
\n", + "
\n", + " \n", + " \n", + " \n", + "\n", + " \n", + "
\n", + "
\n", + " " + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "ztest ,pvalue = stests.ztest(df['Fare'], x2=None, value=146)\n", + "print(float(pvalue))\n", + "print(ztest)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ADEp0BSKH79S", + "outputId": "4fb80293-94fb-40be-aeb0-11d83652b079" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "0.0\n", + "-68.35433979692586\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "if pvalue<0.05:\n", + " print(\"Null hypothesis rejected , Alternative hypothesis accepted\")\n", + "else:\n", + " print(\"Null hypothesis accepted , Alternative hypothesis rejected\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "hSqHo_4GIWdU", + "outputId": "55928c4c-1285-4b37-e191-3a7373b8ca88" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Null hypothesis rejected , Alternative hypothesis accepted\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "ztest,pval1=stests.ztest(df['Fare'],df['Pclass'],value=100)\n", + "print(float(pval1))\n", + " " + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "_IOBd9-HIhyn", + "outputId": "6293e714-81b3-499f-ed86-e8241e3d52b2" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "0.0\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "if pval1>0.05:\n", + " print(\"Null hypothesis rejected , Alternative hypothesis accepted\")\n", + "else:\n", + " print(\"Null hypothesis accepted , Alternative hypothesis rejected\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zLQAaNtPIoaO", + "outputId": "ced813d1-b11a-4e3c-85f0-b7b597a54d1c" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Null hypothesis accepted , Alternative hypothesis rejected\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "yMyd0JYoI0Ci" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file