{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"collapsed":true},"cell_type":"markdown","source":"## Introduction\n** This is my first Kaggle Kernel and please let me know if you have any suggestions/feedback and comment about improvements.\n\nAvito.ru is a Russian classified advertisements website with sections devoted to general good for sale, jobs, real estate, personals, cars for sale, and services.\n\nSellers sometimes feel frustrated with both too little demand (indicating something is wrong with the product or the product listing) or too much demand (indicating a hot item with a good description was underpriced).\n\nThe aim of this challenge is to predict demand for an online advertisement based on its full description (title, description, images, etc.), its context (geographically where it was posted, similar ads already posted) and historical demand for similar ads in similar contexts. With this information, Avito can inform sellers on how to best optimize their listing and provide some indication of how much interest they should realistically expect to receive."},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"d7d1da6f3d2a41707715e32f5b425f51d81be15d"},"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport seaborn as sns\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn.decomposition import TruncatedSVD\nfrom sklearn import preprocessing, model_selection, metrics\nimport lightgbm as lgb\n\ncolor = sns.color_palette()\nimport matplotlib.pyplot as plt\n%matplotlib inline","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":false},"cell_type":"markdown","source":"### Load data"},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"52f9c8dad8c96be11e7990969a1c034e0babf366"},"cell_type":"code","source":"train_df = pd.read_csv(\"../input/train.csv\")\ntest_df = pd.read_csv(\"../input/test.csv\")","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"bbae8dd0618ee282ad9a9ce0bfba8112d4b7e69d"},"cell_type":"code","source":"train_df.head(4)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"067143e9407fa1c5d6dfedc8bbbcbd0a9618beb5"},"cell_type":"markdown","source":"The train dataset description is as follows:\n\n* item_id - Ad id.\n* user_id - User id.\n* region - Ad region.\n* city - Ad city.\n* parent_category_name - Top level ad category as classified by Avito's ad model.\n* category_name - Fine grain ad category as classified by Avito's ad model.\n* param_1 - Optional parameter from Avito's ad model.\n* param_2 - Optional parameter from Avito's ad model.\n* param_3 - Optional parameter from Avito's ad model.\n* title - Ad title.\n* description - Ad description.\n* price - Ad price.\n* item_seq_number - Ad sequential number for user.\n* activation_date- Date ad was placed.\n* user_type - User type.\n* image - Id code of image. Ties to a jpg file in train_jpg. Not every ad has an image.\n* image_top_1 - Avito's classification code for the image.\n* deal_probability - The target variable. This is the likelihood that an ad actually sold something. It's not possible to verify every transaction with certainty, so this column's value can be any float from zero to one."},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"c27bf640ced0e21da18bffc73790683298bcad23"},"cell_type":"code","source":"test_df.head(4)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"collapsed":true,"_uuid":"1a4f0ddd3768dfcb24b0170f38eed5d089437e3f"},"cell_type":"code","source":"plt.scatter(range(train_df.shape[0]), np.sort(train_df['deal_probability'].values))\nplt.xlabel('index', fontsize=12)\nplt.ylabel('deal probability', fontsize=12)\nplt.title(\"Deal Probability Distribution\", fontsize=14)\nplt.show()","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.5","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}