{"id":20360616,"url":"https://github.com/davidgasquez/kaggle-airbnb","last_synced_at":"2025-06-29T08:33:57.558Z","repository":{"id":48161769,"uuid":"47714813","full_name":"davidgasquez/kaggle-airbnb","owner":"davidgasquez","description":":earth_africa: Where will a new guest book their first travel experience?","archived":false,"fork":false,"pushed_at":"2017-05-04T07:22:14.000Z","size":4236,"stargazers_count":53,"open_issues_count":0,"forks_count":26,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T03:52:54.480Z","etag":null,"topics":["jupyter","kaggle","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidgasquez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-09T19:45:55.000Z","updated_at":"2024-11-02T10:36:52.000Z","dependencies_parsed_at":"2022-07-27T16:19:01.164Z","dependency_job_id":null,"html_url":"https://github.com/davidgasquez/kaggle-airbnb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgasquez%2Fkaggle-airbnb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgasquez%2Fkaggle-airbnb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgasquez%2Fkaggle-airbnb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidgasquez%2Fkaggle-airbnb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidgasquez","download_url":"https://codeload.github.com/davidgasquez/kaggle-airbnb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514209,"owners_count":21116899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter","kaggle","machine-learning"],"created_at":"2024-11-14T23:42:19.714Z","updated_at":"2025-04-12T03:53:02.656Z","avatar_url":"https://github.com/davidgasquez.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Airbnb Kaggle Competition: *New User Bookings*\n\n[![Code Health](https://landscape.io/github/davidgasquez/kaggle-airbnb/master/landscape.svg?style=flat)](https://landscape.io/github/davidgasquez/kaggle-airbnb/master)\n\nThis repository contains the code developed for the [Airbnb's Kaggle\ncompetition][competition]. It's written in **Python**, some in the form\nof **Jupyter Notebooks**, and other in pure Python 3.\n\nThe code produces predictions with scores around 0.88090% in the public\nleader-board, enough to be in the best 5% participants(0.001% behind the best)\nand 0.88509% in the private leader-board(0.0018% behind the winner)\n\nThe entire run should not take more than 4 hours(thanks to the parallel\npreprocessing) in a modern/recent computer, though you may run into memory\nissues with less than 8GB RAM.\n\nFeel free to contribute to the code or open an issue if you see something wrong.\n\n[competition]: https://www.kaggle.com/c/airbnb-recruiting-new-user-bookings\n\n\n## Description\n\nNew users on *Airbnb* can book a place to stay in 34,000+ cities across 190+\ncountries. By accurately predicting where a new user will book their first\ntravel experience, *Airbnb* can share more personalized content with their\ncommunity, decrease the average time to first booking, and better forecast\ndemand.\n\nIn this competition, the goal is to predict in which country a new user\nwill make his or her first booking. There are **12** possible outcomes of the\ndestination country and the datasets consist of a list of users with their\ndemographics, web session records, and some summary statistics.\n\n## Data\n\nDue to the [*Competition Rules*][rules], the data sets can not be shared. If\nyou want to take a look at the data, head over the [competition][competition]\npage and download it.\n\nYou need to download `train_users_2.csv`, `test_users.csv` and `sessions.csv`\nfiles and unzip them into the 'data' folder.\n\n**Note**: Since the train users file is the one re-uploaded by the competition\nadministrators, rename `train_users_2.csv` as `train_users.csv`.\n\n[rules]: https://www.kaggle.com/c/airbnb-recruiting-new-user-bookings/rules\n\n## Main Ideas\n\n1. The provided datasets have lot of NaNs and some other *random* values, so, a\ngood preprocessing is the primary key to get a good solution:\n    - Replace *-unknown-* values with NaNs\n    - Clean age values\n    - Extract day, weekday, month, year from `date_account_created`\n    and `timestamp_first_active`\n    - Add number of missing values per user\n    - General user session information:\n        - Number of different values in `action`, `action_type`,\n        `action_detail` and `device_type`\n\n2. That kind of classification task works nicely with tree-based methods, I\nused `xgboost` library and the Gradient Boosting Classifier that provides along\n`scikit-learn` to make the probabilities predictions.\n\n## Requirements\n\nTo replicate the findings and execute the code in this repository you will need\nbasically the next Python packages:\n\n- [NumPy](http://www.numpy.org/)\n- [Pandas](http://pandas.pydata.org/)\n- [Jupyter](http://jupyter.org/)\n- [SciKit-Learn](http://scikit-learn.org/stable/)\n- [Matplotlib](http://matplotlib.org/)\n- [Unbalanced Dataset](https://github.com/fmfn/UnbalancedDataset)\n\n## Resources\n\n- [XGBoost Documentation](https://xgboost.readthedocs.org) - A library designed\nand optimized for boosted (tree) algorithms.\n- [Pattern Classification](https://github.com/rasbt/pattern_classification) -\nTutorials, examples, collections, and everything else that falls into the\ncategories: pattern classification, machine learning, and data mining.\n\n## License\n\nCopyright © 2015 David Gasquez\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgasquez%2Fkaggle-airbnb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidgasquez%2Fkaggle-airbnb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidgasquez%2Fkaggle-airbnb/lists"}