{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-10-24T22:12:30.416017Z","iopub.execute_input":"2024-10-24T22:12:30.417247Z","iopub.status.idle":"2024-10-24T22:12:33.982458Z","shell.execute_reply.started":"2024-10-24T22:12:30.417182Z","shell.execute_reply":"2024-10-24T22:12:33.981184Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#pacotes ultilizados \nimport pandas as pd \nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\npd.set_option('display.max_columns', None)\npd.set_option('display.max_rows', None)","metadata":{"execution":{"iopub.status.busy":"2024-10-24T22:12:36.428481Z","iopub.execute_input":"2024-10-24T22:12:36.429705Z","iopub.status.idle":"2024-10-24T22:12:37.862517Z","shell.execute_reply.started":"2024-10-24T22:12:36.429646Z","shell.execute_reply":"2024-10-24T22:12:37.861233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#importando os dataframes\n\ndf_teste = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/test.csv\")\ndf_train = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/train.csv\")\ndf_submissão = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/sample_submission.csv\")\ndf_dicionario = pd.read_csv(\"/kaggle/input/child-mind-institute-problematic-internet-use/data_dictionary.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-10-24T22:12:49.539590Z","iopub.execute_input":"2024-10-24T22:12:49.540107Z","iopub.status.idle":"2024-10-24T22:12:49.652786Z","shell.execute_reply.started":"2024-10-24T22:12:49.540063Z","shell.execute_reply":"2024-10-24T22:12:49.651490Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"ANALISANDO OS DADOS ","metadata":{}},{"cell_type":"code","source":"df_train.head(10)","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:20.913945Z","iopub.execute_input":"2024-10-24T09:09:20.914521Z","iopub.status.idle":"2024-10-24T09:09:21.071555Z","shell.execute_reply.started":"2024-10-24T09:09:20.914466Z","shell.execute_reply":"2024-10-24T09:09:21.069961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.shape","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:24.815318Z","iopub.execute_input":"2024-10-24T09:09:24.815798Z","iopub.status.idle":"2024-10-24T09:09:24.824371Z","shell.execute_reply.started":"2024-10-24T09:09:24.815750Z","shell.execute_reply":"2024-10-24T09:09:24.822897Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.info()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:26.490155Z","iopub.execute_input":"2024-10-24T09:09:26.490768Z","iopub.status.idle":"2024-10-24T09:09:26.533036Z","shell.execute_reply.started":"2024-10-24T09:09:26.490705Z","shell.execute_reply":"2024-10-24T09:09:26.531794Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"VALORES NULOS","metadata":{}},{"cell_type":"code","source":"df_train.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:31.217041Z","iopub.execute_input":"2024-10-24T09:09:31.218540Z","iopub.status.idle":"2024-10-24T09:09:31.237771Z","shell.execute_reply.started":"2024-10-24T09:09:31.218463Z","shell.execute_reply":"2024-10-24T09:09:31.235910Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"VALORES UNICOS","metadata":{}},{"cell_type":"code","source":"df_train.nunique()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:36.123908Z","iopub.execute_input":"2024-10-24T09:09:36.124401Z","iopub.status.idle":"2024-10-24T09:09:36.155759Z","shell.execute_reply.started":"2024-10-24T09:09:36.124353Z","shell.execute_reply":"2024-10-24T09:09:36.154368Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train['sii'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:40.094749Z","iopub.execute_input":"2024-10-24T09:09:40.095223Z","iopub.status.idle":"2024-10-24T09:09:40.108436Z","shell.execute_reply.started":"2024-10-24T09:09:40.095175Z","shell.execute_reply":"2024-10-24T09:09:40.106762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train[\"sii\"].value_counts().plot(kind = \"bar\" , title = \"Distribuição do Alvo\")","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:42.573092Z","iopub.execute_input":"2024-10-24T09:09:42.573562Z","iopub.status.idle":"2024-10-24T09:09:42.922305Z","shell.execute_reply.started":"2024-10-24T09:09:42.573515Z","shell.execute_reply":"2024-10-24T09:09:42.920929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"DADOS ESTASTISCO","metadata":{}},{"cell_type":"code","source":"df_train.describe()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:48.230295Z","iopub.execute_input":"2024-10-24T09:09:48.230794Z","iopub.status.idle":"2024-10-24T09:09:48.474815Z","shell.execute_reply.started":"2024-10-24T09:09:48.230747Z","shell.execute_reply":"2024-10-24T09:09:48.473323Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"VARIAVEIS X VS VARIAVEL ALVO","metadata":{}},{"cell_type":"code","source":"#tamanho do grafico\nplt.rcParams[\"figure.figsize\"] = [8.00 , 4.00]\nplt.rcParams[\"figure.autolayout\"] = True","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:09:52.315953Z","iopub.execute_input":"2024-10-24T09:09:52.317205Z","iopub.status.idle":"2024-10-24T09:09:52.328212Z","shell.execute_reply.started":"2024-10-24T09:09:52.317146Z","shell.execute_reply":"2024-10-24T09:09:52.325673Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"VERIFICANDO OS OUTLIERS","metadata":{}},{"cell_type":"code","source":"variavel_numerica = []\nfor i in df_train.columns[0:81].tolist():\n    if df_train.dtypes[i] == \"int64\" or df_train.dtypes[i] == \"float64\":\n        variavel_numerica.append(i)\nlen(variavel_numerica)","metadata":{"execution":{"iopub.status.busy":"2024-10-24T22:12:53.590613Z","iopub.execute_input":"2024-10-24T22:12:53.591148Z","iopub.status.idle":"2024-10-24T22:12:53.619806Z","shell.execute_reply.started":"2024-10-24T22:12:53.591099Z","shell.execute_reply":"2024-10-24T22:12:53.618420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.hist(figsize = (15,10) , bins = 30)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-10-24T22:29:24.284590Z","iopub.execute_input":"2024-10-24T22:29:24.285156Z","iopub.status.idle":"2024-10-24T22:29:40.656730Z","shell.execute_reply.started":"2024-10-24T22:29:24.285100Z","shell.execute_reply":"2024-10-24T22:29:40.655396Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(30, 15))\ndf_numeric = df_train.select_dtypes(include=[np.number])\ncorrelation = df_numeric.corr()\nplot = sns.heatmap(correlation, annot=True, fmt=\".2f\", linewidths=.6)\n","metadata":{"execution":{"iopub.status.busy":"2024-10-24T09:21:10.318127Z","iopub.execute_input":"2024-10-24T09:21:10.318751Z","iopub.status.idle":"2024-10-24T09:21:31.840906Z","shell.execute_reply.started":"2024-10-24T09:21:10.318696Z","shell.execute_reply":"2024-10-24T09:21:31.839079Z"},"trusted":true},"execution_count":null,"outputs":[]}]}