You are on page 1of 30

PROJECT REPORT

ON

House price prediction

SUBMITTED BY
Naziya Niyaz Shaikh.

SEAT NO:779

PROJECT GUIDE
MS. Sneha Shirkar

BSc. (COMPUTER SCIENCE) SEM -VI

2020 – 2021

CONDUCTED AT
CHIKITSAK SAMUHA’S
S. S. & L.S. PATKAR COLLEGE OF ARTS & SCIENCE
AND
V. P. VARDE COLLEGE OF COMMERCE & ECONOMICS
GOREGAON (W). MUMBAI -400062

1
This is to certify that Ms. Naziya Niyaz Shaikh

of T.Y.B.Sc. Computer Science with University Seat no 779

has completed his/her project titled House Price Prediction under

the guidance of Project Guide Ms. Sneha Shirkar

as laid by University of Mumbai in the college during the year 2020-21.

Project Guide B.Sc. Computer science

Co-ordinator

External Examiner

2
ACKNOWLEDGEMENT

I take this opportunity of submitting this report to express my profound gratitude to the
management of “S.S. & L.S. Patkar College of Science and Commerce” for giving me the
opportunity to accomplish this project work.

I am profoundly grateful to Ms. Sneha Shirkar for her expert guidance and continuous
encouragement throughout to see that this project rights its target.

I would like to express deepest appreciation towards respected Mrs. Namrata Kawale-
Shinde Head of Computer Science Department whose invaluable guidance supported me in
this project.

I would also like to thank to my family and friends without whose support, motivation
and encouragement this would not have been possible in this difficult time.

Thanking You,
Naziya Shaikh

3
INDEX

Sr. No. Content Page No.


1 Introduction 5
1.2 Background of Project 5
1.3 About the Project 5
2 Requirement Specification 6
2.1 Functional requirement 7
2.2 Non- Functional requirement 7
2.3 Hardware requirement 8
2.4 Software requirement 8
3 System planning 9
3.1 Gantt Chart 9
4 System Design 10
4.1 Methodology Adopted 11
4.2 Architecture 11
4.3 UML Diagram 13
4.3.1 Use Case Diagram 13
4.3.2 Activity Diagram 14
4.3.3 Sequence Diagram 15
5 Code Implementation 16

6 Results 24
6.1 Test cases 24
6.2 Screen shots 25
7 conclusion 28
8 references 28

4
1. INTRODUCTION
1.1. Theoretical Background-:

The project “HOUSE PRICE PREDICTION BASED ON SOME


ECONOMIC FACTORS” is an application that is developed to predict the
price of house which is helpful for future of customer. The existing system
predicts about 52% accuracy of price of house and land. This might need
help of land brokers which is time consuming and high cost for the
customers. The proposed system describes Hedonic Pricing model which
accurate 67% exact value of house in future

1.2 Objective and scope of the Project-:

The main objective of developing this system is to save time and cost. The
process of house price prediction needs an appropriate dataset which should
describe all the possibility values of house. Another thing one has to note is
that it does not need much of human resources.

1.3 Proposed System-:

The objective of this project is to predict the house prices so as to minimize


the problems faced by the customer. The present method is that the
customer approaches a real estate agent to manage his/her investments and
suggest suitable estates for his investments. But this method is risky as the
agent might predict wrong estates and thus leading to loss of the customers’
investments. The manual method which is currently used in the market is
out dated and has high risk. So as to overcome this fault, there is a need for
an updated and automated system. The machinelearning algorithm can be
used to help investors to invest in an appropriate estate according to their
mentioned requirements. Also the new system will be cost and time
efficient. This will have simple operations. The proposed system works on
classification algorithm nave Bayes. It will add property details into the
system based on the details the system will predict the hotels' estimated

price when the user searches property the list of property will be displayed
5
.
2. Requirement Specification

2.1 Functional Requirements-:

USER INTERFACE: The user interface will be a website. The user has to
enter all the attributes correctly and in the required format.

PROPER FORECASTING: The system has to properly predict the


price of the house according to the input given by the user.

2.2 Non-Functional Requirements-:

Platform Independent: The application would be platform independent


if all the requirements are installed in the device.

Performance: The application should have better accuracy and should


provide the information in less time.

Capacity: The capacity of the storage should be high so that large


amount of data can be stored in order to train the model.


2.3 Software Requirements-:
Operating System Desktop OS-:windows xp
Coding language Html CSS javascript python
Front-End VScode
Backend Pycharm
Midend Jupyter notebook

