# Identifying Real Estate Opportunities Using Machine Learning
## 3 Data
### Source and Description  
In order to identify opportunities within the framework of a stable market, we have used data from all residences costing more than one million euros, listed in Idealista (the more relevant Spanish online platform for real estate sales and rentals) in the second semester of 2017 (from 1 June to 31 December). While some features might vary between assets, we consider this sample to be relatively homogeneous and focused in the residential prime market. Moreover, some machine learning techniques used in this paper and described in Section 4 are well suited to deal with a certain degree of heterogeneity, by choosing appropriate features when learning the model based on some measure of discrimination power (e.g., entropy or Gini coefficient). The raw data used for training the machine learning models comprise several attributes, which can be grouped in three categories: location, home characteristics and ad characteristics. In particular, the features involved in determining the location of the real estate asset are the following:  
* Zone: division within the Salamanca district where the asset is located. This zone is determined by Idealista based on the asset location. * Postal code: the postal code for the area where the asset is located. * Street name: the name of the street where the asset is located. * Street number: number within the street where the asset is located. * Floor number: the number of the floor where the asset is located. The features defining the asset characteristics are the following:  
* Type of asset: whether the asset is an apartment (flat, condo...) or a villa (detached or semi-detached house). * Constructed area: the total area of the asset indicated in square meters. * Floor area: the floor area of the asset indicated in square meters, which will in some cases be smaller than the constructed area because terraces, gardens, etc., are ignored in this feature. * Construction year: construction year of the building. * Number of rooms: the total number of rooms in the asset. * Number of baths: the total number of bathrooms in the asset. * Is penthouse: whether the asset is a penthouse. * Is duplex: whether the asset is a duplex, i.e., a house of two floors connected by stairs. * Has lift: whether the building where the asset is located has a lift. Figure 3: Location of the Salamanca district within the city of Madrid. * Has box room: whether the asset includes a box room. * Has swimming pool: whether the asset has a swimming pool (either private or in the building). * Has garden: whether the asset has a garden. * Has parking: whether the asset has a parking lot included in the price. * Parking price: if a parking lot is offered by an additional cost, then that price is specified in this feature. * Community costs: the monthly fee for community costs. Finally, the features defining the ad characteristics are the following:  
* Date of activation: the date when the ad was published in the listing and displayed publicly. * Date of deactivation: the date when the ad was removed from the listing, which could indicate that it was already sold or rented. * Price: current price of the asset, or price when the ad was deactivated, which in most cases correspond to the price at which the asset was sold or rented. Some of the previous features might not be available. This will happen in most cases because the seller has not explicitly specified some information about the asset, for example, whether a lift is available, which are the monthly community costs, etc. Regarding the street name and number, it can be intentionally hidden by the seller, so potential buyers are not aware of the actual location of the building. Some information is always available, such as the zone, postal code, constructed area, number of rooms and number of bathrooms. In the dataset, there is a total of 2266 real estate assets, from which 2174 are apartments and 92 are villas.