{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "HowToConnectKaggle_API.ipynb", "provenance": [], "collapsed_sections": [], "authorship_tag": "ABX9TyOT/iaaiMOi+fiETNLwh5vT", "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": "markdown", "source": [ "# First, I used Open ML site to download titanic data sets. Later, I will show how to download data set from Kaggle API." ], "metadata": { "id": "kEifD1ODpzuN" } }, { "cell_type": "code", "source": [ "from sklearn.datasets import fetch_openml\n" ], "metadata": { "id": "6XjTAYh-3v-T" }, "execution_count": 1, "outputs": [] }, { "cell_type": "code", "source": [ "X, y = fetch_openml(\"titanic\", version=1, as_frame=True, return_X_y=True)\n" ], "metadata": { "id": "3ki8YUTB3wA3" }, "execution_count": 2, "outputs": [] }, { "cell_type": "code", "source": [ "X, y" ], "metadata": { "id": "fwkV4pfN6vvW", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "92e64898-d02c-4f46-e524-b4848f7164be" }, "execution_count": 3, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "( pclass name sex \\\n", " 0 1.0 Allen, Miss. Elisabeth Walton female \n", " 1 1.0 Allison, Master. Hudson Trevor male \n", " 2 1.0 Allison, Miss. Helen Loraine female \n", " 3 1.0 Allison, Mr. Hudson Joshua Creighton male \n", " 4 1.0 Allison, Mrs. Hudson J C (Bessie Waldo Daniels) female \n", " ... ... ... ... \n", " 1304 3.0 Zabour, Miss. Hileni female \n", " 1305 3.0 Zabour, Miss. Thamine female \n", " 1306 3.0 Zakarian, Mr. Mapriededer male \n", " 1307 3.0 Zakarian, Mr. Ortin male \n", " 1308 3.0 Zimmerman, Mr. Leo male \n", " \n", " age sibsp parch ticket fare cabin embarked boat body \\\n", " 0 29.0000 0.0 0.0 24160 211.3375 B5 S 2 NaN \n", " 1 0.9167 1.0 2.0 113781 151.5500 C22 C26 S 11 NaN \n", " 2 2.0000 1.0 2.0 113781 151.5500 C22 C26 S None NaN \n", " 3 30.0000 1.0 2.0 113781 151.5500 C22 C26 S None 135.0 \n", " 4 25.0000 1.0 2.0 113781 151.5500 C22 C26 S None NaN \n", " ... ... ... ... ... ... ... ... ... ... \n", " 1304 14.5000 1.0 0.0 2665 14.4542 None C None 328.0 \n", " 1305 NaN 1.0 0.0 2665 14.4542 None C None NaN \n", " 1306 26.5000 0.0 0.0 2656 7.2250 None C None 304.0 \n", " 1307 27.0000 0.0 0.0 2670 7.2250 None C None NaN \n", " 1308 29.0000 0.0 0.0 315082 7.8750 None S None NaN \n", " \n", " home.dest \n", " 0 St Louis, MO \n", " 1 Montreal, PQ / Chesterville, ON \n", " 2 Montreal, PQ / Chesterville, ON \n", " 3 Montreal, PQ / Chesterville, ON \n", " 4 Montreal, PQ / Chesterville, ON \n", " ... ... \n", " 1304 None \n", " 1305 None \n", " 1306 None \n", " 1307 None \n", " 1308 None \n", " \n", " [1309 rows x 13 columns], 0 1\n", " 1 1\n", " 2 0\n", " 3 0\n", " 4 0\n", " ..\n", " 1304 0\n", " 1305 0\n", " 1306 0\n", " 1307 0\n", " 1308 0\n", " Name: survived, Length: 1309, dtype: category\n", " Categories (2, object): ['0', '1'])" ] }, "metadata": {}, "execution_count": 3 } ] }, { "cell_type": "markdown", "source": [ "#Installing the Kaggle API in Colab https://github.com/Kaggle/kaggle-api

\n", "#also visit the https://www.kaggle.com/docs/api\n", "# Also Google has its own intstruction at https://colab.research.google.com/github/corrieann/kaggle/blob/master/kaggle_api_in_colab.ipynb" ], "metadata": { "id": "KLYlbZNBJ0aX" } }, { "cell_type": "code", "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "id": "0P-X5qZD3wQe", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "0a7ecb4c-0025-4430-a865-21e2ce1325c1" }, "execution_count": 4, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n" ] } ] }, { "cell_type": "code", "source": [ "!pip install kaggle" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "qseA3Okp3wTE", "outputId": "8d23e964-b55a-4e34-82bc-bba3456ee4f2" }, "execution_count": 5, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", "Requirement already satisfied: kaggle in /usr/local/lib/python3.7/dist-packages (1.5.12)\n", "Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from kaggle) (1.24.3)\n", "Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from kaggle) (2022.5.18.1)\n", "Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from kaggle) (4.64.0)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from kaggle) (2.23.0)\n", "Requirement already satisfied: python-slugify in /usr/local/lib/python3.7/dist-packages (from kaggle) (6.1.2)\n", "Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from kaggle) (2.8.2)\n", "Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.7/dist-packages (from kaggle) (1.15.0)\n", "Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.7/dist-packages (from python-slugify->kaggle) (1.3)\n", "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->kaggle) (3.0.4)\n", "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->kaggle) (2.10)\n" ] } ] }, { "cell_type": "code", "source": [ "from google.colab import files\n", "\n", "uploaded = files.upload()\n", "\n", "for fn in uploaded.keys():\n", " print('User uploaded file \"{name}\" with length {length} bytes'.format(\n", " name=fn, length=len(uploaded[fn])))\n", " \n", "# Then move kaggle.json into the folder where the API expects to find it.\n", "!mkdir -p ~/.kaggle/ && mv kaggle.json ~/.kaggle/ && chmod 600 ~/.kaggle/kaggle.json" ], "metadata": { "colab": { "resources": { "http://localhost:8080/nbextensions/google.colab/files.js": { "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgovLyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLy8KLy8gICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLy8KLy8gVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQovLyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAovLyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLy8gU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAovLyBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KCi8qKgogKiBAZmlsZW92ZXJ2aWV3IEhlbHBlcnMgZm9yIGdvb2dsZS5jb2xhYiBQeXRob24gbW9kdWxlLgogKi8KKGZ1bmN0aW9uKHNjb3BlKSB7CmZ1bmN0aW9uIHNwYW4odGV4dCwgc3R5bGVBdHRyaWJ1dGVzID0ge30pIHsKICBjb25zdCBlbGVtZW50ID0gZG9jdW1lb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A9IG5ldyBGaWxlUmVhZGVyKCk7CiAgICAgIHJlYWRlci5vbmxvYWQgPSAoZSkgPT4gewogICAgICAgIHJlc29sdmUoZS50YXJnZXQucmVzdWx0KTsKICAgICAgfTsKICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGZpbGUpOwogICAgfSk7CiAgICAvLyBXYWl0IGZvciB0aGUgZGF0YSB0byBiZSByZWFkeS4KICAgIGxldCBmaWxlRGF0YSA9IHlpZWxkIHsKICAgICAgcHJvbWlzZTogZmlsZURhdGFQcm9taXNlLAogICAgICByZXNwb25zZTogewogICAgICAgIGFjdGlvbjogJ2NvbnRpbnVlJywKICAgICAgfQogICAgfTsKCiAgICAvLyBVc2UgYSBjaHVua2VkIHNlbmRpbmcgdG8gYXZvaWQgbWVzc2FnZSBzaXplIGxpbWl0cy4gU2VlIGIvNjIxMTU2NjAuCiAgICBsZXQgcG9zaXRpb24gPSAwOwogICAgZG8gewogICAgICBjb25zdCBsZW5ndGggPSBNYXRoLm1pbihmaWxlRGF0YS5ieXRlTGVuZ3RoIC0gcG9zaXRpb24sIE1BWF9QQVlMT0FEX1NJWkUpOwogICAgICBjb25zdCBjaHVuayA9IG5ldyBVaW50OEFycmF5KGZpbGVEYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTsKICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoOwoKICAgICAgY29uc3QgYmFzZTY0ID0gYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGNodW5rKSk7CiAgICAgIHlpZWxkIHsKICAgICAgICByZXNwb25zZTogewogICAgICAgICAgYWN0aW9uOiAnYXBwZW5kJywKICAgICAgICAgIGZpbGU6IGZpbGUubmFtZSwKICAgICAgICAgIGRhdGE6IGJhc2U2NCwKICAgICAgICB9LAogICAgICB9OwoKICAgICAgbGV0IHBlcmNlbnREb25lID0gZmlsZURhdGEuYnl0ZUxlbmd0aCA9PT0gMCA/CiAgICAgICAgICAxMDAgOgogICAgICAgICAgTWF0aC5yb3VuZCgocG9zaXRpb24gLyBmaWxlRGF0YS5ieXRlTGVuZ3RoKSAqIDEwMCk7CiAgICAgIHBlcmNlbnQudGV4dENvbnRlbnQgPSBgJHtwZXJjZW50RG9uZX0lIGRvbmVgOwoKICAgIH0gd2hpbGUgKHBvc2l0aW9uIDwgZmlsZURhdGEuYnl0ZUxlbmd0aCk7CiAgfQoKICAvLyBBbGwgZG9uZS4KICB5aWVsZCB7CiAgICByZXNwb25zZTogewogICAgICBhY3Rpb246ICdjb21wbGV0ZScsCiAgICB9CiAgfTsKfQoKc2NvcGUuZ29vZ2xlID0gc2NvcGUuZ29vZ2xlIHx8IHt9OwpzY29wZS5nb29nbGUuY29sYWIgPSBzY29wZS5nb29nbGUuY29sYWIgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYi5fZmlsZXMgPSB7CiAgX3VwbG9hZEZpbGVzLAogIF91cGxvYWRGaWxlc0NvbnRpbnVlLAp9Owp9KShzZWxmKTsK", "ok": true, "headers": [ [ "content-type", "application/javascript" ] ], "status": 200, "status_text": "" } }, "base_uri": "https://localhost:8080/", "height": 90 }, "id": "NwQk5bCG3wV7", "outputId": "23d726b1-251b-4fbf-8af5-6825a4bbbb57" }, "execution_count": 12, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "\n", " \n", " \n", " Upload widget is only available when the cell has been executed in the\n", " current browser session. Please rerun this cell to enable.\n", " \n", " " ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Saving kaggle.json to kaggle.json\n", "User uploaded file \"kaggle.json\" with length 63 bytes\n" ] } ] }, { "cell_type": "code", "source": [ "!kaggle datasets list --sort-by votes" ], "metadata": { "id": "eZZOJWnD3wYi", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "dd3eece8-8f0b-433a-e324-ca3677ac9331" }, "execution_count": 13, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "ref title size lastUpdated downloadCount voteCount usabilityRating \n", "------------------------------------------------------------ -------------------------------------------------- ----- ------------------- ------------- --------- --------------- \n", "jessicali9530/animal-crossing-new-horizons-nookplaza-dataset Animal Crossing New Horizons Catalog 577KB 2021-06-08 15:05:09 19102 15629 0.8235294 \n", "allen-institute-for-ai/CORD-19-research-challenge COVID-19 Open Research Dataset Challenge (CORD-19) 15GB 2022-04-25 19:32:16 145234 9920 0.88235295 \n", "mlg-ulb/creditcardfraud Credit Card Fraud Detection 66MB 2018-03-23 01:17:27 412404 9149 0.85294116 \n", "shivamb/netflix-shows Netflix Movies and TV Shows 1MB 2021-09-27 04:44:36 239227 6571 1.0 \n", "sudalairajkumar/novel-corona-virus-2019-dataset Novel Corona Virus 2019 Dataset 9MB 2021-06-24 04:27:25 372822 5801 0.9705882 \n", "paultimothymooney/chest-xray-pneumonia Chest X-Ray Images (Pneumonia) 2GB 2018-03-24 19:41:59 171502 5067 0.75 \n", "datasnaek/youtube-new Trending YouTube Video Statistics 201MB 2019-06-03 00:56:47 175279 4536 0.7941176 \n", "gregorut/videogamesales Video Game Sales 381KB 2016-10-26 09:10:49 318873 4532 0.5882353 \n", "lava18/google-play-store-apps Google Play Store Apps 2MB 2019-02-03 13:55:47 182845 4025 0.7058824 \n", "hugomathien/soccer European Soccer Database 33MB 2016-10-23 22:31:38 154883 3850 0.7058824 \n", "timoboz/data-science-cheat-sheets Data Science Cheat Sheets 596MB 2020-02-04 19:42:27 44872 3828 0.875 \n", "borismarjanovic/price-volume-data-for-all-us-stocks-etfs Huge Stock Market Dataset 492MB 2017-11-16 14:53:29 87432 3756 0.75 \n", "unsdsn/world-happiness World Happiness Report 37KB 2019-11-27 04:41:47 225528 3563 0.85294116 \n", "zynicide/wine-reviews Wine Reviews 51MB 2017-11-27 17:08:04 160348 3315 0.7941176 \n", "spscientist/students-performance-in-exams Students Performance in Exams 9KB 2018-11-09 18:25:25 170692 3263 0.7058824 \n", "uciml/pima-indians-diabetes-database Pima Indians Diabetes Database 9KB 2016-10-06 18:31:56 285971 3107 0.88235295 \n", "neuromusic/avocado-prices Avocado Prices 629KB 2018-06-06 05:28:35 157903 3054 0.9705882 \n", "tmdb/tmdb-movie-metadata TMDB 5000 Movie Dataset 9MB 2017-09-28 01:09:12 203902 3041 0.8235294 \n", "mczielinski/bitcoin-historical-data Bitcoin Historical Data 100MB 2021-04-11 19:41:13 109469 2986 1.0 \n" ] } ] }, { "cell_type": "code", "source": [ "!kaggle competitions list -s titanic" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "SrpStmG03wb7", "outputId": "d24dbdcc-c5c0-421f-b3ac-9a9344784cb0" }, "execution_count": 14, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "ref deadline category reward teamCount userHasEntered \n", "----------------- ------------------- --------------- --------- --------- -------------- \n", "spaceship-titanic 2030-01-01 00:00:00 Getting Started Knowledge 2167 False \n", "titanic 2030-01-01 00:00:00 Getting Started Knowledge 13878 False \n" ] } ] }, { "cell_type": "code", "source": [ "!kaggle competitions download -c titanic" ], "metadata": { "id": "3GBE7funK4V7", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "870cd054-0f59-4647-8921-884eca1130ed" }, "execution_count": 15, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Downloading titanic.zip to /content\n", "\r 0% 0.00/34.1k [00:00\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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
.......................................
88688702Montvila, Rev. Juozasmale27.00021153613.0000NaNS
88788811Graham, Miss. Margaret Edithfemale19.00011205330.0000B42S
88888903Johnston, Miss. Catherine Helen \"Carrie\"femaleNaN12W./C. 660723.4500NaNS
88989011Behr, Mr. Karl Howellmale26.00011136930.0000C148C
89089103Dooley, Mr. Patrickmale32.0003703767.7500NaNQ
\n", "

891 rows × 12 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", " \n", " " ] }, "metadata": {}, "execution_count": 19 } ] } ] }