2.4 Hardware Requirements-:


Hard Disk Pentium IV 2.4 GHz.
Floppy Drive 1.44 Mb
Monitor 1.44 Mb
Mouse Logitech
Ram 3GB
Android Mobile Version 7.0


2.5 Technologies Used-:

A] Jupyter notebook-: The Jupyter Notebook is an open source web application


that you can use to create and share documents that contain live code, equations,
visualizations, and text. Jupyter Notebook is maintained by the people at Project
Jupyter.
Jupyter Notebooks are a spin-off project from the IPython project, which used to
have an IPython Notebook project itself. The name, Jupyter, comes from the core
supported programming languages that it supports: Julia, Python, and R. Jupyter
ships with the IPython kernel, which allows you to write your programs in Python,
but there are currently over 100 other kernels that you can also use.

B] pycharm-:Many programmers nowadays opt for Python to build software


applications with the concise, clean, and readable code base. They can even
accelerate custom software application development by taking advantage of a
number of integrated development environments (IDEs) for Python.

JetBrains has developed PyCharm as a cross-platform IDE for Python. In addition


to supporting versions 2.x and 3.x of Python, PyCharm is also compatible with
Windows, Linux, and macOS. At the same time, the tools and features provided by
PyCharm help programmers to write a variety of software applications in Python
quickly and efficiently.
The developers can even customize the PyCharm UI according to their specific
needs and preferences. Also, they can extend the IDE by choosing from over 50
plug-ins to meet complex project requirements.

C]VS code:- Visual Studio Code is a lightweight but powerful source code editor
which runs on your desktop and is available for Windows, macOS and Linux. It
comes with
built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of
extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and
runtimes
(such as .NET and Unity).
Visual Studio Code is a streamlined code editor with support for development
operations
like debugging, task running, and version control. It aims to provide just the tools
a developer needs for a quick code-build-debug cycle and leaves more complex
workflows to fuller featured IDEs, such as Visual Studio IDE.


3. System Planning

3.1 Gantt Chart

Definition: A Gantt chart is a useful graphical tool which shows activities or tasks
performed against time. It is also known as visual presentation of a project where the
activities are broken down and displayed on a chart which makes it is easy to understand
and interpret. A Gantt chart is a popular tool in project management. It basically drills
down activities which need to be done by a fixed time period. It is commonly used for
tracking project schedules.

On the chart, tasks are shown on the vertical axis while the scheduled time-spend
is laid out on the horizontal axis. Each task is represented by a bar that shows the time
required for the project.


4. System Design details
4.1Methodology Adopted
Object-Oriented Design (OOD) Methodologies-:

In this method we take a slightly different view of systems development from what we have examined
before. In the previous section we tended to view our system from a functional or process-based
viewpoint, and related this to the data structure. While this approach does produce well-designed,
working systems, the current opinion among many practitioners is that the resulting systems tend to be
rigid and make it difficult to respond quickly to changes in user requirements.

Unlike its two predecessors, the object-oriented approach combines data and processes (called
methods) into single entities called objects. Objects usually correspond to the real things a system deals
with, such as customers, suppliers, contracts, and invoices. Object-oriented models are able to
thoroughly represent complex relationships and to represent data and data processing with a reliable
notation, which allows an easier mix of analysis and design in a growth process. The aim of the Object-
Oriented approach is to make system elements more modular, thus improving system quality and the
efficiency of systems analysis and design.
In the Object-Oriented approach we tend to focus more on the behavior of the system. The main feature
we document is the Object or Class.

What is an Object?

An Object, as we have already stated, is something we hold data about. This is usually in the form of a
noun, e.g. an apple is an object. It has attributes such as size and color and taste.

What is a Class?

A Class is the description of a set of common objects, e.g. the apple would belong to the class Fruits,
which all have similar group characteristics but also wide differences between them: ie another object,
Orange, would also be part of the Fruit class but has different attributes of taste, color and size from an
apple.

4.2 Architecture Process Involved-:


Software Process

Software process (also known as software methodology) is a set of related activities that leads to the
production of the software. These activities may involve the development of the software from the
scratch, or, modifying an existing system.Iterative Process Model

ꞏ Iterative development model aims to develop a system through building small portions of all the
features, across all components.

ꞏ Build a product which meets the initial scope and release it quickly for customer feedback. Early
10 
versions with limited features are important to get customer feedback.

