diff --git a/script.ipynb b/script.ipynb new file mode 100644 index 0000000..a074172 --- /dev/null +++ b/script.ipynb @@ -0,0 +1,1390 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "injured-operations", + "metadata": {}, + "source": [ + "### Skrypt do ściagnięcia zbiory danych" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "engaging-wholesale", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install --user kaggle \n", + "!pip install --user pandas\n", + "!pip install --user numpy\n", + "!pip install --user seaborn\n", + "!pip install -U scikit-learn" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "cleared-shower", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Downloading dataset from Kaggle...\n", + "/bin/bash: kaggle: command not found\n", + "Done.\n" + ] + } + ], + "source": [ + "!echo \"Downloading dataset from Kaggle...\"\n", + "!kaggle datasets download -d harshitshankhdhar/imdb-dataset-of-top-1000-movies-and-tv-shows\n", + "!echo \"Done.\"" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "pleased-culture", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unzipping archive\n", + "Done.\n" + ] + } + ], + "source": [ + "!echo \"Unzipping archive\"\n", + "!files=$(unzip imdb-dataset-of-top-1000-movies-and-tv-shows.zip | tail -n +2 | cut -d ' ' -f 4)\n", + "!echo \"Done.\"" + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "id": "extended-moderator", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "data=pd.read_csv('imdb_top_1000.csv')\n", + "# data" + ] + }, + { + "cell_type": "markdown", + "id": "outer-allah", + "metadata": {}, + "source": [ + "## Usuwanie kolumn\n", + "- Poster_Link: kolumna zawierająca linki do plakatów promujących film\n", + "- Overview: kolumna zawierająca recenzje poszczególnych filmów" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "id": "strange-honduras", + "metadata": {}, + "outputs": [], + "source": [ + "data.drop(columns=[\"Poster_Link\"], inplace=True)\n", + "data.drop(columns=[\"Overview\"], inplace=True)\n", + "# data" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "id": "preceding-values", + "metadata": {}, + "outputs": [], + "source": [ + "# Lowercase na polach tekstowych\n", + "data[\"Series_Title\"] = data[\"Series_Title\"].str.lower()\n", + "data[\"Genre\"] = data[\"Genre\"].str.lower()\n", + "data[\"Director\"] = data[\"Director\"].str.lower()\n", + "data[\"Star1\"] = data[\"Star1\"].str.lower()\n", + "data[\"Star2\"] = data[\"Star2\"].str.lower()\n", + "data[\"Star3\"] = data[\"Star3\"].str.lower()\n", + "data[\"Star4\"] = data[\"Star4\"].str.lower()\n", + "\n", + "# Usunięcie Nan i string to int \n", + "data = data.replace(np.nan, '', regex=True)\n", + "data[\"Gross\"] = data[\"Gross\"].str.replace(',', '')\n", + "data[\"Gross\"] = pd.to_numeric(data[\"Gross\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "id": "standard-rates", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1001 imdb_top_1000.csv\n" + ] + } + ], + "source": [ + "#Wielkosc zbioru\n", + "!wc -l imdb_top_1000.csv" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "id": "experienced-nerve", + "metadata": {}, + "outputs": [ + { + "data": { + "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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Series_TitleReleased_YearCertificateRuntimeGenreIMDB_RatingMeta_scoreDirectorStar1Star2Star3Star4No_of_VotesGross
count100010001000100010001000.0000001000100010001000100010001.000000e+038.310000e+02
unique99910017140202NaN64548660841891939NaNNaN
topdrishyam2014U130 mindramaNaNalfred hitchcocktom hanksemma watsonrupert grintmichael caineNaNNaN
freq2322342385NaN1571412754NaNNaN
meanNaNNaNNaNNaNNaN7.949300NaNNaNNaNNaNNaNNaN2.736929e+056.803475e+07
stdNaNNaNNaNNaNNaN0.275491NaNNaNNaNNaNNaNNaN3.273727e+051.097500e+08
minNaNNaNNaNNaNNaN7.600000NaNNaNNaNNaNNaNNaN2.508800e+041.305000e+03
25%NaNNaNNaNNaNNaN7.700000NaNNaNNaNNaNNaNNaN5.552625e+043.253559e+06
50%NaNNaNNaNNaNNaN7.900000NaNNaNNaNNaNNaNNaN1.385485e+052.353089e+07
75%NaNNaNNaNNaNNaN8.100000NaNNaNNaNNaNNaNNaN3.741612e+058.075089e+07
maxNaNNaNNaNNaNNaN9.300000NaNNaNNaNNaNNaNNaN2.343110e+069.366622e+08
\n", + "
" + ], + "text/plain": [ + " Series_Title Released_Year Certificate Runtime Genre IMDB_Rating \\\n", + "count 1000 1000 1000 1000 1000 1000.000000 \n", + "unique 999 100 17 140 202 NaN \n", + "top drishyam 2014 U 130 min drama NaN \n", + "freq 2 32 234 23 85 NaN \n", + "mean NaN NaN NaN NaN NaN 7.949300 \n", + "std NaN NaN NaN NaN NaN 0.275491 \n", + "min NaN NaN NaN NaN NaN 7.600000 \n", + "25% NaN NaN NaN NaN NaN 7.700000 \n", + "50% NaN NaN NaN NaN NaN 7.900000 \n", + "75% NaN NaN NaN NaN NaN 8.100000 \n", + "max NaN NaN NaN NaN NaN 9.300000 \n", + "\n", + " Meta_score Director Star1 Star2 Star3 \\\n", + "count 1000 1000 1000 1000 1000 \n", + "unique 64 548 660 841 891 \n", + "top alfred hitchcock tom hanks emma watson rupert grint \n", + "freq 157 14 12 7 5 \n", + "mean NaN NaN NaN NaN NaN \n", + "std NaN NaN NaN NaN NaN \n", + "min NaN NaN NaN NaN NaN \n", + "25% NaN NaN NaN NaN NaN \n", + "50% NaN NaN NaN NaN NaN \n", + "75% NaN NaN NaN NaN NaN \n", + "max NaN NaN NaN NaN NaN \n", + "\n", + " Star4 No_of_Votes Gross \n", + "count 1000 1.000000e+03 8.310000e+02 \n", + "unique 939 NaN NaN \n", + "top michael caine NaN NaN \n", + "freq 4 NaN NaN \n", + "mean NaN 2.736929e+05 6.803475e+07 \n", + "std NaN 3.273727e+05 1.097500e+08 \n", + "min NaN 2.508800e+04 1.305000e+03 \n", + "25% NaN 5.552625e+04 3.253559e+06 \n", + "50% NaN 1.385485e+05 2.353089e+07 \n", + "75% NaN 3.741612e+05 8.075089e+07 \n", + "max NaN 2.343110e+06 9.366622e+08 " + ] + }, + "execution_count": 96, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.describe(include='all')" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "id": "academic-principle", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "IMDB_Rating 7.9\n", + "No_of_Votes 138548.5\n", + "Gross 23530892.0\n", + "dtype: float64" + ] + }, + "execution_count": 98, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.median()" + ] + }, + { + "cell_type": "code", + "execution_count": 99, + "id": "spatial-unemployment", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(600, 14)\n", + "(200, 14)\n", + "(200, 14)\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "import sklearn\n", + "\n", + "data_train, data_test = train_test_split(data, test_size=400, random_state=1)\n", + "data_test, data_dev = train_test_split(data_test, test_size=200, random_state=1)\n", + "print(data_train.shape)\n", + "print(data_test.shape)\n", + "print(data_dev.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "id": "weird-webmaster", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.3333333333333333" + ] + }, + "execution_count": 100, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_test.size/data_train.size" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "id": "narrow-assumption", + "metadata": {}, + "outputs": [ + { + "data": { + "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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Series_TitleReleased_YearCertificateRuntimeGenreIMDB_RatingMeta_scoreDirectorStar1Star2Star3Star4No_of_VotesGross
count600600600600600600.0000006006006006006006006.000000e+025.050000e+02
unique5999517122163NaN61399448535545580NaNNaN
topdrishyam2004U130 mindramaNaNdavid fincherrobert de niroemma watsonrupert grintmichael caineNaNNaN
freq2221331745NaN8888643NaNNaN
meanNaNNaNNaNNaNNaN7.947167NaNNaNNaNNaNNaNNaN2.765041e+056.726714e+07
stdNaNNaNNaNNaNNaN0.269282NaNNaNNaNNaNNaNNaN3.219888e+051.076309e+08
minNaNNaNNaNNaNNaN7.600000NaNNaNNaNNaNNaNNaN2.508800e+041.305000e+03
25%NaNNaNNaNNaNNaN7.700000NaNNaNNaNNaNNaNNaN5.705600e+043.108485e+06
50%NaNNaNNaNNaNNaN7.900000NaNNaNNaNNaNNaNNaN1.414865e+052.447542e+07
75%NaNNaNNaNNaNNaN8.100000NaNNaNNaNNaNNaNNaN3.907975e+058.340000e+07
maxNaNNaNNaNNaNNaN9.200000NaNNaNNaNNaNNaNNaN1.854740e+069.366622e+08
\n", + "
" + ], + "text/plain": [ + " Series_Title Released_Year Certificate Runtime Genre IMDB_Rating \\\n", + "count 600 600 600 600 600 600.000000 \n", + "unique 599 95 17 122 163 NaN \n", + "top drishyam 2004 U 130 min drama NaN \n", + "freq 2 22 133 17 45 NaN \n", + "mean NaN NaN NaN NaN NaN 7.947167 \n", + "std NaN NaN NaN NaN NaN 0.269282 \n", + "min NaN NaN NaN NaN NaN 7.600000 \n", + "25% NaN NaN NaN NaN NaN 7.700000 \n", + "50% NaN NaN NaN NaN NaN 7.900000 \n", + "75% NaN NaN NaN NaN NaN 8.100000 \n", + "max NaN NaN NaN NaN NaN 9.200000 \n", + "\n", + " Meta_score Director Star1 Star2 Star3 \\\n", + "count 600 600 600 600 600 \n", + "unique 61 399 448 535 545 \n", + "top david fincher robert de niro emma watson rupert grint \n", + "freq 88 8 8 6 4 \n", + "mean NaN NaN NaN NaN NaN \n", + "std NaN NaN NaN NaN NaN \n", + "min NaN NaN NaN NaN NaN \n", + "25% NaN NaN NaN NaN NaN \n", + "50% NaN NaN NaN NaN NaN \n", + "75% NaN NaN NaN NaN NaN \n", + "max NaN NaN NaN NaN NaN \n", + "\n", + " Star4 No_of_Votes Gross \n", + "count 600 6.000000e+02 5.050000e+02 \n", + "unique 580 NaN NaN \n", + "top michael caine NaN NaN \n", + "freq 3 NaN NaN \n", + "mean NaN 2.765041e+05 6.726714e+07 \n", + "std NaN 3.219888e+05 1.076309e+08 \n", + "min NaN 2.508800e+04 1.305000e+03 \n", + "25% NaN 5.705600e+04 3.108485e+06 \n", + "50% NaN 1.414865e+05 2.447542e+07 \n", + "75% NaN 3.907975e+05 8.340000e+07 \n", + "max NaN 1.854740e+06 9.366622e+08 " + ] + }, + "execution_count": 101, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_train.describe(include=\"all\")" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "id": "significant-median", + "metadata": {}, + "outputs": [ + { + "data": { + "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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Series_TitleReleased_YearCertificateRuntimeGenreIMDB_RatingMeta_scoreDirectorStar1Star2Star3Star4No_of_VotesGross
count200200200200200200.0000002002002002002002002.000000e+021.600000e+02
unique20075108898NaN49162172192197198NaNNaN
topin america2003A118 mindramaNaNwoody allenhumphrey bogartrobert downey jr.lea thompsonmark ruffaloNaNNaN
freq1648723NaN3054222NaNNaN
meanNaNNaNNaNNaNNaN7.949500NaNNaNNaNNaNNaNNaN2.826230e+057.249570e+07
stdNaNNaNNaNNaNNaN0.290381NaNNaNNaNNaNNaNNaN3.501372e+051.224538e+08
minNaNNaNNaNNaNNaN7.600000NaNNaNNaNNaNNaNNaN2.519800e+046.013000e+03
25%NaNNaNNaNNaNNaN7.700000NaNNaNNaNNaNNaNNaN5.038950e+043.786699e+06
50%NaNNaNNaNNaNNaN7.900000NaNNaNNaNNaNNaNNaN1.354640e+052.325044e+07
75%NaNNaNNaNNaNNaN8.100000NaNNaNNaNNaNNaNNaN3.851505e+057.603522e+07
maxNaNNaNNaNNaNNaN9.000000NaNNaNNaNNaNNaNNaN2.303232e+068.583730e+08
\n", + "
" + ], + "text/plain": [ + " Series_Title Released_Year Certificate Runtime Genre IMDB_Rating \\\n", + "count 200 200 200 200 200 200.000000 \n", + "unique 200 75 10 88 98 NaN \n", + "top in america 2003 A 118 min drama NaN \n", + "freq 1 6 48 7 23 NaN \n", + "mean NaN NaN NaN NaN NaN 7.949500 \n", + "std NaN NaN NaN NaN NaN 0.290381 \n", + "min NaN NaN NaN NaN NaN 7.600000 \n", + "25% NaN NaN NaN NaN NaN 7.700000 \n", + "50% NaN NaN NaN NaN NaN 7.900000 \n", + "75% NaN NaN NaN NaN NaN 8.100000 \n", + "max NaN NaN NaN NaN NaN 9.000000 \n", + "\n", + " Meta_score Director Star1 Star2 \\\n", + "count 200 200 200 200 \n", + "unique 49 162 172 192 \n", + "top woody allen humphrey bogart robert downey jr. \n", + "freq 30 5 4 2 \n", + "mean NaN NaN NaN NaN \n", + "std NaN NaN NaN NaN \n", + "min NaN NaN NaN NaN \n", + "25% NaN NaN NaN NaN \n", + "50% NaN NaN NaN NaN \n", + "75% NaN NaN NaN NaN \n", + "max NaN NaN NaN NaN \n", + "\n", + " Star3 Star4 No_of_Votes Gross \n", + "count 200 200 2.000000e+02 1.600000e+02 \n", + "unique 197 198 NaN NaN \n", + "top lea thompson mark ruffalo NaN NaN \n", + "freq 2 2 NaN NaN \n", + "mean NaN NaN 2.826230e+05 7.249570e+07 \n", + "std NaN NaN 3.501372e+05 1.224538e+08 \n", + "min NaN NaN 2.519800e+04 6.013000e+03 \n", + "25% NaN NaN 5.038950e+04 3.786699e+06 \n", + "50% NaN NaN 1.354640e+05 2.325044e+07 \n", + "75% NaN NaN 3.851505e+05 7.603522e+07 \n", + "max NaN NaN 2.303232e+06 8.583730e+08 " + ] + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_test.describe(include=\"all\")" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "id": "blessed-socket", + "metadata": {}, + "outputs": [ + { + "data": { + "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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Series_TitleReleased_YearCertificateRuntimeGenreIMDB_RatingMeta_scoreDirectorStar1Star2Star3Star4No_of_VotesGross
count200200200200200200.0000002002002002002002002.000000e+021.660000e+02
unique20070108991NaN47162176191195199NaNNaN
topclerks2014U106 mindramaNaNsteven spielbergtoshirô mifuneed harrisfrances mcdormandlucy liuNaNNaN
freq11157617NaN3964332NaNNaN
meanNaNNaNNaNNaNNaN7.955500NaNNaNNaNNaNNaNNaN2.563293e+056.607024e+07
stdNaNNaNNaNNaNNaN0.279931NaNNaNNaNNaNNaNNaN3.208478e+051.035885e+08
minNaNNaNNaNNaNNaN7.600000NaNNaNNaNNaNNaNNaN2.593800e+046.460000e+03
25%NaNNaNNaNNaNNaN7.700000NaNNaNNaNNaNNaNNaN5.946375e+043.392077e+06
50%NaNNaNNaNNaNNaN7.900000NaNNaNNaNNaNNaNNaN1.256995e+052.249226e+07
75%NaNNaNNaNNaNNaN8.100000NaNNaNNaNNaNNaNNaN3.365100e+057.597351e+07
maxNaNNaNNaNNaNNaN9.300000NaNNaNNaNNaNNaNNaN2.343110e+066.085817e+08
\n", + "
" + ], + "text/plain": [ + " Series_Title Released_Year Certificate Runtime Genre IMDB_Rating \\\n", + "count 200 200 200 200 200 200.000000 \n", + "unique 200 70 10 89 91 NaN \n", + "top clerks 2014 U 106 min drama NaN \n", + "freq 1 11 57 6 17 NaN \n", + "mean NaN NaN NaN NaN NaN 7.955500 \n", + "std NaN NaN NaN NaN NaN 0.279931 \n", + "min NaN NaN NaN NaN NaN 7.600000 \n", + "25% NaN NaN NaN NaN NaN 7.700000 \n", + "50% NaN NaN NaN NaN NaN 7.900000 \n", + "75% NaN NaN NaN NaN NaN 8.100000 \n", + "max NaN NaN NaN NaN NaN 9.300000 \n", + "\n", + " Meta_score Director Star1 Star2 \\\n", + "count 200 200 200 200 \n", + "unique 47 162 176 191 \n", + "top steven spielberg toshirô mifune ed harris \n", + "freq 39 6 4 3 \n", + "mean NaN NaN NaN NaN \n", + "std NaN NaN NaN NaN \n", + "min NaN NaN NaN NaN \n", + "25% NaN NaN NaN NaN \n", + "50% NaN NaN NaN NaN \n", + "75% NaN NaN NaN NaN \n", + "max NaN NaN NaN NaN \n", + "\n", + " Star3 Star4 No_of_Votes Gross \n", + "count 200 200 2.000000e+02 1.660000e+02 \n", + "unique 195 199 NaN NaN \n", + "top frances mcdormand lucy liu NaN NaN \n", + "freq 3 2 NaN NaN \n", + "mean NaN NaN 2.563293e+05 6.607024e+07 \n", + "std NaN NaN 3.208478e+05 1.035885e+08 \n", + "min NaN NaN 2.593800e+04 6.460000e+03 \n", + "25% NaN NaN 5.946375e+04 3.392077e+06 \n", + "50% NaN NaN 1.256995e+05 2.249226e+07 \n", + "75% NaN NaN 3.365100e+05 7.597351e+07 \n", + "max NaN NaN 2.343110e+06 6.085817e+08 " + ] + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_dev.describe(include=\"all\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "continuing-chambers", + "metadata": {}, + "outputs": [], + "source": [ + "data_test.to_csv(\"crime_test.csv\", encoding=\"utf-8\", index=False)\n", + "data_dev.to_csv(\"crime_dev.csv\", encoding=\"utf-8\", index=False)\n", + "crime_train.to_csv(\"crime_train.csv\", encoding=\"utf-8\", index=False)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}