# Identifying Real Estate Opportunities Using Machine Learning
## 3 Data
### Data Cleansing  
Before starting to work with the data, we have proceeded to clean some of the data. Although the data is relatively clean, some information is particularly noisy because the way it is communicated by sellers in the listing.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Feature** & **Type** & **Range** & **Mean (Std. Dev.)** & **Empty Values** \\ \hline Zone & Categorical & \(1,2,3,4,5,6\) & – & – \\ Postal code & Categorical & \(28001,28006,28009,28014,28028,28046\) & – & – \\ Street name & Categorical & \(65\) values & – & \(1453\) \\ Street number & Categorical & \(77\) values & – & \(2049\) \\ Floor number & Categorical & Basement, Floor, Mezz, \(1\)-\(14\) & – & \(119\) \\ Type of asset & Categorical & Apartment, Villa & – & – \\ Constructed area & Numerical & \(50\)–\(2041\) sq.m. & \(288.76\) (\(133.71\)) & – \\ Floor area & Numerical & \(93\)–\(1700\) sq.m. & \(257.63\) (\(126.43\)) & \(1673\) \\ Construction year & Numerical & \(1848\)–\(2018\) & \(1953.23\) (\(31.35\)) & \(1517\) \\ Number of rooms & Numerical & \(0\)–\(20\) & \(4.19\) (\(1.35\)) & \(6\) \\ Number of baths & Numerical & \(0\)–\(10\) & \(3.53\) (\(1.14\)) & \(5\) \\ Is penthouse & Boolean & T (\(169\))/F (\(288\)) & – & \(1809\) \\ Is duplex & Boolean & T (\(50\))/F (\(260\)) & – & \(1956\) \\ Has lift & Boolean & T (\(1213\))/F (\(20\)) & – & \(123\) \\ Has box room & Boolean & T (\(1212\))/F (\(269\)) & – & \(785\) \\ Has swimming pool & Boolean & T (\(127\))/F (\(413\)) & – & \(1726\) \\ Has garden & Boolean & T (\(155\))/F (\(391\)) & – & \(1720\) \\ Has parking & Boolean & T (\(687\))/F (\(77\)) & – & \(1502\) \\ Parking price & Numeric & \(115\)–\(550\),\(000\) & \(52\),\(359.50\) (\(102\),\(670\)) & \(2209\) \\ Community costs & Numeric & \(0\)–\(3000\) & \(353.71\) (\(299.61\)) & \(1536\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Data description, showing the range of values for each feature and the number of empty values, as well as mean and standard deviation in the case of numerical values.  
An example is the street name, which is a free text field. For this reason, there was no consensus regarding some aspects such as capitalization, prepositions or accents. We have manually revised this field in order to standardize it according to the actual street names gathered in the streets guide.  
The floor area is not specified in most of the cases. In this case, we have assumed it to be equal to the constructed area. Even when this is a rough estimate, it is often the case than the floor area is only slightly smaller than the constructed area, and therefore we have considered this estimation to be an appropriate proxy.  
Finally, for all binary features, we have considered empty values as non-availability of the corresponding features. This seems reasonable within the scope of online listings, since it is more likely that the seller fills the field when the feature is available. For example, in the case of swimming pools, 127 ads specify that the house features a pool, whereas 413 explicitly state that the asset does not include a swimming pool. We will consider that, for those ads where no information is provided about the pool (in this case, a total of 1726), such a pool is not available.