ꞏ In each increment, a slice of system features is delivered, passing through the requirements till the
deployment.

The phases of iterative development:

The phases of iterative development are:

1. Inception: The goal is to establish a business case for the system. We should identify all the external entities
that will interact with the system, and define these interactions. Then, uses this information to assess the
contribution that the system makes to the business. If the contribution is minor, then the project may be
cancelled.

2. Elaboration: We develop an understanding of the problem domain and architecture framework, develop the
project plan, and identify risks.

3. Construction: Incrementally fills-in the architecture with production-ready code produced from analysis,
design, implementation, and testing of the requirements. The components of the system are dependent on each
other and they’re developed in parallel and integrated during this phase. On the completion of this phase, you
should have complete working software.

4. Transition: We deliver the system into the production operating environment.

11 
Iterative Model ‐ Pros and Cons

The advantage of this model is that there is a working model of the system at a very early stage of
development, which makes it easier to find functional or design flaws. Finding issues at an early stage
of development enables to take corrective measures in a limited budget.

The disadvantage with this SDLC model is that it is applicable only to large and bulky software
development projects. This is because it is hard to break a small software system into further small
serviceable increments/modules.

The advantages of the Iterative and Incremental SDLC Model are as follows

 Some working functionality can be developed quickly and early in the life cycle.

 Results are obtained early and periodically.

 Parallel development can be planned.

 Progress can be measured.

 Less costly to change the scope/requirements.

 Testing and debugging during smaller iteration is easy.

12 
4.3.UML Diagrams-:

4.3.1 Use Case Diagram-:

Fig 4.1: Use Case Diagram

13 
4.3.2 Activity Diagram

14 
4.3.3 Sequence Diagram

15 
Data cleaning:
 

 
 

 
 

Model
16 
building: 

17 
UI Building:

<!DOCTYPE html> 
<html> 
 
<head> 
    <title>Banglore Home Price Prediction</title> 
    <meta charset="UTF‐8"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> 
    <script src="app.js"></script> 
    <link rel="stylesheet" href="app.css"> 
    <link rel="stylesheet" media="screen and (max‐width: 1170px)" href="phone.css"> 
    <link href="https://fonts.googleapis.com/css2?family=Baloo+Bhai+2&display=swap" rel="stylesheet"> 
</head> 
 
<body> 
    <nav id="navbar"> 
        <div class="logo"> 
            <img src="bg3.jpg" alt="aao_khana_khao.com"> 
        </div> 
 
        <ul> 
            <li class="item"><a href="#home">Home</a></li> 
            <li class="item"><a href="#services‐container">Services</a></li> 
            <li class="item"><a href="#agent‐section">Our Agents</a></li> 
            <li class="item"><a href="#estimate‐section">Estimation</a></li> 
            <li class="item"><a href="#contact">Contact Us</a></li> 
        </ul> 
 
    </nav> 
 
    <section id="home"> 
        <h1 class="h‐primray">welcome to Real State</h1> 
 
 
    </section> 
    <hr> 
 
 
    <hr> 
    <section id="services‐container"> 
        <h1 class="h‐primary center">Our Services </h1> 
        <div id="services"> 
            <div class="box"> 
                <img src="1.jpg" alt=""> 
                <h2 class="h‐secondery center"> 400 sqft Bunglow($154000)</h2> 
                <p class="center"> 
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa perspiciatis 
placeat deserunt eveniet saepe non earum odit nostrum. unde? 
                </p> 
            </div> 
 
            <div class="box"> 
                <img src="2.jpg" alt=""> 
                <h2 class="h‐secondery center">540 sqft Bunglow($52800)</h2> 
                <p class="center"> 
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa perspiciatis 
placeat deserunt eveniet saepe non earum odit nostrum. unde? 
                </p> 
            </div> 
 
            
18 
                </p> 
            </div> 
        </div> 
    </section> 
    <hr> 
