Question
The file AirbnbTrain.csv contains data on 1700 Airbnb listings in Hollywood, CA. The dataset contains features such as the location (by latitude and longitude), number
The file AirbnbTrain.csv contains data on 1700 Airbnb listings in Hollywood, CA. The dataset contains features such as the location (by latitude and longitude), number of guests accommodated, number of beds, and other variables. The dataset also contains the price per night of each Airbnb listing. Your assignment will be to formulate an optimization model to predict the price of Airbnb listings using this dataset.
The columns in AirbnbTrain.csv and AirbnbTest.csv are (in order): latitude, longitude, Entire home, accommodates, bathrooms, bedrooms, beds, cleaning_fee, minimum_nights, number_of_reviews, review_scores_rating, instant_bookable, price (since I cannot upload the CSV files directly)
Questions 1. Model 1: Formulate the least absolute deviations regression problem as a linear program. Solve the linear program using the data given in the file AirbnbTrain.csv. What is the prediction error, in $/night, of your model on the test set (provided in AirbnbTest.csv)?
2. Model 2: Suppose that to improve interpretability, you wish to build a model that predicts Airbnb prices using only the three most important variables. Modify Model 1 by including a constraint that allows at most three variables to have non-zero coefficients. a) List the names and coefficients of the three variables selected by the optimization model. b) What is the new prediction error, in $/night, of Model 2?
3. Model 3: Suppose now you wish to build a model that predicts Airbnb listing price using only three variables, where one of the variables is the number of beds. a) List the names and coefficients of the two other variables selected by the optimization model. b) Which variable was in Model 2 but is no longer in Model 3? Briefly explain in 1-2 sentences why this variable might have been dropped. c) What is the new prediction error, in $/night, of Model 3?
All 3 models need to be coded in Python language using the Jupyter Notebooks environment.
Please help with me with the Python code for these questions!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started