Advanced Analytics and Deep Learning Models. Группа авторов
Чтение книги онлайн.
Читать онлайн книгу Advanced Analytics and Deep Learning Models - Группа авторов страница 15
2.3 Proposed Work
2.3.1 Methodology
There are classified websites where properties are inconsistent in terms of pricing of an apartment, and there are some cases where similar apartments are priced at different price point, and thus, there are a lot of intransparencies. Sometimes, the consumers feels that the pricing is not justified for a particular listed apartment, but there no way to confirm that either. We propose to use three machine learning algorithms: linear regression, LASSO regression, and decision tree algorithm. The tools required for the project are as follows: Python, Sklearn for model building, Jupyter notebook, visual studio code and Pycharm as IDE, Python flask for http server, HTML/CSS/Javascript for UI, Numpy and Pandas for data cleaning, and Matplotlib for data visualization.
2.3.2 Work Flow
Figure 2.1 Flow of work.
2.3.3 The Dataset
The selected dataset has element of the metropolis Bengaluru; it consists of nine columns with contents that is point out under in Table 2.1 and has 13,321 instances. Enforcement of real estate, infidelity in real estate builders inside the city, and actual property sales throughout India in 2017 have dropped by 7%. As an example, for a potential house owner, greater than 9,000 apartments and flats for sale vary between 42 and 52 lakh, and it is observed that more than 7,100 apartments are within the budget 52 to 62 lakh, in step with a property file website Makaan.
Table 2.1 Columns of dataset.
Column name | Description |
---|---|
Area type | The kind of area the flat/plot is in. |
Availability | If the land is currently available or not. |
Location | Location of the land/plot. |
Size | Number of bedrooms and hall kitchen in the flat. |
Society | Name of the cooperating society. |
Total square feet | Area of the plot in square feet. |
Bath | Number of bathroom in the flat. |
Balcony | Number of balcony in the flat. |
Price | Price of the plot/flat. |
2.3.4 Data Handling
2.3.4.1 Missing Values and Data Cleaning
First step is cleaning the data, for which we need to find the null values in the dataset. Figures 2.2 and 2.3 show the number of null values in every column. There are two methods of handling null value: first is that we can drop all the rows with null values, which will result in data loss; the other is that we could calculate the mean of all the values and replace all null values with the mean. Therefore, before cleaning the null value, we drop columns like society and balcony with multiple null values. Along with it, we also drop the columns like area type and availability, as our main goal is to predict the price.
In the size column, there are values with different attributes like 3 BHK and 3 BK, which means different; hence, to generalize, we will create a new column BHK. In this column, we would apply a function where we would tokenize each word; here, we keep the numbers and get rid of the other words. Therefore, we get a column BHK. In the total square feet column, there are entries where range is mention and not exact number; in this case, we replace it with the average of both the number.
Figure 2.2 Missing values.
Figure 2.3 Visualizing missing values using heatmap.
2.3.4.2 Feature Engineering
Feature engineering is the base that will help us further to remove outliers. Here, we combine two columns, apply the formula, and get price per square feet. Then, we find the number of unique location where we get 1,304 locations. Here, some of the locations are just mentioned once or twice; therefore, we set a threshold of 10, so all the locations that appear over five times are considered Figure 2.4.
Figure 2.4 Different BHK attribute.
2.3.4.3 Removing Outliers
Outliers are data points or errors, which represent extreme variations in our dataset. There are techniques to detect outlier; one of them is by visualization. We can graph box plot or scatter plot and, from the patterns, draw inference.
In BHK, there are some flat whose average area of one room is larger, which appears unusual, whereas in some instances, the number of bathroom is larger than number of rooms in the house, hence affecting the result.
The scatter chart was plotted to visualize price per square feet for 2 BHK and 3 BHK properties. Here, the blue points represent the 2 BHK and red points as 3 BHK plots. Based on Figures 2.5 through 2.8 the outliers was remove from the Hebbal region using the “remove bhk outliers function”.
Figure 2.5 Bath visualization.