<div class="box"> 
                <img src="3.jpg" alt=""> 
                <h2 class="h‐secondery center">700 sqft Bunglow($52879)</h2> 
                <p class="center"> 
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa perspiciatis 
placeat deserunt eveniet saepe non earum odit nostrum. unde? 
 
 
    <section id="agent‐section"> 
        <h1 class="h‐primary center">Our agents</h1> 
        <div id="agents"> 
            <div class="agent‐item"> 
                <img src="aj1.jpg" alt="Our agent"> 
                <h1>amir siddiqui</h1> 
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia, itaque.</p> 
 
            </div> 
            <div class="agent‐item"> 
                <img src="aj2.jpg" alt="Our agent"> 
                <h1>naziya siddiqui</h1> 
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia, itaque.</p> 
            </div> 
            <div class="agent‐item"> 
                <img src="aj3.jpg" alt="Our agent"> 
                <h1>hamid siddiqui</h1> 
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia, itaque.</p> 
            </div> 
            <div class="agent‐item"> 
                <img src="aj4.jpg" alt="Our agent"> 
                <h1>shaziya siddiqui</h1> 
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia, itaque.</p> 
            </div> 
        </div> 
 
    </section> 
 <section id="estimate‐section"> 
        <h1 class="h‐primary center">Estimation</h1> 
 
        <div class="img"></div> 
        <form class="form"> 
            <h2>Area (Square Feet)</h2> 
            <input class="area" type="text" id="uiSqft" class="floatLabel" name="Squareft" 
value="1000"> 
            <h2>BHK</h2> 
            <div class="switch‐field"> 
                <input type="radio" id="radio‐bhk‐1" name="uiBHK" value="1" /> 
                <label for="radio‐bhk‐1">1</label> 
                <input type="radio" id="radio‐bhk‐2" name="uiBHK" value="2" checked/> 
                <label for="radio‐bhk‐2">2</label> 
                <input type="radio" id="radio‐bhk‐3" name="uiBHK" value="3" /> 
                <label for="radio‐bhk‐3">3</label> 
                <input type="radio" id="radio‐bhk‐4" name="uiBHK" value="4" /> 
                <label for="radio‐bhk‐4">4</label> 
                <input type="radio" id="radio‐bhk‐5" name="uiBHK" value="5" /> 
                <label for="radio‐bhk‐5">5</label> 
            </div> 
        </form> 
        <form class="form"> 
            <h2>Bath</h2> 

19 
            <div class="switch‐field"> 
                <input type="radio" id="radio‐bath‐1" name="uiBathrooms" value="1" /> 
                <label for="radio‐bath‐1">1</label> 
                <input type="radio" id="radio‐bath‐2" name="uiBathrooms" value="2"  
 
 
 
checked/> 
                 
 
 
 
<label for="radio‐bath‐2">2</label> 
               <input type="radio" id="radio‐bath‐3" name="uiBathrooms" value="3" /> 
 
<label for="radio‐bath‐3">3</label> 
                <input type="radio" id="radio‐bath‐4" name="uiBathrooms" value="4" /> 
                <label for="radio‐bath‐4">4</label> 
                <input type="radio" id="radio‐bath‐5" name="uiBathrooms" value="5" /> 
                <label for="radio‐bath‐5">5</label> 
            </div> 
            <h2>Location</h2> 
            <div> 
                <select class="location" name="" id="uiLocations"> 
    <option value="" disabled="disabled" selected="selected">Choose a Location</option> 
    <option>Electronic City</option> 
        <option>Rajaji Nagar</option> 
  </select> 
            </div> 
            <button class="submit" onclick="onClickedEstimatePrice()" type="button">Estimate 
Price</button> 
            <div id="uiEstimatedPrice" class="result"> 
                <h2></h2> 
            </div> 
 
    </section> 
 
 
    <section id="contact"> 
        <h1 class="h‐primary center">Contact Us On</h1> 
        <div id="contact‐box"> 
            <h1 class="h‐primary center">Naziya Siddiqui 7304638998</h1> 
            <h1 class="h‐primary center">naziyasiddiqui7304@gmail.com</h1> 
 
 
 
 
        </div> 
    </section> 
 
</body> 
 
</html> 
 
 
 
 
 
System implementation
Server.py

20 
import pickle
import json
import numpy as np

__locations = None
__data_columns = None
__model = None

def get_estimated_price(location,sqft,bhk,bath):
try:
loc_index = __data_columns.index(location.lower())
except:
loc_index = -1

x = np.zeros(len(__data_columns))
x[0] = sqft
x[1] = bath
x[2] = bhk
if loc_index>=0:
x[loc_index] = 1

return round(__model.predict([x])[0],2)

def load_saved_artifacts():
print("loading saved artifacts...start")
global __data_columns
global __locations

with open("./artifacts/columns.json", "r") as f:


__data_columns = json.load(f)['data_columns']
__locations = __data_columns[3:] # first 3 columns are sqft, bath, bhk

global __model
if __model is None:
with open('./artifacts/banglore_home_prices_model.pickle', 'rb') as f:
__model = pickle.load(f)
print("loading saved artifacts...done")

def get_location_names():
return __locations

def get_data_columns():
return __data_columns

if __name__ == '__main__':
load_saved_artifacts()
print(get_location_names())
print(get_estimated_price('1st Phase JP Nagar',1000, 3, 3))
print(get_estimated_price('1st Phase JP Nagar', 1000, 2, 2))
print(get_estimated_price('Kalhalli', 1000, 2, 2)) # other location
print(get_estimated_price('Ejipura', 1000, 2, 2)) # other location
21 
util.py
import pickle
import json
import numpy as np

__locations = None
__data_columns = None
__model = None

def get_estimated_price(location,sqft,bhk,bath):
try:
loc_index = __data_columns.index(location.lower())
except:
loc_index = -1

x = np.zeros(len(__data_columns))
x[0] = sqft
x[1] = bath
x[2] = bhk
if loc_index>=0:
x[loc_index] = 1

return round(__model.predict([x])[0],2)

def load_saved_artifacts():
print("loading saved artifacts...start")
global __data_columns
global __locations

with open("./artifacts/columns.json", "r") as f:


__data_columns = json.load(f)['data_columns']
__locations = __data_columns[3:] # first 3 columns are sqft, bath, bhk

global __model
if __model is None:
with open('./artifacts/banglore_home_prices_model.pickle', 'rb') as f:
__model = pickle.load(f)
print("loading saved artifacts...done")

def get_location_names():
return __locations

def get_data_columns():
return __data_columns

if __name__ == '__main__':
load_saved_artifacts()
print(get_location_names())

22 
print(get_estimated_price('1st Phase JP Nagar',1000, 3, 3))
print(get_estimated_price('1st Phase JP Nagar', 1000, 2, 2))
print(get_estimated_price('Kalhalli', 1000, 2, 2)) # other location
print(get_estimated_price('Ejipura', 1000, 2, 2)) # other location

23 
6.RESULTS
6.1 TEST CASES-:

Test Module to Why? Expected Output Observed Output Remark


Case be Tested
ID
1. Locations To check It should display Yes, it shows the PASS
whether it it is Proper locations as The proper
showing proper given in the dataset. locations.
locations or not
using get
method
2. To check It should display Yes ,it displays the PASS
No of BHK Whether it the no of BHK correct no of
and bath. takes the and bath BHK and bath
proper input properly. given by the
from user or user.
not.
3. Estimation To check Model should Yes,model is PASS
Whether the able to to working properly
our model is predict the and to is able to
able to home price. predict home
predict the prices.
prices or
not.

24 
6.2 SCREENSHOTS-:
 After opening the website you will get the Home page.

Services Available

25 
Agents Available

House Price Estimation

26 
Checking for locations in banglore

Price prediction in lakhs

27 
7 .Conclusion and Future Scope
7.1Conclusion-:
Traditional house price prediction is based on cost and sale price comparison
lacking of an accepted standard and a certification process. Therefore, the
availability of a house price prediction model helps fill up
an important information gap and improve the efficiency of the real estate market.

7.2Future Scope-:
There are quite a few things that can be polished or add in the future work. • Though, we
were able to identify most of the residential areas. There may be some more places that have
housing complexes or multi-storey apartments which are located in commercial areas. Such
apartments were not included in this paper and can be counted in future to give a more
accurate result. With more and more demand for housing in metropolitan cities, there is a
definite increase in the number private builders that provide real estate with additional
amenities to attract more customers. • There are several other models available that can be
implemented for prediction. Data given as input to such model should be compatible with
the tool used and the operators involved in the process. Also, more number of data sets can
be used to increase the accuracy of the model. The main objective of using a different model
should be to reduce the calculation time and carry out the whole process in ease

28 
8.References
1) IEEE Paper: Seth Y. Fiawoo and Robert Sowah of S.Y. Dept. of
Computer.Engineering, University of Ghana “Design and development of
an Android application to process and display summarized corporate
data” in IEEE 4th international conference of Adaptive Science &
Technology.Year:2012.
2) www.tutorialpoint.com
3) www.google.com
4) www.youtube.com
5) www.w3schools.com
6) www.guardian.com
7)http://developer.android.com

29 

You might also like